X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=ts%2Fbindings.c.body;h=739af0116285184421be5fc5a01cc6f52061f35d;hb=HEAD;hp=214de4e594af3e70279059bba1f5e2d824dc7403;hpb=fae9ae7650d71605b98b1369cfffa3d9989bfe00;p=ldk-java diff --git a/ts/bindings.c.body b/ts/bindings.c.body index 214de4e5..2922658b 100644 --- a/ts/bindings.c.body +++ b/ts/bindings.c.body @@ -219,10 +219,11 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_js(int32_t ord) case 20: return LDKBolt12SemanticError_MissingPayerId; case 21: return LDKBolt12SemanticError_DuplicatePaymentId; case 22: return LDKBolt12SemanticError_MissingPaths; - case 23: return LDKBolt12SemanticError_InvalidPayInfo; - case 24: return LDKBolt12SemanticError_MissingCreationTime; - case 25: return LDKBolt12SemanticError_MissingPaymentHash; - case 26: return LDKBolt12SemanticError_MissingSignature; + case 23: return LDKBolt12SemanticError_UnexpectedPaths; + case 24: return LDKBolt12SemanticError_InvalidPayInfo; + case 25: return LDKBolt12SemanticError_MissingCreationTime; + case 26: return LDKBolt12SemanticError_MissingPaymentHash; + case 27: return LDKBolt12SemanticError_MissingSignature; } abort(); } @@ -251,10 +252,11 @@ static inline int32_t LDKBolt12SemanticError_to_js(LDKBolt12SemanticError val) { case LDKBolt12SemanticError_MissingPayerId: return 20; case LDKBolt12SemanticError_DuplicatePaymentId: return 21; case LDKBolt12SemanticError_MissingPaths: return 22; - case LDKBolt12SemanticError_InvalidPayInfo: return 23; - case LDKBolt12SemanticError_MissingCreationTime: return 24; - case LDKBolt12SemanticError_MissingPaymentHash: return 25; - case LDKBolt12SemanticError_MissingSignature: return 26; + case LDKBolt12SemanticError_UnexpectedPaths: return 23; + case LDKBolt12SemanticError_InvalidPayInfo: return 24; + case LDKBolt12SemanticError_MissingCreationTime: return 25; + case LDKBolt12SemanticError_MissingPaymentHash: return 26; + case LDKBolt12SemanticError_MissingSignature: return 27; default: abort(); } } @@ -316,6 +318,7 @@ static inline LDKConfirmationTarget LDKConfirmationTarget_from_js(int32_t ord) { case 3: return LDKConfirmationTarget_AnchorChannelFee; case 4: return LDKConfirmationTarget_NonAnchorChannelFee; case 5: return LDKConfirmationTarget_ChannelCloseMinimum; + case 6: return LDKConfirmationTarget_OutputSpendingFee; } abort(); } @@ -327,6 +330,7 @@ static inline int32_t LDKConfirmationTarget_to_js(LDKConfirmationTarget val) { case LDKConfirmationTarget_AnchorChannelFee: return 3; case LDKConfirmationTarget_NonAnchorChannelFee: return 4; case LDKConfirmationTarget_ChannelCloseMinimum: return 5; + case LDKConfirmationTarget_OutputSpendingFee: return 6; default: abort(); } } @@ -372,6 +376,20 @@ static inline int32_t LDKCurrency_to_js(LDKCurrency val) { default: abort(); } } +static inline LDKDirection LDKDirection_from_js(int32_t ord) { + switch (ord) { + case 0: return LDKDirection_NodeOne; + case 1: return LDKDirection_NodeTwo; + } + abort(); +} +static inline int32_t LDKDirection_to_js(LDKDirection val) { + switch (val) { + case LDKDirection_NodeOne: return 0; + case LDKDirection_NodeTwo: return 1; + default: abort(); + } +} static inline LDKHTLCClaim LDKHTLCClaim_from_js(int32_t ord) { switch (ord) { case 0: return LDKHTLCClaim_OfferedTimeout; @@ -438,6 +456,24 @@ static inline int32_t LDKIOError_to_js(LDKIOError val) { default: abort(); } } +static inline LDKInboundHTLCStateDetails LDKInboundHTLCStateDetails_from_js(int32_t ord) { + switch (ord) { + case 0: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKInboundHTLCStateDetails_Committed; + case 2: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill; + case 3: return LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail; + } + abort(); +} +static inline int32_t LDKInboundHTLCStateDetails_to_js(LDKInboundHTLCStateDetails val) { + switch (val) { + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKInboundHTLCStateDetails_Committed: return 1; + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFulfill: return 2; + case LDKInboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFail: return 3; + default: abort(); + } +} static inline LDKLevel LDKLevel_from_js(int32_t ord) { switch (ord) { case 0: return LDKLevel_Gossip; @@ -478,6 +514,24 @@ static inline int32_t LDKNetwork_to_js(LDKNetwork val) { default: abort(); } } +static inline LDKOutboundHTLCStateDetails LDKOutboundHTLCStateDetails_from_js(int32_t ord) { + switch (ord) { + case 0: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd; + case 1: return LDKOutboundHTLCStateDetails_Committed; + case 2: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess; + case 3: return LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure; + } + abort(); +} +static inline int32_t LDKOutboundHTLCStateDetails_to_js(LDKOutboundHTLCStateDetails val) { + switch (val) { + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToAdd: return 0; + case LDKOutboundHTLCStateDetails_Committed: return 1; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveSuccess: return 2; + case LDKOutboundHTLCStateDetails_AwaitingRemoteRevokeToRemoveFailure: return 3; + default: abort(); + } +} static inline LDKPaymentFailureReason LDKPaymentFailureReason_from_js(int32_t ord) { switch (ord) { case 0: return LDKPaymentFailureReason_RecipientRejected; @@ -562,6 +616,22 @@ static inline int32_t LDKSecp256k1Error_to_js(LDKSecp256k1Error val) { default: abort(); } } +static inline LDKShortChannelIdError LDKShortChannelIdError_from_js(int32_t ord) { + switch (ord) { + case 0: return LDKShortChannelIdError_BlockOverflow; + case 1: return LDKShortChannelIdError_TxIndexOverflow; + case 2: return LDKShortChannelIdError_VoutIndexOverflow; + } + abort(); +} +static inline int32_t LDKShortChannelIdError_to_js(LDKShortChannelIdError val) { + switch (val) { + case LDKShortChannelIdError_BlockOverflow: return 0; + case LDKShortChannelIdError_TxIndexOverflow: return 1; + case LDKShortChannelIdError_VoutIndexOverflow: return 2; + default: abort(); + } +} static inline LDKSiPrefix LDKSiPrefix_from_js(int32_t ord) { switch (ord) { case 0: return LDKSiPrefix_Milli; @@ -663,6 +733,54 @@ int8_t __attribute__((export_name("TS_LDKBech32Error_InvalidData_get_invalid_dat int8_t invalid_data_conv = obj->invalid_data; return invalid_data_conv; } +static inline struct LDKRefundMaybeWithDerivedMetadataBuilder CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKRefundMaybeWithDerivedMetadataBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKRefund CResult_RefundBolt12SemanticErrorZ_get_ok(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKRefund ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_get_ok"))) TS_CResult_RefundBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_RefundBolt12SemanticErrorZ_get_err(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_get_err"))) TS_CResult_RefundBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_RefundBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + 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) { @@ -735,6 +853,7 @@ uint32_t __attribute__((export_name("TS_LDKDecodeError_ty_from_ptr"))) TS_LDKDec case LDKDecodeError_BadLengthDescriptor: return 4; case LDKDecodeError_Io: return 5; case LDKDecodeError_UnsupportedCompression: return 6; + case LDKDecodeError_DangerousValue: return 7; default: abort(); } } @@ -966,6 +1085,74 @@ void __attribute__((export_name("TS_CResult_RecipientOnionFieldsNoneZ_get_err") CResult_RecipientOnionFieldsNoneZ_get_err(owner_conv); } +static inline struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKUnsignedBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKBolt12Invoice ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int8_tArray __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_get_ok"))) TS_CResult_SchnorrSignatureNoneZ_get_ok(uint64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form, 64); + return ret_arr; +} + +static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_get_err"))) TS_CResult_SchnorrSignatureNoneZ_get_err(uint64_t owner) { + LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); + CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +} + static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) { LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -996,6 +1183,76 @@ ptrArray __attribute__((export_name("TS_LDKCOption_CVec_ThirtyTwoBytesZZ_Some_ge return some_arr; } +uint32_t __attribute__((export_name("TS_LDKAmount_ty_from_ptr"))) TS_LDKAmount_ty_from_ptr(uint64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + switch(obj->tag) { + case LDKAmount_Bitcoin: return 0; + case LDKAmount_Currency: return 1; + default: abort(); + } +} +int64_t __attribute__((export_name("TS_LDKAmount_Bitcoin_get_amount_msats"))) TS_LDKAmount_Bitcoin_get_amount_msats(uint64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + assert(obj->tag == LDKAmount_Bitcoin); + int64_t amount_msats_conv = obj->bitcoin.amount_msats; + return amount_msats_conv; +} +int8_tArray __attribute__((export_name("TS_LDKAmount_Currency_get_iso4217_code"))) TS_LDKAmount_Currency_get_iso4217_code(uint64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + assert(obj->tag == LDKAmount_Currency); + int8_tArray iso4217_code_arr = init_int8_tArray(3, __LINE__); + memcpy(iso4217_code_arr->elems, obj->currency.iso4217_code.data, 3); + return iso4217_code_arr; +} +int64_t __attribute__((export_name("TS_LDKAmount_Currency_get_amount"))) TS_LDKAmount_Currency_get_amount(uint64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + assert(obj->tag == LDKAmount_Currency); + int64_t amount_conv = obj->currency.amount; + return amount_conv; +} +uint32_t __attribute__((export_name("TS_LDKCOption_AmountZ_ty_from_ptr"))) TS_LDKCOption_AmountZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_AmountZ_Some: return 0; + case LDKCOption_AmountZ_None: return 1; + default: abort(); + } +} +uint64_t __attribute__((export_name("TS_LDKCOption_AmountZ_Some_get_some"))) TS_LDKCOption_AmountZ_Some_get_some(uint64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_AmountZ_Some); + uint64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} +uint32_t __attribute__((export_name("TS_LDKQuantity_ty_from_ptr"))) TS_LDKQuantity_ty_from_ptr(uint64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + switch(obj->tag) { + case LDKQuantity_Bounded: return 0; + case LDKQuantity_Unbounded: return 1; + case LDKQuantity_One: return 2; + default: abort(); + } +} +int64_t __attribute__((export_name("TS_LDKQuantity_Bounded_get_bounded"))) TS_LDKQuantity_Bounded_get_bounded(uint64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + assert(obj->tag == LDKQuantity_Bounded); + int64_t bounded_conv = obj->bounded; + return bounded_conv; +} +uint32_t __attribute__((export_name("TS_LDKCOption_QuantityZ_ty_from_ptr"))) TS_LDKCOption_QuantityZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_QuantityZ_Some: return 0; + case LDKCOption_QuantityZ_None: return 1; + default: abort(); + } +} +uint64_t __attribute__((export_name("TS_LDKCOption_QuantityZ_Some_get_some"))) TS_LDKCOption_QuantityZ_Some_get_some(uint64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_QuantityZ_Some); + uint64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return ThirtyTwoBytes_clone(&*owner->contents.result); @@ -1360,44 +1617,45 @@ void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err") CResult_RecoverableSignatureNoneZ_get_err(owner_conv); } -static inline struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +static inline struct LDKECDSASignature CResult_ECDSASignatureNoneZ_get_ok(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -int8_tArray __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_get_ok"))) TS_CResult_SchnorrSignatureNoneZ_get_ok(uint64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); +int8_tArray __attribute__((export_name("TS_CResult_ECDSASignatureNoneZ_get_ok"))) TS_CResult_ECDSASignatureNoneZ_get_ok(uint64_t owner) { + LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, CResult_SchnorrSignatureNoneZ_get_ok(owner_conv).compact_form, 64); + memcpy(ret_arr->elems, CResult_ECDSASignatureNoneZ_get_ok(owner_conv).compact_form, 64); return ret_arr; } -static inline void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner){ +static inline void CResult_ECDSASignatureNoneZ_get_err(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_get_err"))) TS_CResult_SchnorrSignatureNoneZ_get_err(uint64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +void __attribute__((export_name("TS_CResult_ECDSASignatureNoneZ_get_err"))) TS_CResult_ECDSASignatureNoneZ_get_err(uint64_t owner) { + LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); + CResult_ECDSASignatureNoneZ_get_err(owner_conv); } -static inline struct LDKECDSASignature CResult_ECDSASignatureNoneZ_get_ok(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ +static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return *owner->contents.result; } -int8_tArray __attribute__((export_name("TS_CResult_ECDSASignatureNoneZ_get_ok"))) TS_CResult_ECDSASignatureNoneZ_get_ok(uint64_t owner) { - LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, CResult_ECDSASignatureNoneZ_get_ok(owner_conv).compact_form, 64); +int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) { + LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); + LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(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 void CResult_ECDSASignatureNoneZ_get_err(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner){ +static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return *owner->contents.err; } -void __attribute__((export_name("TS_CResult_ECDSASignatureNoneZ_get_err"))) TS_CResult_ECDSASignatureNoneZ_get_err(uint64_t owner) { - LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); - CResult_ECDSASignatureNoneZ_get_err(owner_conv); +void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) { + LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); + CResult_TransactionNoneZ_get_err(owner_conv); } static inline struct LDKECDSASignature C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner){ @@ -2270,27 +2528,6 @@ uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ return ret_ref; } -static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) { - LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); - LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(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 void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) { - LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); - CResult_TransactionNoneZ_get_err(owner_conv); -} - static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) { LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -2893,6 +3130,32 @@ uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ return ret_ref; } +static inline struct LDKBestBlock CResult_BestBlockDecodeErrorZ_get_ok(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR owner){ + LDKBestBlock ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_get_ok"))) TS_CResult_BestBlockDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_BestBlockDecodeErrorZ* owner_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(owner); + LDKBestBlock ret_var = CResult_BestBlockDecodeErrorZ_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_BestBlockDecodeErrorZ_get_err(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_get_err"))) TS_CResult_BestBlockDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_BestBlockDecodeErrorZ* owner_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_BestBlockDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){ return owner->a; } @@ -2976,12 +3239,48 @@ void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateStatusNoneZ_get CResult_ChannelMonitorUpdateStatusNoneZ_get_err(owner_conv); } +uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + switch(obj->tag) { + case LDKClosureReason_CounterpartyForceClosed: return 0; + case LDKClosureReason_HolderForceClosed: return 1; + case LDKClosureReason_LegacyCooperativeClosure: return 2; + case LDKClosureReason_CounterpartyInitiatedCooperativeClosure: return 3; + case LDKClosureReason_LocallyInitiatedCooperativeClosure: return 4; + case LDKClosureReason_CommitmentTxConfirmed: return 5; + case LDKClosureReason_FundingTimedOut: return 6; + case LDKClosureReason_ProcessingError: return 7; + case LDKClosureReason_DisconnectedPeer: return 8; + case LDKClosureReason_OutdatedChannelManager: return 9; + case LDKClosureReason_CounterpartyCoopClosedUnfundedChannel: return 10; + case LDKClosureReason_FundingBatchClosure: return 11; + case LDKClosureReason_HTLCsTimedOut: return 12; + default: abort(); + } +} +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); + 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); + assert(obj->tag == LDKClosureReason_ProcessingError); + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len); + return err_conv; +} 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_HolderForceClosed: return 1; - case LDKMonitorEvent_Completed: return 2; + case LDKMonitorEvent_HolderForceClosedWithInfo: return 1; + case LDKMonitorEvent_HolderForceClosed: return 2; + case LDKMonitorEvent_Completed: return 3; default: abort(); } } @@ -2994,6 +3293,30 @@ uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event htlc_event_ref = tag_ptr(htlc_event_var.inner, false); return htlc_event_ref; } +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HolderForceClosedWithInfo_get_reason"))) TS_LDKMonitorEvent_HolderForceClosedWithInfo_get_reason(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + uint64_t reason_ref = tag_ptr(&obj->holder_force_closed_with_info.reason, false); + return reason_ref; +} +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint"))) TS_LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKOutPoint outpoint_var = obj->holder_force_closed_with_info.outpoint; + uint64_t outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); + outpoint_ref = tag_ptr(outpoint_var.inner, false); + return outpoint_ref; +} +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id"))) TS_LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKChannelId channel_id_var = obj->holder_force_closed_with_info.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HolderForceClosed_get_holder_force_closed"))) TS_LDKMonitorEvent_HolderForceClosed_get_holder_force_closed(uint64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); assert(obj->tag == LDKMonitorEvent_HolderForceClosed); @@ -3012,6 +3335,15 @@ uint64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_funding_tx funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } +uint64_t __attribute__((export_name("TS_LDKMonitorEvent_Completed_get_channel_id"))) TS_LDKMonitorEvent_Completed_get_channel_id(uint64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + assert(obj->tag == LDKMonitorEvent_Completed); + LDKChannelId channel_id_var = obj->completed.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_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); @@ -3025,26 +3357,40 @@ static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_Monit } return ret; } -static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ +static inline struct LDKOutPoint C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ LDKOutPoint ret = owner->a; 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_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKOutPoint ret_var = C4Tuple_OutPointChannelIdCVec_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 LDKChannelId C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->b; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_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 LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - return CVec_MonitorEventZ_clone(&owner->b); +static inline struct LDKCVec_MonitorEventZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + return CVec_MonitorEventZ_clone(&owner->c); } -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 __attribute__((export_name("TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKCVec_MonitorEventZ ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(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); @@ -3059,20 +3405,20 @@ uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZ return ret_arr; } -static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ - return owner->c; +static inline struct LDKPublicKey C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){ + return owner->d; } -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 __attribute__((export_name("TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(uint64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_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); + memcpy(ret_arr->elems, C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(owner_conv).compressed_form, 33); return ret_arr; } -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 }; +static inline LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ *orig) { + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C4Tuple_OutPointChannelIdCVec_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]); + ret.data[i] = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]); } return ret; } @@ -3258,6 +3604,123 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ return ret_ref; } +static inline struct LDKOfferId CResult_OfferIdDecodeErrorZ_get_ok(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner){ + LDKOfferId ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_get_ok"))) TS_CResult_OfferIdDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_OfferIdDecodeErrorZ* owner_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(owner); + LDKOfferId ret_var = CResult_OfferIdDecodeErrorZ_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_OfferIdDecodeErrorZ_get_err(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_get_err"))) TS_CResult_OfferIdDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_OfferIdDecodeErrorZ* owner_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OfferIdDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline void CResult_NoneBolt12SemanticErrorZ_get_ok(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +void __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_get_ok"))) TS_CResult_NoneBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); + CResult_NoneBolt12SemanticErrorZ_get_ok(owner_conv); +} + +static inline enum LDKBolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_get_err"))) TS_CResult_NoneBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_NoneBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKOffer CResult_OfferBolt12SemanticErrorZ_get_ok(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKOffer ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_get_ok"))) TS_CResult_OfferBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_OfferBolt12SemanticErrorZ_get_err(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_get_err"))) TS_CResult_OfferBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_OfferBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequestWithDerivedPayerIdBuilder CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestWithDerivedPayerIdBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok"))) TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithDerivedPayerIdBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err"))) TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequestWithExplicitPayerIdBuilder CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestWithExplicitPayerIdBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok"))) TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithExplicitPayerIdBuilder ret_var = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err"))) TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner){ LDKOffer ret = *owner->contents.result; ret.is_owned = false; @@ -3286,27 +3749,6 @@ uint64_t __attribute__((export_name("TS_CResult_OfferBolt12ParseErrorZ_get_err" return ret_ref; } -static inline struct LDKPublicKey CResult_PublicKeySecp256k1ErrorZ_get_ok(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -int8_tArray __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_get_ok"))) TS_CResult_PublicKeySecp256k1ErrorZ_get_ok(uint64_t owner) { - LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, CResult_PublicKeySecp256k1ErrorZ_get_ok(owner_conv).compressed_form, 33); - return ret_arr; -} - -static inline enum LDKSecp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -uint32_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_get_err"))) TS_CResult_PublicKeySecp256k1ErrorZ_get_err(uint64_t owner) { - LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); - uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeySecp256k1ErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){ LDKNodeId ret = *owner->contents.result; ret.is_owned = false; @@ -3333,6 +3775,27 @@ uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) return ret_ref; } +static inline struct LDKPublicKey CResult_PublicKeySecp256k1ErrorZ_get_ok(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int8_tArray __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_get_ok"))) TS_CResult_PublicKeySecp256k1ErrorZ_get_ok(uint64_t owner) { + LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, CResult_PublicKeySecp256k1ErrorZ_get_ok(owner_conv).compressed_form, 33); + return ret_arr; +} + +static inline enum LDKSecp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +uint32_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_get_err"))) TS_CResult_PublicKeySecp256k1ErrorZ_get_err(uint64_t owner) { + LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeySecp256k1ErrorZ_get_err(owner_conv)); + return ret_conv; +} + 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) { @@ -4617,6 +5080,26 @@ uint64_tArray __attribute__((export_name("TS_LDKCOption_CVec_SocketAddressZZ_Som return some_arr; } +static inline uint64_t CResult_u64ShortChannelIdErrorZ_get_ok(LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +int64_t __attribute__((export_name("TS_CResult_u64ShortChannelIdErrorZ_get_ok"))) TS_CResult_u64ShortChannelIdErrorZ_get_ok(uint64_t owner) { + LDKCResult_u64ShortChannelIdErrorZ* owner_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(owner); + int64_t ret_conv = CResult_u64ShortChannelIdErrorZ_get_ok(owner_conv); + return ret_conv; +} + +static inline enum LDKShortChannelIdError CResult_u64ShortChannelIdErrorZ_get_err(LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return ShortChannelIdError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_u64ShortChannelIdErrorZ_get_err"))) TS_CResult_u64ShortChannelIdErrorZ_get_err(uint64_t owner) { + LDKCResult_u64ShortChannelIdErrorZ* owner_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKShortChannelIdError_to_js(CResult_u64ShortChannelIdErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline struct LDKPendingHTLCInfo CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR owner){ LDKPendingHTLCInfo ret = *owner->contents.result; ret.is_owned = false; @@ -4741,6 +5224,56 @@ void __attribute__((export_name("TS_CResult_CVec_UtxoZNoneZ_get_err"))) TS_CRes CResult_CVec_UtxoZNoneZ_get_err(owner_conv); } +uint32_t __attribute__((export_name("TS_LDKPaymentContext_ty_from_ptr"))) TS_LDKPaymentContext_ty_from_ptr(uint64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + switch(obj->tag) { + case LDKPaymentContext_Unknown: return 0; + case LDKPaymentContext_Bolt12Offer: return 1; + case LDKPaymentContext_Bolt12Refund: return 2; + default: abort(); + } +} +uint64_t __attribute__((export_name("TS_LDKPaymentContext_Unknown_get_unknown"))) TS_LDKPaymentContext_Unknown_get_unknown(uint64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentContext_Unknown); + LDKUnknownPaymentContext unknown_var = obj->unknown; + uint64_t unknown_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(unknown_var); + unknown_ref = tag_ptr(unknown_var.inner, false); + return unknown_ref; +} +uint64_t __attribute__((export_name("TS_LDKPaymentContext_Bolt12Offer_get_bolt12_offer"))) TS_LDKPaymentContext_Bolt12Offer_get_bolt12_offer(uint64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentContext_Bolt12Offer); + LDKBolt12OfferContext bolt12_offer_var = obj->bolt12_offer; + uint64_t bolt12_offer_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(bolt12_offer_var); + bolt12_offer_ref = tag_ptr(bolt12_offer_var.inner, false); + return bolt12_offer_ref; +} +uint64_t __attribute__((export_name("TS_LDKPaymentContext_Bolt12Refund_get_bolt12_refund"))) TS_LDKPaymentContext_Bolt12Refund_get_bolt12_refund(uint64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentContext_Bolt12Refund); + LDKBolt12RefundContext bolt12_refund_var = obj->bolt12_refund; + uint64_t bolt12_refund_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(bolt12_refund_var); + bolt12_refund_ref = tag_ptr(bolt12_refund_var.inner, false); + return bolt12_refund_ref; +} +uint32_t __attribute__((export_name("TS_LDKCOption_PaymentContextZ_ty_from_ptr"))) TS_LDKCOption_PaymentContextZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_PaymentContextZ *obj = (LDKCOption_PaymentContextZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_PaymentContextZ_Some: return 0; + case LDKCOption_PaymentContextZ_None: return 1; + default: abort(); + } +} +uint64_t __attribute__((export_name("TS_LDKCOption_PaymentContextZ_Some_get_some"))) TS_LDKCOption_PaymentContextZ_Some_get_some(uint64_t ptr) { + LDKCOption_PaymentContextZ *obj = (LDKCOption_PaymentContextZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_PaymentContextZ_Some); + uint64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} static inline uint64_t C2Tuple_u64u16Z_get_a(LDKC2Tuple_u64u16Z *NONNULL_PTR owner){ return owner->a; } @@ -4775,39 +5308,28 @@ uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u16ZZ_Some_get_som *some_conv = C2Tuple_u64u16Z_clone(some_conv); return tag_ptr(some_conv, true); } -uint32_t __attribute__((export_name("TS_LDKCOption_ChannelShutdownStateZ_ty_from_ptr"))) TS_LDKCOption_ChannelShutdownStateZ_ty_from_ptr(uint64_t ptr) { - LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); - switch(obj->tag) { - case LDKCOption_ChannelShutdownStateZ_Some: return 0; - case LDKCOption_ChannelShutdownStateZ_None: return 1; - default: abort(); - } -} -uint32_t __attribute__((export_name("TS_LDKCOption_ChannelShutdownStateZ_Some_get_some"))) TS_LDKCOption_ChannelShutdownStateZ_Some_get_some(uint64_t ptr) { - LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); - assert(obj->tag == LDKCOption_ChannelShutdownStateZ_Some); - uint32_t some_conv = LDKChannelShutdownState_to_js(obj->some); - return some_conv; -} -static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesAPIErrorZ_get_ok(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ThirtyTwoBytes_clone(&*owner->contents.result); +static inline struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ + LDKChannelId ret = *owner->contents.result; + ret.is_owned = false; + return ret; } -int8_tArray __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_get_ok"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(uint64_t owner) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, CResult_ThirtyTwoBytesAPIErrorZ_get_ok(owner_conv).data, 32); - return ret_arr; +uint64_t __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_get_ok"))) TS_CResult_ChannelIdAPIErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelIdAPIErrorZ* owner_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdAPIErrorZ_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 LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ +static inline struct LDKAPIError CResult_ChannelIdAPIErrorZ_get_err(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return APIError_clone(&*owner->contents.err); } -uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_get_err"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_get_err(uint64_t owner) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); +uint64_t __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_get_err"))) TS_CResult_ChannelIdAPIErrorZ_get_err(uint64_t owner) { + LDKCResult_ChannelIdAPIErrorZ* owner_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(owner); LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = CResult_ThirtyTwoBytesAPIErrorZ_get_err(owner_conv); + *ret_copy = CResult_ChannelIdAPIErrorZ_get_err(owner_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5142,33 +5664,68 @@ uint64_t __attribute__((export_name("TS_CResult_CVec_C2Tuple_ThirtyTwoBytesThir return ret_ref; } -static inline struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR owner){ - return ThirtyTwoBytes_clone(&owner->a); +static inline struct LDKChannelId C2Tuple_ChannelIdPublicKeyZ_get_a(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->a; + ret.is_owned = false; + return ret; } -int8_tArray __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a"))) TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(uint64_t owner) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(owner_conv).data, 32); - return ret_arr; +uint64_t __attribute__((export_name("TS_C2Tuple_ChannelIdPublicKeyZ_get_a"))) TS_C2Tuple_ChannelIdPublicKeyZ_get_a(uint64_t owner) { + LDKC2Tuple_ChannelIdPublicKeyZ* owner_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_ChannelIdPublicKeyZ_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 LDKPublicKey C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR owner){ +static inline struct LDKPublicKey C2Tuple_ChannelIdPublicKeyZ_get_b(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner){ return owner->b; } -int8_tArray __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b"))) TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(uint64_t owner) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(owner); +int8_tArray __attribute__((export_name("TS_C2Tuple_ChannelIdPublicKeyZ_get_b"))) TS_C2Tuple_ChannelIdPublicKeyZ_get_b(uint64_t owner) { + LDKC2Tuple_ChannelIdPublicKeyZ* owner_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(owner); int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(owner_conv).compressed_form, 33); + memcpy(ret_arr->elems, C2Tuple_ChannelIdPublicKeyZ_get_b(owner_conv).compressed_form, 33); return ret_arr; } -static inline LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_clone(const LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ *orig) { - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ) * orig->datalen, "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_C2Tuple_ChannelIdPublicKeyZZ CVec_C2Tuple_ChannelIdPublicKeyZZ_clone(const LDKCVec_C2Tuple_ChannelIdPublicKeyZZ *orig) { + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ) * orig->datalen, "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_ChannelIdPublicKeyZ_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_ChannelIdZ CVec_ChannelIdZ_clone(const LDKCVec_ChannelIdZ *orig) { + LDKCVec_ChannelIdZ ret = { .data = MALLOC(sizeof(LDKChannelId) * orig->datalen, "LDKCVec_ChannelIdZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(&orig->data[i]); + ret.data[i] = ChannelId_clone(&orig->data[i]); } return ret; } +static inline struct LDKOfferWithDerivedMetadataBuilder CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKOfferWithDerivedMetadataBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOfferWithDerivedMetadataBuilder ret_var = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t __attribute__((export_name("TS_LDKCOption_StrZ_ty_from_ptr"))) TS_LDKCOption_StrZ_ty_from_ptr(uint64_t ptr) { LDKCOption_StrZ *obj = (LDKCOption_StrZ*)untag_ptr(ptr); switch(obj->tag) { @@ -5184,25 +5741,6 @@ jstring __attribute__((export_name("TS_LDKCOption_StrZ_Some_get_some"))) TS_LDKC jstring some_conv = str_ref_to_ts(some_str.chars, some_str.len); return some_conv; } -static inline void CResult_NoneBolt12SemanticErrorZ_get_ok(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -void __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_get_ok"))) TS_CResult_NoneBolt12SemanticErrorZ_get_ok(uint64_t owner) { - LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); - CResult_NoneBolt12SemanticErrorZ_get_ok(owner_conv); -} - -static inline enum LDKBolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return Bolt12SemanticError_clone(&*owner->contents.err); -} -uint32_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_get_err"))) TS_CResult_NoneBolt12SemanticErrorZ_get_err(uint64_t owner) { - LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); - uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_NoneBolt12SemanticErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return C2Tuple_ThirtyTwoBytesThirtyTwoBytesZ_clone(&*owner->contents.result); @@ -5223,6 +5761,29 @@ void __attribute__((export_name("TS_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoByte CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(owner_conv); } +static inline struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesAPIErrorZ_get_ok(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ThirtyTwoBytes_clone(&*owner->contents.result); +} +int8_tArray __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_get_ok"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(uint64_t owner) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, CResult_ThirtyTwoBytesAPIErrorZ_get_ok(owner_conv).data, 32); + return ret_arr; +} + +static inline struct LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return APIError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_get_err"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_get_err(uint64_t owner) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = CResult_ThirtyTwoBytesAPIErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t __attribute__((export_name("TS_LDKOffersMessage_ty_from_ptr"))) TS_LDKOffersMessage_ty_from_ptr(uint64_t ptr) { LDKOffersMessage *obj = (LDKOffersMessage*)untag_ptr(ptr); switch(obj->tag) { @@ -5340,84 +5901,6 @@ static inline LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ CVec_C3Tuple } return ret; } -static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ - LDKCounterpartyForwardingInfo ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelCounterparty ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ - LDKChannelDetails ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){ LDKPhantomRouteHints ret = *owner->contents.result; ret.is_owned = false; @@ -5518,6 +6001,12 @@ uint64_t __attribute__((export_name("TS_LDKPendingHTLCRouting_Receive_get_paymen uint64_t payment_metadata_ref = tag_ptr(&obj->receive.payment_metadata, false); return payment_metadata_ref; } +uint64_t __attribute__((export_name("TS_LDKPendingHTLCRouting_Receive_get_payment_context"))) TS_LDKPendingHTLCRouting_Receive_get_payment_context(uint64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + assert(obj->tag == LDKPendingHTLCRouting_Receive); + uint64_t payment_context_ref = tag_ptr(&obj->receive.payment_context, false); + return payment_context_ref; +} int32_t __attribute__((export_name("TS_LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry"))) TS_LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry(uint64_t ptr) { LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); assert(obj->tag == LDKPendingHTLCRouting_Receive); @@ -5597,6 +6086,12 @@ uint64_tArray __attribute__((export_name("TS_LDKPendingHTLCRouting_ReceiveKeysen return custom_tlvs_arr; } +jboolean __attribute__((export_name("TS_LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error"))) TS_LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error(uint64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + assert(obj->tag == LDKPendingHTLCRouting_ReceiveKeysend); + jboolean requires_blinded_error_conv = obj->receive_keysend.requires_blinded_error; + return requires_blinded_error_conv; +} static inline struct LDKPendingHTLCRouting CResult_PendingHTLCRoutingDecodeErrorZ_get_ok(LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return PendingHTLCRouting_clone(&*owner->contents.result); @@ -5669,28 +6164,6 @@ uint64_t __attribute__((export_name("TS_CResult_BlindedFailureDecodeErrorZ_get_ return ret_ref; } -static inline enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return ChannelShutdownState_clone(&*owner->contents.result); -} -uint32_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_get_ok"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); - uint32_t ret_conv = LDKChannelShutdownState_to_js(CResult_ChannelShutdownStateDecodeErrorZ_get_ok(owner_conv)); - return ret_conv; -} - -static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_get_err"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) { LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -5740,23 +6213,23 @@ LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } -LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { +LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) { LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg; uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, 0, 0, 0, 0, 0, 0); - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr; + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) - ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements"); + ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ Elements"); else ret_constr.data = NULL; uint64_t* ret_vals = ret->elems; - for (size_t x = 0; x < ret_constr.datalen; x++) { - uint64_t ret_conv_49 = ret_vals[x]; - void* ret_conv_49_ptr = untag_ptr(ret_conv_49); - CHECK_ACCESS(ret_conv_49_ptr); - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr); - FREE(untag_ptr(ret_conv_49)); - ret_constr.data[x] = ret_conv_49_conv; + for (size_t f = 0; f < ret_constr.datalen; f++) { + uint64_t ret_conv_57 = ret_vals[f]; + void* ret_conv_57_ptr = untag_ptr(ret_conv_57); + CHECK_ACCESS(ret_conv_57_ptr); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ ret_conv_57_conv = *(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)(ret_conv_57_ptr); + FREE(untag_ptr(ret_conv_57)); + ret_constr.data[f] = ret_conv_57_conv; } FREE(ret); return ret_constr; @@ -5825,14 +6298,14 @@ uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_even void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr; - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg); + LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_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 x = 0; x < ret_var.datalen; x++) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + for (size_t f = 0; f < ret_var.datalen; f++) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv_57_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv_57_conv = ret_var.data[f]; + ret_arr_ptr[f] = tag_ptr(ret_conv_57_conv, true); } FREE(ret_var.data); @@ -6065,7 +6538,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedInvoiceRequest invoice_request_var = *invoice_request; uint64_t invoice_request_ref = 0; - // WARNING: we may need a move here but no clone is available for LDKUnsignedInvoiceRequest + invoice_request_var = UnsignedInvoiceRequest_clone(&invoice_request_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_var); invoice_request_ref = tag_ptr(invoice_request_var.inner, invoice_request_var.is_owned); uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 27, invoice_request_ref, 0, 0, 0, 0, 0); @@ -6079,7 +6552,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const v LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedBolt12Invoice invoice_var = *invoice; uint64_t invoice_ref = 0; - // WARNING: we may need a move here but no clone is available for LDKUnsignedBolt12Invoice + invoice_var = UnsignedBolt12Invoice_clone(&invoice_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_var); invoice_ref = tag_ptr(invoice_var.inner, invoice_var.is_owned); uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 28, invoice_ref, 0, 0, 0, 0, 0); @@ -7764,34 +8237,6 @@ uint64_t __attribute__((export_name("TS_LDKCOption_SocketAddressZ_Some_get_some" uint64_t some_ref = tag_ptr(&obj->some, false); return some_ref; } -static inline struct LDKPublicKey C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR owner){ - return owner->a; -} -int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a"))) TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(uint64_t owner) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(owner); - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(owner_conv).compressed_form, 33); - return ret_arr; -} - -static inline struct LDKCOption_SocketAddressZ C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR owner){ - return COption_SocketAddressZ_clone(&owner->b); -} -uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b"))) TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(uint64_t owner) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* owner_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(owner); - LDKCOption_SocketAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_SocketAddressZ), "LDKCOption_SocketAddressZ"); - *ret_copy = C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_clone(const LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ *orig) { - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return CVec_u8Z_clone(&*owner->contents.result); @@ -8040,6 +8485,54 @@ uint32_t __attribute__((export_name("TS_CResult_C2Tuple_ThirtyTwoBytesChannelMo return ret_conv; } +static inline struct LDKUnsignedInvoiceRequest CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKUnsignedInvoiceRequest ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedInvoiceRequest ret_var = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequest CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequest ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequest ret_var = CResult_InvoiceRequestBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t __attribute__((export_name("TS_LDKCOption_SecretKeyZ_ty_from_ptr"))) TS_LDKCOption_SecretKeyZ_ty_from_ptr(uint64_t ptr) { LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); switch(obj->tag) { @@ -8055,6 +8548,30 @@ int8_tArray __attribute__((export_name("TS_LDKCOption_SecretKeyZ_Some_get_some") memcpy(some_arr->elems, obj->some.bytes, 32); return some_arr; } +static inline struct LDKInvoiceWithExplicitSigningPubkeyBuilder CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceWithExplicitSigningPubkeyBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok"))) TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithExplicitSigningPubkeyBuilder ret_var = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err"))) TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline struct LDKVerifiedInvoiceRequest CResult_VerifiedInvoiceRequestNoneZ_get_ok(LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR owner){ LDKVerifiedInvoiceRequest ret = *owner->contents.result; ret.is_owned = false; @@ -8078,6 +8595,56 @@ void __attribute__((export_name("TS_CResult_VerifiedInvoiceRequestNoneZ_get_err CResult_VerifiedInvoiceRequestNoneZ_get_err(owner_conv); } +static inline struct LDKInvoiceWithDerivedSigningPubkeyBuilder CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ + LDKInvoiceWithDerivedSigningPubkeyBuilder ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok"))) TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithDerivedSigningPubkeyBuilder ret_var = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_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 LDKBolt12SemanticError CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return Bolt12SemanticError_clone(&*owner->contents.err); +} +uint32_t __attribute__((export_name("TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err"))) TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKBolt12SemanticError_to_js(CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + +static inline struct LDKInvoiceRequestFields CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner){ + LDKInvoiceRequestFields ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequestFields ret_var = CResult_InvoiceRequestFieldsDecodeErrorZ_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_InvoiceRequestFieldsDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_get_err"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline LDKCVec_WitnessZ CVec_WitnessZ_clone(const LDKCVec_WitnessZ *orig) { LDKCVec_WitnessZ ret = { .data = MALLOC(sizeof(LDKWitness) * orig->datalen, "LDKCVec_WitnessZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { @@ -8085,6 +8652,21 @@ static inline LDKCVec_WitnessZ CVec_WitnessZ_clone(const LDKCVec_WitnessZ *orig) } return ret; } +uint32_t __attribute__((export_name("TS_LDKCOption_ECDSASignatureZ_ty_from_ptr"))) TS_LDKCOption_ECDSASignatureZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_ECDSASignatureZ *obj = (LDKCOption_ECDSASignatureZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_ECDSASignatureZ_Some: return 0; + case LDKCOption_ECDSASignatureZ_None: return 1; + default: abort(); + } +} +int8_tArray __attribute__((export_name("TS_LDKCOption_ECDSASignatureZ_Some_get_some"))) TS_LDKCOption_ECDSASignatureZ_Some_get_some(uint64_t ptr) { + LDKCOption_ECDSASignatureZ *obj = (LDKCOption_ECDSASignatureZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_ECDSASignatureZ_Some); + int8_tArray some_arr = init_int8_tArray(64, __LINE__); + memcpy(some_arr->elems, obj->some.compact_form, 64); + return some_arr; +} uint32_t __attribute__((export_name("TS_LDKCOption_i64Z_ty_from_ptr"))) TS_LDKCOption_i64Z_ty_from_ptr(uint64_t ptr) { LDKCOption_i64Z *obj = (LDKCOption_i64Z*)untag_ptr(ptr); switch(obj->tag) { @@ -9546,6 +10128,262 @@ uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceSignOrCreationErro return ret_ref; } +uint32_t __attribute__((export_name("TS_LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr"))) TS_LDKCOption_InboundHTLCStateDetailsZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_InboundHTLCStateDetailsZ *obj = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_InboundHTLCStateDetailsZ_Some: return 0; + case LDKCOption_InboundHTLCStateDetailsZ_None: return 1; + default: abort(); + } +} +uint32_t __attribute__((export_name("TS_LDKCOption_InboundHTLCStateDetailsZ_Some_get_some"))) TS_LDKCOption_InboundHTLCStateDetailsZ_Some_get_some(uint64_t ptr) { + LDKCOption_InboundHTLCStateDetailsZ *obj = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_InboundHTLCStateDetailsZ_Some); + uint32_t some_conv = LDKInboundHTLCStateDetails_to_js(obj->some); + return some_conv; +} +static inline struct LDKCOption_InboundHTLCStateDetailsZ CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_InboundHTLCStateDetailsZ_clone(&*owner->contents.result); +} +uint64_t __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_ok(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKInboundHTLCDetails CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKInboundHTLCDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_get_ok"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKInboundHTLCDetails ret_var = CResult_InboundHTLCDetailsDecodeErrorZ_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_InboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_get_err"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_InboundHTLCDetailsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t __attribute__((export_name("TS_LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr"))) TS_LDKCOption_OutboundHTLCStateDetailsZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_OutboundHTLCStateDetailsZ *obj = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_OutboundHTLCStateDetailsZ_Some: return 0; + case LDKCOption_OutboundHTLCStateDetailsZ_None: return 1; + default: abort(); + } +} +uint32_t __attribute__((export_name("TS_LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some"))) TS_LDKCOption_OutboundHTLCStateDetailsZ_Some_get_some(uint64_t ptr) { + LDKCOption_OutboundHTLCStateDetailsZ *obj = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_OutboundHTLCStateDetailsZ_Some); + uint32_t some_conv = LDKOutboundHTLCStateDetails_to_js(obj->some); + return some_conv; +} +static inline struct LDKCOption_OutboundHTLCStateDetailsZ CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return COption_OutboundHTLCStateDetailsZ_clone(&*owner->contents.result); +} +uint64_t __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_ok(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* owner_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKOutboundHTLCDetails CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKOutboundHTLCDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKOutboundHTLCDetails ret_var = CResult_OutboundHTLCDetailsDecodeErrorZ_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_OutboundHTLCDetailsDecodeErrorZ_get_err(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_get_err"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* owner_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutboundHTLCDetailsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ + LDKCounterpartyForwardingInfo ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); + LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelCounterparty ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); + LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint32_t __attribute__((export_name("TS_LDKCOption_ChannelShutdownStateZ_ty_from_ptr"))) TS_LDKCOption_ChannelShutdownStateZ_ty_from_ptr(uint64_t ptr) { + LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); + switch(obj->tag) { + case LDKCOption_ChannelShutdownStateZ_Some: return 0; + case LDKCOption_ChannelShutdownStateZ_None: return 1; + default: abort(); + } +} +uint32_t __attribute__((export_name("TS_LDKCOption_ChannelShutdownStateZ_Some_get_some"))) TS_LDKCOption_ChannelShutdownStateZ_Some_get_some(uint64_t ptr) { + LDKCOption_ChannelShutdownStateZ *obj = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(ptr); + assert(obj->tag == LDKCOption_ChannelShutdownStateZ_Some); + uint32_t some_conv = LDKChannelShutdownState_to_js(obj->some); + return some_conv; +} +static inline LDKCVec_InboundHTLCDetailsZ CVec_InboundHTLCDetailsZ_clone(const LDKCVec_InboundHTLCDetailsZ *orig) { + LDKCVec_InboundHTLCDetailsZ ret = { .data = MALLOC(sizeof(LDKInboundHTLCDetails) * orig->datalen, "LDKCVec_InboundHTLCDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = InboundHTLCDetails_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_OutboundHTLCDetailsZ CVec_OutboundHTLCDetailsZ_clone(const LDKCVec_OutboundHTLCDetailsZ *orig) { + LDKCVec_OutboundHTLCDetailsZ ret = { .data = MALLOC(sizeof(LDKOutboundHTLCDetails) * orig->datalen, "LDKCVec_OutboundHTLCDetailsZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = OutboundHTLCDetails_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelDetails ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); + LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline enum LDKChannelShutdownState CResult_ChannelShutdownStateDecodeErrorZ_get_ok(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return ChannelShutdownState_clone(&*owner->contents.result); +} +uint32_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_get_ok"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKChannelShutdownState_to_js(CResult_ChannelShutdownStateDecodeErrorZ_get_ok(owner_conv)); + return ret_conv; +} + +static inline struct LDKDecodeError CResult_ChannelShutdownStateDecodeErrorZ_get_err(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_get_err"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* owner_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelShutdownStateDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -9963,24 +10801,70 @@ uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownSc 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; + case LDKPaymentPurpose_Bolt11InvoicePayment: return 0; + case LDKPaymentPurpose_Bolt12OfferPayment: return 1; + case LDKPaymentPurpose_Bolt12RefundPayment: return 2; + case LDKPaymentPurpose_SpontaneousPayment: return 3; default: abort(); } } -uint64_t __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage(uint64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - assert(obj->tag == LDKPaymentPurpose_InvoicePayment); - uint64_t payment_preimage_ref = tag_ptr(&obj->invoice_payment.payment_preimage, false); + assert(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); + uint64_t payment_preimage_ref = tag_ptr(&obj->bolt11_invoice_payment.payment_preimage, false); return payment_preimage_ref; } -int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) { +int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret(uint64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - assert(obj->tag == LDKPaymentPurpose_InvoicePayment); + assert(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); - memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32); + memcpy(payment_secret_arr->elems, obj->bolt11_invoice_payment.payment_secret.data, 32); return payment_secret_arr; } +uint64_t __attribute__((export_name("TS_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage"))) TS_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + uint64_t payment_preimage_ref = tag_ptr(&obj->bolt12_offer_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret"))) TS_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->bolt12_offer_payment.payment_secret.data, 32); + return payment_secret_arr; +} +uint64_t __attribute__((export_name("TS_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context"))) TS_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + LDKBolt12OfferContext payment_context_var = obj->bolt12_offer_payment.payment_context; + uint64_t payment_context_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_var); + payment_context_ref = tag_ptr(payment_context_var.inner, false); + return payment_context_ref; +} +uint64_t __attribute__((export_name("TS_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage"))) TS_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + uint64_t payment_preimage_ref = tag_ptr(&obj->bolt12_refund_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret"))) TS_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->bolt12_refund_payment.payment_secret.data, 32); + return payment_secret_arr; +} +uint64_t __attribute__((export_name("TS_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context"))) TS_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context(uint64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + assert(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + LDKBolt12RefundContext payment_context_var = obj->bolt12_refund_payment.payment_context; + uint64_t payment_context_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_var); + payment_context_ref = tag_ptr(payment_context_var.inner, false); + return payment_context_ref; +} 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); @@ -10096,38 +10980,6 @@ uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeError return ret_ref; } -uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - switch(obj->tag) { - case LDKClosureReason_CounterpartyForceClosed: return 0; - case LDKClosureReason_HolderForceClosed: return 1; - case LDKClosureReason_CooperativeClosure: return 2; - case LDKClosureReason_CommitmentTxConfirmed: return 3; - case LDKClosureReason_FundingTimedOut: return 4; - case LDKClosureReason_ProcessingError: return 5; - case LDKClosureReason_DisconnectedPeer: return 6; - case LDKClosureReason_OutdatedChannelManager: return 7; - case LDKClosureReason_CounterpartyCoopClosedUnfundedChannel: return 8; - case LDKClosureReason_FundingBatchClosure: return 9; - default: abort(); - } -} -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); - 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); - assert(obj->tag == LDKClosureReason_ProcessingError); - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len); - return err_conv; -} uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint64_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr); switch(obj->tag) { @@ -10172,7 +11024,8 @@ uint32_t __attribute__((export_name("TS_LDKHTLCDestination_ty_from_ptr"))) TS_LD case LDKHTLCDestination_NextHopChannel: return 0; case LDKHTLCDestination_UnknownNextHop: return 1; case LDKHTLCDestination_InvalidForward: return 2; - case LDKHTLCDestination_FailedPayment: return 3; + case LDKHTLCDestination_InvalidOnion: return 3; + case LDKHTLCDestination_FailedPayment: return 4; default: abort(); } } @@ -10183,12 +11036,14 @@ int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33); return node_id_arr; } -int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); assert(obj->tag == LDKHTLCDestination_NextHopChannel); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->next_hop_channel.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int64_t __attribute__((export_name("TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid"))) TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(uint64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); @@ -10313,6 +11168,22 @@ uint32_t __attribute__((export_name("TS_LDKBumpTransactionEvent_ty_from_ptr"))) default: abort(); } } +uint64_t __attribute__((export_name("TS_LDKBumpTransactionEvent_ChannelClose_get_channel_id"))) TS_LDKBumpTransactionEvent_ChannelClose_get_channel_id(uint64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + assert(obj->tag == LDKBumpTransactionEvent_ChannelClose); + LDKChannelId channel_id_var = obj->channel_close.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} +int8_tArray __attribute__((export_name("TS_LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id"))) TS_LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id(uint64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + assert(obj->tag == LDKBumpTransactionEvent_ChannelClose); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->channel_close.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} int8_tArray __attribute__((export_name("TS_LDKBumpTransactionEvent_ChannelClose_get_claim_id"))) TS_LDKBumpTransactionEvent_ChannelClose_get_claim_id(uint64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); assert(obj->tag == LDKBumpTransactionEvent_ChannelClose); @@ -10366,6 +11237,22 @@ uint64_tArray __attribute__((export_name("TS_LDKBumpTransactionEvent_ChannelClos return pending_htlcs_arr; } +uint64_t __attribute__((export_name("TS_LDKBumpTransactionEvent_HTLCResolution_get_channel_id"))) TS_LDKBumpTransactionEvent_HTLCResolution_get_channel_id(uint64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + assert(obj->tag == LDKBumpTransactionEvent_HTLCResolution); + LDKChannelId channel_id_var = obj->htlc_resolution.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; +} +int8_tArray __attribute__((export_name("TS_LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id"))) TS_LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id(uint64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + assert(obj->tag == LDKBumpTransactionEvent_HTLCResolution); + int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(counterparty_node_id_arr->elems, obj->htlc_resolution.counterparty_node_id.compressed_form, 33); + return counterparty_node_id_arr; +} int8_tArray __attribute__((export_name("TS_LDKBumpTransactionEvent_HTLCResolution_get_claim_id"))) TS_LDKBumpTransactionEvent_HTLCResolution_get_claim_id(uint64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); assert(obj->tag == LDKBumpTransactionEvent_HTLCResolution); @@ -10430,12 +11317,14 @@ uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_ default: abort(); } } -int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_FundingGenerationReady); - int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32); - return temporary_channel_id_arr; + LDKChannelId temporary_channel_id_var = obj->funding_generation_ready.temporary_channel_id; + uint64_t temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_var); + temporary_channel_id_ref = tag_ptr(temporary_channel_id_var.inner, false); + return temporary_channel_id_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id"))) TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10509,7 +11398,10 @@ uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_purpose")) uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_via_channel_id"))) TS_LDKEvent_PaymentClaimable_get_via_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentClaimable); - uint64_t via_channel_id_ref = tag_ptr(&obj->payment_claimable.via_channel_id, false); + LDKChannelId via_channel_id_var = obj->payment_claimable.via_channel_id; + uint64_t via_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_var); + via_channel_id_ref = tag_ptr(via_channel_id_var.inner, false); return via_channel_id_ref; } uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimable_get_via_user_channel_id"))) TS_LDKEvent_PaymentClaimable_get_via_user_channel_id(uint64_t ptr) { @@ -10816,26 +11708,53 @@ uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outpu uint64_t __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_channel_id"))) TS_LDKEvent_SpendableOutputs_get_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_SpendableOutputs); - uint64_t channel_id_ref = tag_ptr(&obj->spendable_outputs.channel_id, false); + LDKChannelId channel_id_var = obj->spendable_outputs.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); return channel_id_ref; } uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentForwarded); - uint64_t prev_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_channel_id, false); + LDKChannelId prev_channel_id_var = obj->payment_forwarded.prev_channel_id; + uint64_t prev_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_var); + prev_channel_id_ref = tag_ptr(prev_channel_id_var.inner, false); return prev_channel_id_ref; } uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentForwarded); - uint64_t next_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_channel_id, false); + LDKChannelId next_channel_id_var = obj->payment_forwarded.next_channel_id; + uint64_t next_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_var); + next_channel_id_ref = tag_ptr(next_channel_id_var.inner, false); return next_channel_id_ref; } -uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_user_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_user_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_PaymentForwarded); - uint64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false); - return fee_earned_msat_ref; + uint64_t prev_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_user_channel_id, false); + return prev_user_channel_id_ref; +} +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_user_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_user_channel_id(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentForwarded); + uint64_t next_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_user_channel_id, false); + return next_user_channel_id_ref; +} +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_total_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_total_fee_earned_msat(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentForwarded); + uint64_t total_fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.total_fee_earned_msat, false); + return total_fee_earned_msat_ref; +} +uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_skimmed_fee_msat"))) TS_LDKEvent_PaymentForwarded_get_skimmed_fee_msat(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_PaymentForwarded); + uint64_t skimmed_fee_msat_ref = tag_ptr(&obj->payment_forwarded.skimmed_fee_msat, false); + return skimmed_fee_msat_ref; } jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10849,12 +11768,14 @@ uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_outbound_a 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) { +uint64_t __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; + LDKChannelId channel_id_var = obj->channel_pending.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } 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); @@ -10866,7 +11787,10 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelPending_get_user_chan uint64_t __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); - uint64_t former_temporary_channel_id_ref = tag_ptr(&obj->channel_pending.former_temporary_channel_id, false); + LDKChannelId former_temporary_channel_id_var = obj->channel_pending.former_temporary_channel_id; + uint64_t former_temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_var); + former_temporary_channel_id_ref = tag_ptr(former_temporary_channel_id_var.inner, false); return former_temporary_channel_id_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelPending_get_counterparty_node_id"))) TS_LDKEvent_ChannelPending_get_counterparty_node_id(uint64_t ptr) { @@ -10885,12 +11809,23 @@ uint64_t __attribute__((export_name("TS_LDKEvent_ChannelPending_get_funding_txo" 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) { +uint64_t __attribute__((export_name("TS_LDKEvent_ChannelPending_get_channel_type"))) TS_LDKEvent_ChannelPending_get_channel_type(uint64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + assert(obj->tag == LDKEvent_ChannelPending); + LDKChannelTypeFeatures channel_type_var = obj->channel_pending.channel_type; + uint64_t channel_type_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var); + channel_type_ref = tag_ptr(channel_type_var.inner, false); + return channel_type_ref; +} +uint64_t __attribute__((export_name("TS_LDKEvent_ChannelReady_get_channel_id"))) TS_LDKEvent_ChannelReady_get_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_ChannelReady); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->channel_ready.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->channel_ready.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelReady_get_user_channel_id"))) TS_LDKEvent_ChannelReady_get_user_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10915,12 +11850,14 @@ uint64_t __attribute__((export_name("TS_LDKEvent_ChannelReady_get_channel_type") channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_ChannelClosed); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->channel_closed.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10957,12 +11894,14 @@ uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_fundi channel_funding_txo_ref = tag_ptr(channel_funding_txo_var.inner, false); return channel_funding_txo_ref; } -int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_DiscardFunding); - int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32); - return channel_id_arr; + LDKChannelId channel_id_var = obj->discard_funding.channel_id; + uint64_t channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); + channel_id_ref = tag_ptr(channel_id_var.inner, false); + return channel_id_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transaction"))) TS_LDKEvent_DiscardFunding_get_transaction(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -10972,12 +11911,14 @@ int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transacti memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); return transaction_arr; } -int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_OpenChannelRequest); - int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32); - return temporary_channel_id_arr; + LDKChannelId temporary_channel_id_var = obj->open_channel_request.temporary_channel_id; + uint64_t temporary_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_var); + temporary_channel_id_ref = tag_ptr(temporary_channel_id_var.inner, false); + return temporary_channel_id_ref; } int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id"))) TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11007,12 +11948,14 @@ uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_channel_ channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); assert(obj->tag == LDKEvent_HTLCHandlingFailed); - int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__); - memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32); - return prev_channel_id_arr; + LDKChannelId prev_channel_id_var = obj->htlc_handling_failed.prev_channel_id; + uint64_t prev_channel_id_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_var); + prev_channel_id_ref = tag_ptr(prev_channel_id_var.inner, false); + return prev_channel_id_ref; } uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination"))) TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(uint64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11550,6 +12493,32 @@ uint64_t __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_get return ret_ref; } +static inline struct LDKChannelId CResult_ChannelIdDecodeErrorZ_get_ok(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner){ + LDKChannelId ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_get_ok"))) TS_CResult_ChannelIdDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_ChannelIdDecodeErrorZ* owner_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdDecodeErrorZ_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_ChannelIdDecodeErrorZ_get_err(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_get_err"))) TS_CResult_ChannelIdDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_ChannelIdDecodeErrorZ* owner_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_ChannelIdDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline struct LDKThirtyTwoBytes C2Tuple__u832u16Z_get_a(LDKC2Tuple__u832u16Z *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -11621,6 +12590,129 @@ uint64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_ return ret_ref; } +static inline struct LDKPaymentContext CResult_PaymentContextDecodeErrorZ_get_ok(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return PaymentContext_clone(&*owner->contents.result); +} +uint64_t __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_get_ok"))) TS_CResult_PaymentContextDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_PaymentContextDecodeErrorZ* owner_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = CResult_PaymentContextDecodeErrorZ_get_ok(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDecodeError CResult_PaymentContextDecodeErrorZ_get_err(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_get_err"))) TS_CResult_PaymentContextDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_PaymentContextDecodeErrorZ* owner_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_PaymentContextDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKUnknownPaymentContext CResult_UnknownPaymentContextDecodeErrorZ_get_ok(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ + LDKUnknownPaymentContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_get_ok"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKUnknownPaymentContext ret_var = CResult_UnknownPaymentContextDecodeErrorZ_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_UnknownPaymentContextDecodeErrorZ_get_err(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_get_err"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_UnknownPaymentContextDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBolt12OfferContext CResult_Bolt12OfferContextDecodeErrorZ_get_ok(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12OfferContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_get_ok"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12OfferContext ret_var = CResult_Bolt12OfferContextDecodeErrorZ_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_Bolt12OfferContextDecodeErrorZ_get_err(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_get_err"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt12OfferContextDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBolt12RefundContext CResult_Bolt12RefundContextDecodeErrorZ_get_ok(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner){ + LDKBolt12RefundContext ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_get_ok"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12RefundContext ret_var = CResult_Bolt12RefundContextDecodeErrorZ_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_Bolt12RefundContextDecodeErrorZ_get_err(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_get_err"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_Bolt12RefundContextDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return *owner->contents.result; +} +jstring __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_get_ok"))) TS_CResult_StrSecp256k1ErrorZ_get_ok(uint64_t owner) { + LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); + LDKStr ret_str = CResult_StrSecp256k1ErrorZ_get_ok(owner_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + return ret_conv; +} + +static inline enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +uint32_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_get_err"))) TS_CResult_StrSecp256k1ErrorZ_get_err(uint64_t owner) { + LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); + uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StrSecp256k1ErrorZ_get_err(owner_conv)); + return ret_conv; +} + static inline struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner){ return ThirtyTwoBytes_clone(&owner->a); } @@ -11679,27 +12771,6 @@ void __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnio CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(owner_conv); } -static inline struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(owner->result_ok); - return *owner->contents.result; -} -jstring __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_get_ok"))) TS_CResult_StrSecp256k1ErrorZ_get_ok(uint64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - LDKStr ret_str = CResult_StrSecp256k1ErrorZ_get_ok(owner_conv); - jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); - return ret_conv; -} - -static inline enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -uint32_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_get_err"))) TS_CResult_StrSecp256k1ErrorZ_get_err(uint64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StrSecp256k1ErrorZ_get_err(owner_conv)); - return ret_conv; -} - static inline struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner){ return owner->a; } @@ -11746,7 +12817,8 @@ uint32_t __attribute__((export_name("TS_LDKSendError_ty_from_ptr"))) TS_LDKSendE case LDKSendError_InvalidMessage: return 5; case LDKSendError_BufferFull: return 6; case LDKSendError_GetNodeIdFailed: return 7; - case LDKSendError_BlindedPathAdvanceFailed: return 8; + case LDKSendError_UnresolvedIntroductionNode: return 8; + case LDKSendError_BlindedPathAdvanceFailed: return 9; default: abort(); } } @@ -11786,6 +12858,27 @@ uint64_t __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCO return ret_ref; } +uint32_t __attribute__((export_name("TS_LDKNextMessageHop_ty_from_ptr"))) TS_LDKNextMessageHop_ty_from_ptr(uint64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + switch(obj->tag) { + case LDKNextMessageHop_NodeId: return 0; + case LDKNextMessageHop_ShortChannelId: return 1; + default: abort(); + } +} +int8_tArray __attribute__((export_name("TS_LDKNextMessageHop_NodeId_get_node_id"))) TS_LDKNextMessageHop_NodeId_get_node_id(uint64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + assert(obj->tag == LDKNextMessageHop_NodeId); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->node_id.compressed_form, 33); + return node_id_arr; +} +int64_t __attribute__((export_name("TS_LDKNextMessageHop_ShortChannelId_get_short_channel_id"))) TS_LDKNextMessageHop_ShortChannelId_get_short_channel_id(uint64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + assert(obj->tag == LDKNextMessageHop_ShortChannelId); + int64_t short_channel_id_conv = obj->short_channel_id; + return short_channel_id_conv; +} uint32_t __attribute__((export_name("TS_LDKParsedOnionMessageContents_ty_from_ptr"))) TS_LDKParsedOnionMessageContents_ty_from_ptr(uint64_t ptr) { LDKParsedOnionMessageContents *obj = (LDKParsedOnionMessageContents*)untag_ptr(ptr); switch(obj->tag) { @@ -11815,12 +12908,11 @@ uint32_t __attribute__((export_name("TS_LDKPeeledOnion_ty_from_ptr"))) TS_LDKPee default: abort(); } } -int8_tArray __attribute__((export_name("TS_LDKPeeledOnion_Forward_get__0"))) TS_LDKPeeledOnion_Forward_get__0(uint64_t ptr) { +uint64_t __attribute__((export_name("TS_LDKPeeledOnion_Forward_get__0"))) TS_LDKPeeledOnion_Forward_get__0(uint64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); assert(obj->tag == LDKPeeledOnion_Forward); - int8_tArray _0_arr = init_int8_tArray(33, __LINE__); - memcpy(_0_arr->elems, obj->forward._0.compressed_form, 33); - return _0_arr; + uint64_t _0_ref = tag_ptr(&obj->forward._0, false); + return _0_ref; } uint64_t __attribute__((export_name("TS_LDKPeeledOnion_Forward_get__1"))) TS_LDKPeeledOnion_Forward_get__1(uint64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); @@ -12041,158 +13133,122 @@ uint64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_get_er return ret_ref; } -static inline struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ - LDKDelayedPaymentBasepoint ret = *owner->contents.result; +static inline struct LDKTrackedSpendableOutput CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ + LDKTrackedSpendableOutput ret = *owner->contents.result; ret.is_owned = false; return ret; } -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); - LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(owner_conv); +uint64_t __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_get_ok"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); + LDKTrackedSpendableOutput ret_var = CResult_TrackedSpendableOutputDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ_get_err(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_TrackedSpendableOutputDecodeErrorZ_get_err(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); +uint64_t __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_get_err"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_TrackedSpendableOutputDecodeErrorZ_get_err(owner_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKDelayedPaymentKey CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner){ - LDKDelayedPaymentKey ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); - LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ_get_err(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_DelayedPaymentKeyDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKHtlcBasepoint CResult_HtlcBasepointDecodeErrorZ_get_ok(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner){ - LDKHtlcBasepoint ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_get_ok"))) TS_CResult_HtlcBasepointDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); - LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_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_HtlcBasepointDecodeErrorZ_get_err(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_get_err"))) TS_CResult_HtlcBasepointDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_HtlcBasepointDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -static inline struct LDKHtlcKey CResult_HtlcKeyDecodeErrorZ_get_ok(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner){ - LDKHtlcKey ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_get_ok"))) TS_CResult_HtlcKeyDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); - LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ_get_err(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); -} -uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_get_err"))) TS_CResult_HtlcKeyDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_HtlcKeyDecodeErrorZ_get_err(owner_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint32_t __attribute__((export_name("TS_LDKOutputSpendStatus_ty_from_ptr"))) TS_LDKOutputSpendStatus_ty_from_ptr(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + switch(obj->tag) { + case LDKOutputSpendStatus_PendingInitialBroadcast: return 0; + case LDKOutputSpendStatus_PendingFirstConfirmation: return 1; + case LDKOutputSpendStatus_PendingThresholdConfirmations: return 2; + default: abort(); + } } - -static inline struct LDKRevocationBasepoint CResult_RevocationBasepointDecodeErrorZ_get_ok(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner){ - LDKRevocationBasepoint ret = *owner->contents.result; - ret.is_owned = false; - return ret; +uint64_t __attribute__((export_name("TS_LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height"))) TS_LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingInitialBroadcast); + uint64_t delayed_until_height_ref = tag_ptr(&obj->pending_initial_broadcast.delayed_until_height, false); + return delayed_until_height_ref; +} +int8_tArray __attribute__((export_name("TS_LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash"))) TS_LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + int8_tArray first_broadcast_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(first_broadcast_hash_arr->elems, obj->pending_first_confirmation.first_broadcast_hash.data, 32); + return first_broadcast_hash_arr; +} +int32_t __attribute__((export_name("TS_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height"))) TS_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + int32_t latest_broadcast_height_conv = obj->pending_first_confirmation.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray __attribute__((export_name("TS_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx"))) TS_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + LDKTransaction latest_spending_tx_var = obj->pending_first_confirmation.latest_spending_tx; + int8_tArray latest_spending_tx_arr = init_int8_tArray(latest_spending_tx_var.datalen, __LINE__); + memcpy(latest_spending_tx_arr->elems, latest_spending_tx_var.data, latest_spending_tx_var.datalen); + return latest_spending_tx_arr; +} +int8_tArray __attribute__((export_name("TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash"))) TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int8_tArray first_broadcast_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(first_broadcast_hash_arr->elems, obj->pending_threshold_confirmations.first_broadcast_hash.data, 32); + return first_broadcast_hash_arr; +} +int32_t __attribute__((export_name("TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height"))) TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t latest_broadcast_height_conv = obj->pending_threshold_confirmations.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray __attribute__((export_name("TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx"))) TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + LDKTransaction latest_spending_tx_var = obj->pending_threshold_confirmations.latest_spending_tx; + int8_tArray latest_spending_tx_arr = init_int8_tArray(latest_spending_tx_var.datalen, __LINE__); + memcpy(latest_spending_tx_arr->elems, latest_spending_tx_var.data, latest_spending_tx_var.datalen); + return latest_spending_tx_arr; +} +int32_t __attribute__((export_name("TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height"))) TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t confirmation_height_conv = obj->pending_threshold_confirmations.confirmation_height; + return confirmation_height_conv; } -uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_get_ok"))) TS_CResult_RevocationBasepointDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); - LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_get_ok(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int8_tArray __attribute__((export_name("TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash"))) TS_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash(uint64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + assert(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int8_tArray confirmation_hash_arr = init_int8_tArray(32, __LINE__); + memcpy(confirmation_hash_arr->elems, obj->pending_threshold_confirmations.confirmation_hash.data, 32); + return confirmation_hash_arr; } - -static inline struct LDKDecodeError CResult_RevocationBasepointDecodeErrorZ_get_err(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return DecodeError_clone(&*owner->contents.err); +static inline struct LDKOutputSpendStatus CResult_OutputSpendStatusDecodeErrorZ_get_ok(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return OutputSpendStatus_clone(&*owner->contents.result); } -uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_get_err"))) TS_CResult_RevocationBasepointDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RevocationBasepointDecodeErrorZ_get_err(owner_conv); +uint64_t __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_get_ok"))) TS_CResult_OutputSpendStatusDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_OutputSpendStatusDecodeErrorZ* owner_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(owner); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = CResult_OutputSpendStatusDecodeErrorZ_get_ok(owner_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline struct LDKRevocationKey CResult_RevocationKeyDecodeErrorZ_get_ok(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner){ - LDKRevocationKey ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_get_ok"))) TS_CResult_RevocationKeyDecodeErrorZ_get_ok(uint64_t owner) { - LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); - LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ_get_err(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner){ +static inline struct LDKDecodeError CResult_OutputSpendStatusDecodeErrorZ_get_err(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_get_err"))) TS_CResult_RevocationKeyDecodeErrorZ_get_err(uint64_t owner) { - LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); +uint64_t __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_get_err"))) TS_CResult_OutputSpendStatusDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_OutputSpendStatusDecodeErrorZ* owner_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_RevocationKeyDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_OutputSpendStatusDecodeErrorZ_get_err(owner_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -12293,85 +13349,62 @@ uint64_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_ } return tag_ptr(some_ret, true); } -static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ - LDKLockedChannelMonitor ret = *owner->contents.result; - ret.is_owned = false; - return ret; -} -uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) { - LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); - LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_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_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ -CHECK(!owner->result_ok); - return *owner->contents.err; -} -void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) { - LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); - CResult_LockedChannelMonitorNoneZ_get_err(owner_conv); -} - -static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) { - LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen }; +static inline LDKCVec_TrackedSpendableOutputZ CVec_TrackedSpendableOutputZ_clone(const LDKCVec_TrackedSpendableOutputZ *orig) { + LDKCVec_TrackedSpendableOutputZ ret = { .data = MALLOC(sizeof(LDKTrackedSpendableOutput) * orig->datalen, "LDKCVec_TrackedSpendableOutputZ clone bytes"), .datalen = orig->datalen }; for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = OutPoint_clone(&orig->data[i]); + ret.data[i] = TrackedSpendableOutput_clone(&orig->data[i]); } return ret; } -static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { - LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); +typedef struct LDKChangeDestinationSource_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKChangeDestinationSource_JCalls; +static void LDKChangeDestinationSource_JCalls_free(void* this_arg) { + LDKChangeDestinationSource_JCalls *j_calls = (LDKChangeDestinationSource_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); } - return ret; } -static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ - LDKOutPoint ret = owner->a; - ret.is_owned = false; - return ret; +LDKCResult_CVec_u8ZNoneZ get_change_destination_script_LDKChangeDestinationSource_jcall(const void* this_arg) { + LDKChangeDestinationSource_JCalls *j_calls = (LDKChangeDestinationSource_JCalls*) this_arg; + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, 0, 0, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; } -uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(uint64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +static void LDKChangeDestinationSource_JCalls_cloned(LDKChangeDestinationSource* new_obj) { + LDKChangeDestinationSource_JCalls *j_calls = (LDKChangeDestinationSource_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); } +static inline LDKChangeDestinationSource LDKChangeDestinationSource_init (JSValue o) { + LDKChangeDestinationSource_JCalls *calls = MALLOC(sizeof(LDKChangeDestinationSource_JCalls), "LDKChangeDestinationSource_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; -static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ - return CVec_MonitorUpdateIdZ_clone(&owner->b); + LDKChangeDestinationSource ret = { + .this_arg = (void*) calls, + .get_change_destination_script = get_change_destination_script_LDKChangeDestinationSource_jcall, + .free = LDKChangeDestinationSource_JCalls_free, + }; + return ret; } -uint64_tArray __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(uint64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); - uint64_tArray ret_arr = NULL; - ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); - uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; - uint64_t ret_conv_17_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); - ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); - ret_arr_ptr[r] = ret_conv_17_ref; - } - - FREE(ret_var.data); - return ret_arr; +uint64_t __attribute__((export_name("TS_LDKChangeDestinationSource_new"))) TS_LDKChangeDestinationSource_new(JSValue o) { + LDKChangeDestinationSource *res_ptr = MALLOC(sizeof(LDKChangeDestinationSource), "LDKChangeDestinationSource"); + *res_ptr = LDKChangeDestinationSource_init(o); + return tag_ptr(res_ptr, true); } - -static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); - } - return ret; +uint64_t __attribute__((export_name("TS_ChangeDestinationSource_get_change_destination_script"))) TS_ChangeDestinationSource_get_change_destination_script(uint64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKChangeDestinationSource* this_arg_conv = (LDKChangeDestinationSource*)this_arg_ptr; + LDKCResult_CVec_u8ZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZNoneZ), "LDKCResult_CVec_u8ZNoneZ"); + *ret_conv = (this_arg_conv->get_change_destination_script)(this_arg_conv->this_arg); + return tag_ptr(ret_conv, true); } + typedef struct LDKKVStore_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -12393,7 +13426,7 @@ LDKCResult_CVec_u8ZIOErrorZ read_LDKKVStore_jcall(const void* this_arg, LDKStr p LDKStr key_str = key; jstring key_conv = str_ref_to_ts(key_str.chars, key_str.len); Str_free(key_str); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, primary_namespace_conv, secondary_namespace_conv, key_conv, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, primary_namespace_conv, secondary_namespace_conv, key_conv, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZIOErrorZ ret_conv = *(LDKCResult_CVec_u8ZIOErrorZ*)(ret_ptr); @@ -12414,7 +13447,7 @@ LDKCResult_NoneIOErrorZ write_LDKKVStore_jcall(const void* this_arg, LDKStr prim LDKu8slice buf_var = buf; int8_tArray buf_arr = init_int8_tArray(buf_var.datalen, __LINE__); memcpy(buf_arr->elems, buf_var.data, buf_var.datalen); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, primary_namespace_conv, secondary_namespace_conv, key_conv, (uint32_t)buf_arr, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, primary_namespace_conv, secondary_namespace_conv, key_conv, (uint32_t)buf_arr, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12433,7 +13466,7 @@ LDKCResult_NoneIOErrorZ remove_LDKKVStore_jcall(const void* this_arg, LDKStr pri jstring key_conv = str_ref_to_ts(key_str.chars, key_str.len); Str_free(key_str); jboolean lazy_conv = lazy; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, primary_namespace_conv, secondary_namespace_conv, key_conv, lazy_conv, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, primary_namespace_conv, secondary_namespace_conv, key_conv, lazy_conv, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12448,7 +13481,7 @@ LDKCResult_CVec_StrZIOErrorZ list_LDKKVStore_jcall(const void* this_arg, LDKStr LDKStr secondary_namespace_str = secondary_namespace; jstring secondary_namespace_conv = str_ref_to_ts(secondary_namespace_str.chars, secondary_namespace_str.len); Str_free(secondary_namespace_str); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, primary_namespace_conv, secondary_namespace_conv, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 53, primary_namespace_conv, secondary_namespace_conv, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_StrZIOErrorZ ret_conv = *(LDKCResult_CVec_StrZIOErrorZ*)(ret_ptr); @@ -12530,6 +13563,465 @@ uint64_t __attribute__((export_name("TS_KVStore_list"))) TS_KVStore_list(uint64 return tag_ptr(ret_conv, true); } +typedef struct LDKOutputSpender_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKOutputSpender_JCalls; +static void LDKOutputSpender_JCalls_free(void* this_arg) { + LDKOutputSpender_JCalls *j_calls = (LDKOutputSpender_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_TransactionNoneZ spend_spendable_outputs_LDKOutputSpender_jcall(const void* this_arg, LDKCVec_SpendableOutputDescriptorZ descriptors, LDKCVec_TxOutZ outputs, LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, LDKCOption_u32Z locktime) { + LDKOutputSpender_JCalls *j_calls = (LDKOutputSpender_JCalls*) this_arg; + LDKCVec_SpendableOutputDescriptorZ descriptors_var = descriptors; + uint64_tArray descriptors_arr = NULL; + descriptors_arr = init_uint64_tArray(descriptors_var.datalen, __LINE__); + uint64_t *descriptors_arr_ptr = (uint64_t*)(((uint8_t*)descriptors_arr) + 8); + for (size_t b = 0; b < descriptors_var.datalen; b++) { + LDKSpendableOutputDescriptor *descriptors_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *descriptors_conv_27_copy = descriptors_var.data[b]; + uint64_t descriptors_conv_27_ref = tag_ptr(descriptors_conv_27_copy, true); + descriptors_arr_ptr[b] = descriptors_conv_27_ref; + } + + FREE(descriptors_var.data); + LDKCVec_TxOutZ outputs_var = outputs; + uint64_tArray outputs_arr = NULL; + outputs_arr = init_uint64_tArray(outputs_var.datalen, __LINE__); + uint64_t *outputs_arr_ptr = (uint64_t*)(((uint8_t*)outputs_arr) + 8); + for (size_t h = 0; h < outputs_var.datalen; h++) { + LDKTxOut* outputs_conv_7_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut"); + *outputs_conv_7_ref = outputs_var.data[h]; + outputs_arr_ptr[h] = tag_ptr(outputs_conv_7_ref, true); + } + + FREE(outputs_var.data); + LDKCVec_u8Z change_destination_script_var = change_destination_script; + int8_tArray change_destination_script_arr = init_int8_tArray(change_destination_script_var.datalen, __LINE__); + memcpy(change_destination_script_arr->elems, change_destination_script_var.data, change_destination_script_var.datalen); + CVec_u8Z_free(change_destination_script_var); + int32_t feerate_sat_per_1000_weight_conv = feerate_sat_per_1000_weight; + LDKCOption_u32Z *locktime_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *locktime_copy = locktime; + uint64_t locktime_ref = tag_ptr(locktime_copy, true); + uint64_t ret = js_invoke_function_uuuubu(j_calls->instance_ptr, 54, (uint32_t)descriptors_arr, (uint32_t)outputs_arr, (uint32_t)change_destination_script_arr, feerate_sat_per_1000_weight_conv, locktime_ref, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKOutputSpender_JCalls_cloned(LDKOutputSpender* new_obj) { + LDKOutputSpender_JCalls *j_calls = (LDKOutputSpender_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKOutputSpender LDKOutputSpender_init (JSValue o) { + LDKOutputSpender_JCalls *calls = MALLOC(sizeof(LDKOutputSpender_JCalls), "LDKOutputSpender_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKOutputSpender ret = { + .this_arg = (void*) calls, + .spend_spendable_outputs = spend_spendable_outputs_LDKOutputSpender_jcall, + .free = LDKOutputSpender_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKOutputSpender_new"))) TS_LDKOutputSpender_new(JSValue o) { + LDKOutputSpender *res_ptr = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *res_ptr = LDKOutputSpender_init(o); + return tag_ptr(res_ptr, true); +} +uint64_t __attribute__((export_name("TS_OutputSpender_spend_spendable_outputs"))) TS_OutputSpender_spend_spendable_outputs(uint64_t this_arg, uint64_tArray descriptors, uint64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, uint64_t locktime) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKOutputSpender* this_arg_conv = (LDKOutputSpender*)this_arg_ptr; + LDKCVec_SpendableOutputDescriptorZ descriptors_constr; + descriptors_constr.datalen = descriptors->arr_len; + if (descriptors_constr.datalen > 0) + descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); + else + descriptors_constr.data = NULL; + uint64_t* descriptors_vals = descriptors->elems; + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + uint64_t descriptors_conv_27 = descriptors_vals[b]; + void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); + CHECK_ACCESS(descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); + descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); + descriptors_constr.data[b] = descriptors_conv_27_conv; + } + FREE(descriptors); + LDKCVec_TxOutZ outputs_constr; + outputs_constr.datalen = outputs->arr_len; + if (outputs_constr.datalen > 0) + outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); + else + outputs_constr.data = NULL; + uint64_t* outputs_vals = outputs->elems; + for (size_t h = 0; h < outputs_constr.datalen; h++) { + uint64_t outputs_conv_7 = outputs_vals[h]; + void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); + CHECK_ACCESS(outputs_conv_7_ptr); + LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); + outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); + outputs_constr.data[h] = outputs_conv_7_conv; + } + FREE(outputs); + LDKCVec_u8Z change_destination_script_ref; + change_destination_script_ref.datalen = change_destination_script->arr_len; + change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); + void* locktime_ptr = untag_ptr(locktime); + CHECK_ACCESS(locktime_ptr); + LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); + locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = (this_arg_conv->spend_spendable_outputs)(this_arg_conv->this_arg, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); + return tag_ptr(ret_conv, true); +} + +static inline struct LDKOutputSweeper CResult_OutputSweeperDecodeErrorZ_get_ok(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner){ + LDKOutputSweeper ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_OutputSweeperDecodeErrorZ_get_ok"))) TS_CResult_OutputSweeperDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_OutputSweeperDecodeErrorZ* owner_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = CResult_OutputSweeperDecodeErrorZ_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_OutputSweeperDecodeErrorZ_get_err(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_OutputSweeperDecodeErrorZ_get_err"))) TS_CResult_OutputSweeperDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_OutputSweeperDecodeErrorZ* owner_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_OutputSweeperDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKBestBlock C2Tuple_BestBlockOutputSweeperZ_get_a(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner){ + LDKBestBlock ret = owner->a; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_BestBlockOutputSweeperZ_get_a"))) TS_C2Tuple_BestBlockOutputSweeperZ_get_a(uint64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKBestBlock ret_var = C2Tuple_BestBlockOutputSweeperZ_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 LDKOutputSweeper C2Tuple_BestBlockOutputSweeperZ_get_b(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner){ + LDKOutputSweeper ret = owner->b; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_BestBlockOutputSweeperZ_get_b"))) TS_C2Tuple_BestBlockOutputSweeperZ_get_b(uint64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = C2Tuple_BestBlockOutputSweeperZ_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 LDKC2Tuple_BestBlockOutputSweeperZ *CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return &*owner->contents.result; +} +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(owner); + uint64_t ret_ret = tag_ptr(CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(owner_conv), false); + return ret_ret; +} + +static inline struct LDKDecodeError CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKDelayedPaymentBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ_get_err(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKDelayedPaymentKey CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner){ + LDKDelayedPaymentKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ_get_err(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_DelayedPaymentKeyDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKHtlcBasepoint CResult_HtlcBasepointDecodeErrorZ_get_ok(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKHtlcBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_get_ok"))) TS_CResult_HtlcBasepointDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); + LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_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_HtlcBasepointDecodeErrorZ_get_err(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_get_err"))) TS_CResult_HtlcBasepointDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HtlcBasepointDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKHtlcKey CResult_HtlcKeyDecodeErrorZ_get_ok(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner){ + LDKHtlcKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_get_ok"))) TS_CResult_HtlcKeyDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); + LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ_get_err(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_get_err"))) TS_CResult_HtlcKeyDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_HtlcKeyDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRevocationBasepoint CResult_RevocationBasepointDecodeErrorZ_get_ok(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKRevocationBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_get_ok"))) TS_CResult_RevocationBasepointDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); + LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_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_RevocationBasepointDecodeErrorZ_get_err(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_get_err"))) TS_CResult_RevocationBasepointDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RevocationBasepointDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKRevocationKey CResult_RevocationKeyDecodeErrorZ_get_ok(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner){ + LDKRevocationKey ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_get_ok"))) TS_CResult_RevocationKeyDecodeErrorZ_get_ok(uint64_t owner) { + LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); + LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ_get_err(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); +} +uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_get_err"))) TS_CResult_RevocationKeyDecodeErrorZ_get_err(uint64_t owner) { + LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = CResult_RevocationKeyDecodeErrorZ_get_err(owner_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ + LDKLockedChannelMonitor ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) { + LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); + LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_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_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return *owner->contents.err; +} +void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) { + LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); + CResult_LockedChannelMonitorNoneZ_get_err(owner_conv); +} + +static inline struct LDKOutPoint C2Tuple_OutPointChannelIdZ_get_a(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointChannelIdZ_get_a"))) TS_C2Tuple_OutPointChannelIdZ_get_a(uint64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointChannelIdZ_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 LDKChannelId C2Tuple_OutPointChannelIdZ_get_b(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner){ + LDKChannelId ret = owner->b; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointChannelIdZ_get_b"))) TS_C2Tuple_OutPointChannelIdZ_get_b(uint64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_OutPointChannelIdZ_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_OutPointChannelIdZZ CVec_C2Tuple_OutPointChannelIdZZ_clone(const LDKCVec_C2Tuple_OutPointChannelIdZZ *orig) { + LDKCVec_C2Tuple_OutPointChannelIdZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointChannelIdZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointChannelIdZ_clone(&orig->data[i]); + } + return ret; +} +static inline LDKCVec_MonitorUpdateIdZ CVec_MonitorUpdateIdZ_clone(const LDKCVec_MonitorUpdateIdZ *orig) { + LDKCVec_MonitorUpdateIdZ ret = { .data = MALLOC(sizeof(LDKMonitorUpdateId) * orig->datalen, "LDKCVec_MonitorUpdateIdZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = MonitorUpdateId_clone(&orig->data[i]); + } + return ret; +} +static inline struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + LDKOutPoint ret = owner->a; + ret.is_owned = false; + return ret; +} +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(uint64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +static inline struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner){ + return CVec_MonitorUpdateIdZ_clone(&owner->b); +} +uint64_tArray __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(uint64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); + uint64_tArray ret_arr = NULL; + ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); + uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t r = 0; r < ret_var.datalen; r++) { + LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; + uint64_t ret_conv_17_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); + ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); + ret_arr_ptr[r] = ret_conv_17_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + } + return ret; +} uint32_t __attribute__((export_name("TS_LDKCandidateRouteHop_ty_from_ptr"))) TS_LDKCandidateRouteHop_ty_from_ptr(uint64_t ptr) { LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); switch(obj->tag) { @@ -12610,7 +14102,7 @@ uint64_t channel_penalty_msat_LDKScoreLookUp_jcall(const void* this_arg, const L score_params_var = ProbabilisticScoringFeeParameters_clone(&score_params_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(score_params_var); score_params_ref = tag_ptr(score_params_var.inner, score_params_var.is_owned); - return js_invoke_function_bbbuuu(j_calls->instance_ptr, 53, ref_candidate, usage_ref, score_params_ref, 0, 0, 0); + return js_invoke_function_bbbuuu(j_calls->instance_ptr, 55, ref_candidate, usage_ref, score_params_ref, 0, 0, 0); } static void LDKScoreLookUp_JCalls_cloned(LDKScoreLookUp* new_obj) { LDKScoreLookUp_JCalls *j_calls = (LDKScoreLookUp_JCalls*) new_obj->this_arg; @@ -12671,7 +14163,7 @@ void payment_path_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * pa path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_bbbuuu(j_calls->instance_ptr, 54, path_ref, short_channel_id_conv, duration_since_epoch_conv, 0, 0, 0); + js_invoke_function_bbbuuu(j_calls->instance_ptr, 56, path_ref, short_channel_id_conv, duration_since_epoch_conv, 0, 0, 0); } void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -12681,7 +14173,7 @@ void payment_path_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_bbuuuu(j_calls->instance_ptr, 55, path_ref, duration_since_epoch_conv, 0, 0, 0, 0); + js_invoke_function_bbuuuu(j_calls->instance_ptr, 57, path_ref, duration_since_epoch_conv, 0, 0, 0, 0); } void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t short_channel_id, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -12692,7 +14184,7 @@ void probe_failed_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uin path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t short_channel_id_conv = short_channel_id; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_bbbuuu(j_calls->instance_ptr, 56, path_ref, short_channel_id_conv, duration_since_epoch_conv, 0, 0, 0); + js_invoke_function_bbbuuu(j_calls->instance_ptr, 58, path_ref, short_channel_id_conv, duration_since_epoch_conv, 0, 0, 0); } void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; @@ -12702,12 +14194,12 @@ void probe_successful_LDKScoreUpdate_jcall(void* this_arg, const LDKPath * path, CHECK_INNER_FIELD_ACCESS_OR_NULL(path_var); path_ref = tag_ptr(path_var.inner, path_var.is_owned); int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_bbuuuu(j_calls->instance_ptr, 57, path_ref, duration_since_epoch_conv, 0, 0, 0, 0); + js_invoke_function_bbuuuu(j_calls->instance_ptr, 59, path_ref, duration_since_epoch_conv, 0, 0, 0, 0); } void time_passed_LDKScoreUpdate_jcall(void* this_arg, uint64_t duration_since_epoch) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) this_arg; int64_t duration_since_epoch_conv = duration_since_epoch; - js_invoke_function_buuuuu(j_calls->instance_ptr, 58, duration_since_epoch_conv, 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 60, duration_since_epoch_conv, 0, 0, 0, 0, 0); } static void LDKScoreUpdate_JCalls_cloned(LDKScoreUpdate* new_obj) { LDKScoreUpdate_JCalls *j_calls = (LDKScoreUpdate_JCalls*) new_obj->this_arg; @@ -12801,7 +14293,7 @@ static void LDKLockableScore_JCalls_free(void* this_arg) { } LDKScoreLookUp read_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, 59, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 61, 0, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreLookUp ret_conv = *(LDKScoreLookUp*)(ret_ptr); @@ -12814,7 +14306,7 @@ LDKScoreLookUp read_lock_LDKLockableScore_jcall(const void* this_arg) { } LDKScoreUpdate write_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, 60, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 62, 0, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKScoreUpdate ret_conv = *(LDKScoreUpdate*)(ret_ptr); @@ -12878,7 +14370,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, 61, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 63, 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"); @@ -12937,7 +14429,7 @@ LDKCResult_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, // 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, 62, channel_manager_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 64, channel_manager_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12951,7 +14443,7 @@ LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, c // 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, 63, network_graph_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 65, network_graph_ref, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -12962,7 +14454,7 @@ LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, 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, 64, ret_scorer, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 66, ret_scorer, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -13042,12 +14534,12 @@ static void LDKPersist_JCalls_free(void* this_arg) { FREE(j_calls); } } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - uint64_t channel_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned); + LDKOutPoint channel_funding_outpoint_var = channel_funding_outpoint; + uint64_t channel_funding_outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); + channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); LDKChannelMonitor data_var = *data; uint64_t data_ref = 0; data_var = ChannelMonitor_clone(&data_var); @@ -13057,16 +14549,16 @@ 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, 67, channel_funding_outpoint_ref, data_ref, update_id_ref, 0, 0, 0); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } -LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { +LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - uint64_t channel_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned); + LDKOutPoint channel_funding_outpoint_var = channel_funding_outpoint; + uint64_t channel_funding_outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); + channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); LDKChannelMonitorUpdate update_var = update; uint64_t update_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); @@ -13080,10 +14572,18 @@ 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, 68, channel_funding_outpoint_ref, update_ref, data_ref, update_id_ref, 0, 0); LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_js(ret); return ret_conv; } +void archive_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_funding_outpoint) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + LDKOutPoint channel_funding_outpoint_var = channel_funding_outpoint; + uint64_t channel_funding_outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_var); + channel_funding_outpoint_ref = tag_ptr(channel_funding_outpoint_var.inner, channel_funding_outpoint_var.is_owned); + js_invoke_function_buuuuu(j_calls->instance_ptr, 69, channel_funding_outpoint_ref, 0, 0, 0, 0, 0); +} static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) { LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg; atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); @@ -13097,6 +14597,7 @@ static inline LDKPersist LDKPersist_init (JSValue o) { .this_arg = (void*) calls, .persist_new_channel = persist_new_channel_LDKPersist_jcall, .update_persisted_channel = update_persisted_channel_LDKPersist_jcall, + .archive_persisted_channel = archive_persisted_channel_LDKPersist_jcall, .free = LDKPersist_JCalls_free, }; return ret; @@ -13106,15 +14607,15 @@ uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JS *res_ptr = LDKPersist_init(o); return tag_ptr(res_ptr, true); } -uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_id, uint64_t data, uint64_t update_id) { +uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Persist_persist_new_channel(uint64_t this_arg, uint64_t channel_funding_outpoint, uint64_t data, uint64_t update_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; - LDKOutPoint channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = OutPoint_clone(&channel_id_conv); + LDKOutPoint channel_funding_outpoint_conv; + channel_funding_outpoint_conv.inner = untag_ptr(channel_funding_outpoint); + channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); + channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); LDKChannelMonitor data_conv; data_conv.inner = untag_ptr(data); data_conv.is_owned = ptr_is_owned(data); @@ -13125,19 +14626,19 @@ uint32_t __attribute__((export_name("TS_Persist_persist_new_channel"))) TS_Pers update_id_conv.is_owned = ptr_is_owned(update_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); - uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv)); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &data_conv, update_id_conv)); return ret_conv; } -uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_id, uint64_t update, uint64_t data, uint64_t update_id) { +uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS_Persist_update_persisted_channel(uint64_t this_arg, uint64_t channel_funding_outpoint, uint64_t update, uint64_t data, uint64_t update_id) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; - LDKOutPoint channel_id_conv; - channel_id_conv.inner = untag_ptr(channel_id); - channel_id_conv.is_owned = ptr_is_owned(channel_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); - channel_id_conv = OutPoint_clone(&channel_id_conv); + LDKOutPoint channel_funding_outpoint_conv; + channel_funding_outpoint_conv.inner = untag_ptr(channel_funding_outpoint); + channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); + channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); LDKChannelMonitorUpdate update_conv; update_conv.inner = untag_ptr(update); update_conv.is_owned = ptr_is_owned(update); @@ -13153,50 +14654,20 @@ uint32_t __attribute__((export_name("TS_Persist_update_persisted_channel"))) TS update_id_conv.is_owned = ptr_is_owned(update_id); CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv); update_id_conv = MonitorUpdateId_clone(&update_id_conv); - uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, update_conv, &data_conv, update_id_conv)); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, update_conv, &data_conv, update_id_conv)); return ret_conv; } -typedef struct LDKFutureCallback_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKFutureCallback_JCalls; -static void LDKFutureCallback_JCalls_free(void* this_arg) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } -} -void call_LDKFutureCallback_jcall(const void* this_arg) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 67, 0, 0, 0, 0, 0, 0); -} -static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; - atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); -} -static inline LDKFutureCallback LDKFutureCallback_init (JSValue o) { - LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - - LDKFutureCallback ret = { - .this_arg = (void*) calls, - .call = call_LDKFutureCallback_jcall, - .free = LDKFutureCallback_JCalls_free, - }; - return ret; -} -uint64_t __attribute__((export_name("TS_LDKFutureCallback_new"))) TS_LDKFutureCallback_new(JSValue o) { - LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); - *res_ptr = LDKFutureCallback_init(o); - return tag_ptr(res_ptr, true); -} -void __attribute__((export_name("TS_FutureCallback_call"))) TS_FutureCallback_call(uint64_t this_arg) { +void __attribute__((export_name("TS_Persist_archive_persisted_channel"))) TS_Persist_archive_persisted_channel(uint64_t this_arg, uint64_t channel_funding_outpoint) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr; - (this_arg_conv->call)(this_arg_conv->this_arg); + LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr; + LDKOutPoint channel_funding_outpoint_conv; + channel_funding_outpoint_conv.inner = untag_ptr(channel_funding_outpoint); + channel_funding_outpoint_conv.is_owned = ptr_is_owned(channel_funding_outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_outpoint_conv); + channel_funding_outpoint_conv = OutPoint_clone(&channel_funding_outpoint_conv); + (this_arg_conv->archive_persisted_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv); } typedef struct LDKListen_JCalls { @@ -13225,7 +14696,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, 68, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 70, (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; @@ -13233,14 +14704,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, 69, (uint32_t)block_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 71, (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, 70, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 72, (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; @@ -13340,24 +14811,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, 71, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 73, (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, 72, (uint32_t)txid_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 74, (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, 73, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 75, (uint32_t)header_arr, height_conv, 0, 0, 0, 0); } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ 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, 74, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 76, 0, 0, 0, 0, 0, 0); LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13467,6 +14938,68 @@ uint64_tArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_ return ret_arr; } +uint32_t __attribute__((export_name("TS_LDKSpendingDelay_ty_from_ptr"))) TS_LDKSpendingDelay_ty_from_ptr(uint64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSpendingDelay_Relative: return 0; + case LDKSpendingDelay_Absolute: return 1; + default: abort(); + } +} +int32_t __attribute__((export_name("TS_LDKSpendingDelay_Relative_get_num_blocks"))) TS_LDKSpendingDelay_Relative_get_num_blocks(uint64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + assert(obj->tag == LDKSpendingDelay_Relative); + int32_t num_blocks_conv = obj->relative.num_blocks; + return num_blocks_conv; +} +int32_t __attribute__((export_name("TS_LDKSpendingDelay_Absolute_get_height"))) TS_LDKSpendingDelay_Absolute_get_height(uint64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + assert(obj->tag == LDKSpendingDelay_Absolute); + int32_t height_conv = obj->absolute.height; + return height_conv; +} +typedef struct LDKFutureCallback_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKFutureCallback_JCalls; +static void LDKFutureCallback_JCalls_free(void* this_arg) { + LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +void call_LDKFutureCallback_jcall(const void* this_arg) { + LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; + js_invoke_function_uuuuuu(j_calls->instance_ptr, 77, 0, 0, 0, 0, 0, 0); +} +static void LDKFutureCallback_JCalls_cloned(LDKFutureCallback* new_obj) { + LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKFutureCallback LDKFutureCallback_init (JSValue o) { + LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKFutureCallback ret = { + .this_arg = (void*) calls, + .call = call_LDKFutureCallback_jcall, + .free = LDKFutureCallback_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKFutureCallback_new"))) TS_LDKFutureCallback_new(JSValue o) { + LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); + *res_ptr = LDKFutureCallback_init(o); + return tag_ptr(res_ptr, true); +} +void __attribute__((export_name("TS_FutureCallback_call"))) TS_FutureCallback_call(uint64_t this_arg) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKFutureCallback* this_arg_conv = (LDKFutureCallback*)this_arg_ptr; + (this_arg_conv->call)(this_arg_conv->this_arg); +} + typedef struct LDKEventHandler_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -13482,7 +15015,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { 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, 75, event_ref, 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 78, 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; @@ -13530,7 +15063,7 @@ void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEve 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, 76, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0); + js_invoke_function_buuuuu(j_calls->instance_ptr, 79, 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; @@ -13595,7 +15128,7 @@ static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) { } 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, 77, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 80, 0, 0, 0, 0, 0, 0); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13674,7 +15207,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, 78, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_open_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKOpenChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13685,7 +15218,7 @@ void handle_open_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, msg_var = OpenChannelV2_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, 82, (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; @@ -13696,7 +15229,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, 80, (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_accept_channel_v2_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAcceptChannelV2 * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13707,7 +15240,7 @@ void handle_accept_channel_v2_LDKChannelMessageHandler_jcall(const void* this_ar msg_var = AcceptChannelV2_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, 84, (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; @@ -13718,7 +15251,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, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 85, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13729,7 +15262,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, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 86, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } 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; @@ -13740,7 +15273,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, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 87, (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; @@ -13751,7 +15284,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, 85, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 88, (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; @@ -13762,7 +15295,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, 86, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 89, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_stfu_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKStfu * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13773,39 +15306,6 @@ void handle_stfu_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicK msg_var = Stfu_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, 87, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); -} -void handle_splice_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKSplice * msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); - memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - LDKSplice msg_var = *msg; - uint64_t msg_ref = 0; - msg_var = Splice_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, 88, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); -} -void handle_splice_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKSpliceAck * msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); - memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - LDKSpliceAck msg_var = *msg; - uint64_t msg_ref = 0; - msg_var = SpliceAck_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, 89, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); -} -void handle_splice_locked_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKSpliceLocked * msg) { - LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; - int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); - memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - LDKSpliceLocked msg_var = *msg; - uint64_t msg_ref = 0; - msg_var = SpliceLocked_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, 90, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); } void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddInput * msg) { @@ -14102,9 +15602,6 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JSValue o, .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall, .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall, .handle_stfu = handle_stfu_LDKChannelMessageHandler_jcall, - .handle_splice = handle_splice_LDKChannelMessageHandler_jcall, - .handle_splice_ack = handle_splice_ack_LDKChannelMessageHandler_jcall, - .handle_splice_locked = handle_splice_locked_LDKChannelMessageHandler_jcall, .handle_tx_add_input = handle_tx_add_input_LDKChannelMessageHandler_jcall, .handle_tx_add_output = handle_tx_add_output_LDKChannelMessageHandler_jcall, .handle_tx_remove_input = handle_tx_remove_input_LDKChannelMessageHandler_jcall, @@ -14291,51 +15788,6 @@ void __attribute__((export_name("TS_ChannelMessageHandler_handle_stfu"))) TS_Ch (this_arg_conv->handle_stfu)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -void __attribute__((export_name("TS_ChannelMessageHandler_handle_splice"))) TS_ChannelMessageHandler_handle_splice(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; - LDKPublicKey their_node_id_ref; - CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); - LDKSplice msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - (this_arg_conv->handle_splice)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); -} - -void __attribute__((export_name("TS_ChannelMessageHandler_handle_splice_ack"))) TS_ChannelMessageHandler_handle_splice_ack(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; - LDKPublicKey their_node_id_ref; - CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); - LDKSpliceAck msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - (this_arg_conv->handle_splice_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); -} - -void __attribute__((export_name("TS_ChannelMessageHandler_handle_splice_locked"))) TS_ChannelMessageHandler_handle_splice_locked(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr; - LDKPublicKey their_node_id_ref; - CHECK(their_node_id->arr_len == 33); - memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id); - LDKSpliceLocked msg_conv; - msg_conv.inner = untag_ptr(msg); - msg_conv.is_owned = ptr_is_owned(msg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv); - msg_conv.is_owned = false; - (this_arg_conv->handle_splice_locked)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); -} - void __attribute__((export_name("TS_ChannelMessageHandler_handle_tx_add_input"))) TS_ChannelMessageHandler_handle_tx_add_input(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -14795,6 +16247,55 @@ uint64_tArray __attribute__((export_name("TS_OffersMessageHandler_release_pendi return ret_arr; } +typedef struct LDKNodeIdLookUp_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKNodeIdLookUp_JCalls; +static void LDKNodeIdLookUp_JCalls_free(void* this_arg) { + LDKNodeIdLookUp_JCalls *j_calls = (LDKNodeIdLookUp_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKPublicKey next_node_id_LDKNodeIdLookUp_jcall(const void* this_arg, uint64_t short_channel_id) { + LDKNodeIdLookUp_JCalls *j_calls = (LDKNodeIdLookUp_JCalls*) this_arg; + int64_t short_channel_id_conv = short_channel_id; + int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 118, short_channel_id_conv, 0, 0, 0, 0, 0); + LDKPublicKey ret_ref; + CHECK(ret->arr_len == 33); + memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret); + return ret_ref; +} +static void LDKNodeIdLookUp_JCalls_cloned(LDKNodeIdLookUp* new_obj) { + LDKNodeIdLookUp_JCalls *j_calls = (LDKNodeIdLookUp_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKNodeIdLookUp LDKNodeIdLookUp_init (JSValue o) { + LDKNodeIdLookUp_JCalls *calls = MALLOC(sizeof(LDKNodeIdLookUp_JCalls), "LDKNodeIdLookUp_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKNodeIdLookUp ret = { + .this_arg = (void*) calls, + .next_node_id = next_node_id_LDKNodeIdLookUp_jcall, + .free = LDKNodeIdLookUp_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKNodeIdLookUp_new"))) TS_LDKNodeIdLookUp_new(JSValue o) { + LDKNodeIdLookUp *res_ptr = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *res_ptr = LDKNodeIdLookUp_init(o); + return tag_ptr(res_ptr, true); +} +int8_tArray __attribute__((export_name("TS_NodeIdLookUp_next_node_id"))) TS_NodeIdLookUp_next_node_id(uint64_t this_arg, int64_t short_channel_id) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKNodeIdLookUp* this_arg_conv = (LDKNodeIdLookUp*)this_arg_ptr; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, (this_arg_conv->next_node_id)(this_arg_conv->this_arg, short_channel_id).compressed_form, 33); + return ret_arr; +} + typedef struct LDKRoutingMessageHandler_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -14813,7 +16314,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, 118, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 119, 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); @@ -14827,7 +16328,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, 119, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 120, 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); @@ -14841,7 +16342,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, 120, msg_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 121, 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); @@ -14851,7 +16352,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, 121, starting_point_conv, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 122, 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); @@ -14864,7 +16365,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, 122, starting_point_ref, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 123, 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); @@ -14881,7 +16382,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, 123, (uint32_t)their_node_id_arr, init_ref, inbound_conv, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 124, (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); @@ -14896,7 +16397,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, 124, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 125, (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); @@ -14911,7 +16412,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, 125, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 126, (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); @@ -14926,7 +16427,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, 126, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 127, (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); @@ -14941,7 +16442,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, 127, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 128, (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); @@ -14950,11 +16451,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, 128, 0, 0, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 129, 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, 129, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 130, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -14965,7 +16466,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, 130, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 131, (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); @@ -15206,7 +16707,7 @@ static void LDKOnionMessageHandler_JCalls_free(void* this_arg) { } LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ get_and_clear_connections_needed_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 131, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 132, 0, 0, 0, 0, 0, 0); LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15234,13 +16735,13 @@ void handle_onion_message_LDKOnionMessageHandler_jcall(const void* this_arg, LDK msg_var = OnionMessage_clone(&msg_var); CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var); msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned); - js_invoke_function_ubuuuu(j_calls->instance_ptr, 132, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0); + js_invoke_function_ubuuuu(j_calls->instance_ptr, 133, (uint32_t)peer_node_id_arr, msg_ref, 0, 0, 0, 0); } LDKOnionMessage next_onion_message_for_peer_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPublicKey peer_node_id) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray peer_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(peer_node_id_arr->elems, peer_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 133, (uint32_t)peer_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 134, (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); @@ -15257,7 +16758,7 @@ LDKCResult_NoneNoneZ peer_connected_LDKOnionMessageHandler_jcall(const void* thi 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, 134, (uint32_t)their_node_id_arr, init_ref, inbound_conv, 0, 0, 0); + uint64_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 135, (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); @@ -15268,15 +16769,15 @@ void peer_disconnected_LDKOnionMessageHandler_jcall(const void* this_arg, LDKPub LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - js_invoke_function_uuuuuu(j_calls->instance_ptr, 135, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 136, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); } void timer_tick_occurred_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 136, 0, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 137, 0, 0, 0, 0, 0, 0); } LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 137, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 138, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15287,7 +16788,7 @@ LDKInitFeatures provided_init_features_LDKOnionMessageHandler_jcall(const void* LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 138, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 139, (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); @@ -15444,7 +16945,7 @@ LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const voi LDKu8slice buffer_var = buffer; int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 139, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 140, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); @@ -15502,7 +17003,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca *msg_ret = msg; int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__); memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 140, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 141, tag_ptr(msg_ret, true), (uint32_t)sender_node_id_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15511,7 +17012,7 @@ LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jca } LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 141, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 142, 0, 0, 0, 0, 0, 0); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15532,7 +17033,7 @@ LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandle } LDKNodeFeatures provided_node_features_LDKCustomMessageHandler_jcall(const void* this_arg) { LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 142, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 143, 0, 0, 0, 0, 0, 0); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15543,7 +17044,7 @@ LDKInitFeatures provided_init_features_LDKCustomMessageHandler_jcall(const void* LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_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, 143, (uint32_t)their_node_id_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 144, (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); @@ -15653,7 +17154,7 @@ LDKCOption_OnionMessageContentsZ handle_custom_message_LDKCustomOnionMessageHand LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; LDKOnionMessageContents* msg_ret = MALLOC(sizeof(LDKOnionMessageContents), "LDKOnionMessageContents"); *msg_ret = msg; - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 144, tag_ptr(msg_ret, true), 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 145, tag_ptr(msg_ret, true), 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); @@ -15666,7 +17167,7 @@ LDKCResult_COption_OnionMessageContentsZDecodeErrorZ read_custom_message_LDKCust LDKu8slice buffer_var = buffer; int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__); memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen); - uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 145, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 146, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_OnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ*)(ret_ptr); @@ -15675,7 +17176,7 @@ LDKCResult_COption_OnionMessageContentsZDecodeErrorZ read_custom_message_LDKCust } LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ release_pending_custom_messages_LDKCustomOnionMessageHandler_jcall(const void* this_arg) { LDKCustomOnionMessageHandler_JCalls *j_calls = (LDKCustomOnionMessageHandler_JCalls*) this_arg; - uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 146, 0, 0, 0, 0, 0, 0); + uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 147, 0, 0, 0, 0, 0, 0); LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15781,21 +17282,21 @@ uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, b int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__); memcpy(data_arr->elems, data_var.data, data_var.datalen); jboolean resume_read_conv = resume_read; - return js_invoke_function_uuuuuu(j_calls->instance_ptr, 147, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 148, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0); } void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - js_invoke_function_uuuuuu(j_calls->instance_ptr, 148, 0, 0, 0, 0, 0, 0); + js_invoke_function_uuuuuu(j_calls->instance_ptr, 149, 0, 0, 0, 0, 0, 0); } bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor"); *other_arg_clone = SocketDescriptor_clone(other_arg); - return js_invoke_function_buuuuu(j_calls->instance_ptr, 149, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0); + return js_invoke_function_buuuuu(j_calls->instance_ptr, 150, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - return js_invoke_function_uuuuuu(j_calls->instance_ptr, 150, 0, 0, 0, 0, 0, 0); + return js_invoke_function_uuuuuu(j_calls->instance_ptr, 151, 0, 0, 0, 0, 0, 0); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -15849,6 +17350,138 @@ int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescr return ret_conv; } +typedef struct LDKSignBolt12InvoiceFn_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKSignBolt12InvoiceFn_JCalls; +static void LDKSignBolt12InvoiceFn_JCalls_free(void* this_arg) { + LDKSignBolt12InvoiceFn_JCalls *j_calls = (LDKSignBolt12InvoiceFn_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_SchnorrSignatureNoneZ sign_invoice_LDKSignBolt12InvoiceFn_jcall(const void* this_arg, const LDKUnsignedBolt12Invoice * message) { + LDKSignBolt12InvoiceFn_JCalls *j_calls = (LDKSignBolt12InvoiceFn_JCalls*) this_arg; + LDKUnsignedBolt12Invoice message_var = *message; + uint64_t message_ref = 0; + message_var = UnsignedBolt12Invoice_clone(&message_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 152, message_ref, 0, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKSignBolt12InvoiceFn_JCalls_cloned(LDKSignBolt12InvoiceFn* new_obj) { + LDKSignBolt12InvoiceFn_JCalls *j_calls = (LDKSignBolt12InvoiceFn_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKSignBolt12InvoiceFn LDKSignBolt12InvoiceFn_init (JSValue o) { + LDKSignBolt12InvoiceFn_JCalls *calls = MALLOC(sizeof(LDKSignBolt12InvoiceFn_JCalls), "LDKSignBolt12InvoiceFn_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKSignBolt12InvoiceFn ret = { + .this_arg = (void*) calls, + .sign_invoice = sign_invoice_LDKSignBolt12InvoiceFn_jcall, + .free = LDKSignBolt12InvoiceFn_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKSignBolt12InvoiceFn_new"))) TS_LDKSignBolt12InvoiceFn_new(JSValue o) { + LDKSignBolt12InvoiceFn *res_ptr = MALLOC(sizeof(LDKSignBolt12InvoiceFn), "LDKSignBolt12InvoiceFn"); + *res_ptr = LDKSignBolt12InvoiceFn_init(o); + return tag_ptr(res_ptr, true); +} +uint64_t __attribute__((export_name("TS_SignBolt12InvoiceFn_sign_invoice"))) TS_SignBolt12InvoiceFn_sign_invoice(uint64_t this_arg, uint64_t message) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKSignBolt12InvoiceFn* this_arg_conv = (LDKSignBolt12InvoiceFn*)this_arg_ptr; + LDKUnsignedBolt12Invoice message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv.is_owned = false; + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, &message_conv); + return tag_ptr(ret_conv, true); +} + +typedef struct LDKSignInvoiceRequestFn_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKSignInvoiceRequestFn_JCalls; +static void LDKSignInvoiceRequestFn_JCalls_free(void* this_arg) { + LDKSignInvoiceRequestFn_JCalls *j_calls = (LDKSignInvoiceRequestFn_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_SchnorrSignatureNoneZ sign_invoice_request_LDKSignInvoiceRequestFn_jcall(const void* this_arg, const LDKUnsignedInvoiceRequest * message) { + LDKSignInvoiceRequestFn_JCalls *j_calls = (LDKSignInvoiceRequestFn_JCalls*) this_arg; + LDKUnsignedInvoiceRequest message_var = *message; + uint64_t message_ref = 0; + message_var = UnsignedInvoiceRequest_clone(&message_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_var); + message_ref = tag_ptr(message_var.inner, message_var.is_owned); + uint64_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 153, message_ref, 0, 0, 0, 0, 0); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_SchnorrSignatureNoneZ ret_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKSignInvoiceRequestFn_JCalls_cloned(LDKSignInvoiceRequestFn* new_obj) { + LDKSignInvoiceRequestFn_JCalls *j_calls = (LDKSignInvoiceRequestFn_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKSignInvoiceRequestFn LDKSignInvoiceRequestFn_init (JSValue o) { + LDKSignInvoiceRequestFn_JCalls *calls = MALLOC(sizeof(LDKSignInvoiceRequestFn_JCalls), "LDKSignInvoiceRequestFn_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKSignInvoiceRequestFn ret = { + .this_arg = (void*) calls, + .sign_invoice_request = sign_invoice_request_LDKSignInvoiceRequestFn_jcall, + .free = LDKSignInvoiceRequestFn_JCalls_free, + }; + return ret; +} +uint64_t __attribute__((export_name("TS_LDKSignInvoiceRequestFn_new"))) TS_LDKSignInvoiceRequestFn_new(JSValue o) { + LDKSignInvoiceRequestFn *res_ptr = MALLOC(sizeof(LDKSignInvoiceRequestFn), "LDKSignInvoiceRequestFn"); + *res_ptr = LDKSignInvoiceRequestFn_init(o); + return tag_ptr(res_ptr, true); +} +uint64_t __attribute__((export_name("TS_SignInvoiceRequestFn_sign_invoice_request"))) TS_SignInvoiceRequestFn_sign_invoice_request(uint64_t this_arg, uint64_t message) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKSignInvoiceRequestFn* this_arg_conv = (LDKSignInvoiceRequestFn*)this_arg_ptr; + LDKUnsignedInvoiceRequest message_conv; + message_conv.inner = untag_ptr(message); + message_conv.is_owned = ptr_is_owned(message); + CHECK_INNER_FIELD_ACCESS_OR_NULL(message_conv); + message_conv.is_owned = false; + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = (this_arg_conv->sign_invoice_request)(this_arg_conv->this_arg, &message_conv); + return tag_ptr(ret_conv, true); +} + +uint32_t __attribute__((export_name("TS_LDKSignError_ty_from_ptr"))) TS_LDKSignError_ty_from_ptr(uint64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignError_Signing: return 0; + case LDKSignError_Verification: return 1; + default: abort(); + } +} +uint32_t __attribute__((export_name("TS_LDKSignError_Verification_get_verification"))) TS_LDKSignError_Verification_get_verification(uint64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + assert(obj->tag == LDKSignError_Verification); + uint32_t verification_conv = LDKSecp256k1Error_to_js(obj->verification); + return verification_conv; +} uint32_t __attribute__((export_name("TS_LDKEffectiveCapacity_ty_from_ptr"))) TS_LDKEffectiveCapacity_ty_from_ptr(uint64_t ptr) { LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr); switch(obj->tag) { @@ -15977,7 +17610,7 @@ static void LDKScore_JCalls_free(void* this_arg) { } 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, 151, 0, 0, 0, 0, 0, 0); + int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 154, 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"); @@ -16022,6 +17655,33 @@ int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint6 return ret_arr; } +uint32_t __attribute__((export_name("TS_LDKIntroductionNode_ty_from_ptr"))) TS_LDKIntroductionNode_ty_from_ptr(uint64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + switch(obj->tag) { + case LDKIntroductionNode_NodeId: return 0; + case LDKIntroductionNode_DirectedShortChannelId: return 1; + default: abort(); + } +} +int8_tArray __attribute__((export_name("TS_LDKIntroductionNode_NodeId_get_node_id"))) TS_LDKIntroductionNode_NodeId_get_node_id(uint64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + assert(obj->tag == LDKIntroductionNode_NodeId); + int8_tArray node_id_arr = init_int8_tArray(33, __LINE__); + memcpy(node_id_arr->elems, obj->node_id.compressed_form, 33); + return node_id_arr; +} +uint32_t __attribute__((export_name("TS_LDKIntroductionNode_DirectedShortChannelId_get__0"))) TS_LDKIntroductionNode_DirectedShortChannelId_get__0(uint64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + assert(obj->tag == LDKIntroductionNode_DirectedShortChannelId); + uint32_t _0_conv = LDKDirection_to_js(obj->directed_short_channel_id._0); + return _0_conv; +} +int64_t __attribute__((export_name("TS_LDKIntroductionNode_DirectedShortChannelId_get__1"))) TS_LDKIntroductionNode_DirectedShortChannelId_get__1(uint64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + assert(obj->tag == LDKIntroductionNode_DirectedShortChannelId); + int64_t _1_conv = obj->directed_short_channel_id._1; + return _1_conv; +} typedef struct LDKCoinSelectionSource_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; @@ -16061,7 +17721,7 @@ LDKCResult_CoinSelectionNoneZ select_confirmed_utxos_LDKCoinSelectionSource_jcal FREE(must_pay_to_var.data); int32_t target_feerate_sat_per_1000_weight_conv = target_feerate_sat_per_1000_weight; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 152, (uint32_t)claim_id_arr, (uint32_t)must_spend_arr, (uint32_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 155, (uint32_t)claim_id_arr, (uint32_t)must_spend_arr, (uint32_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CoinSelectionNoneZ ret_conv = *(LDKCResult_CoinSelectionNoneZ*)(ret_ptr); @@ -16074,7 +17734,7 @@ LDKCResult_TransactionNoneZ sign_psbt_LDKCoinSelectionSource_jcall(const void* t int8_tArray psbt_arr = init_int8_tArray(psbt_var.datalen, __LINE__); memcpy(psbt_arr->elems, psbt_var.data, psbt_var.datalen); CVec_u8Z_free(psbt_var); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 153, (uint32_t)psbt_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 156, (uint32_t)psbt_arr, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -16173,7 +17833,7 @@ static void LDKWalletSource_JCalls_free(void* this_arg) { } LDKCResult_CVec_UtxoZNoneZ list_confirmed_utxos_LDKWalletSource_jcall(const void* this_arg) { LDKWalletSource_JCalls *j_calls = (LDKWalletSource_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 154, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 157, 0, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_UtxoZNoneZ ret_conv = *(LDKCResult_CVec_UtxoZNoneZ*)(ret_ptr); @@ -16182,7 +17842,7 @@ LDKCResult_CVec_UtxoZNoneZ list_confirmed_utxos_LDKWalletSource_jcall(const void } LDKCResult_CVec_u8ZNoneZ get_change_script_LDKWalletSource_jcall(const void* this_arg) { LDKWalletSource_JCalls *j_calls = (LDKWalletSource_JCalls*) this_arg; - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 155, 0, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 158, 0, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -16195,7 +17855,7 @@ LDKCResult_TransactionNoneZ sign_psbt_LDKWalletSource_jcall(const void* this_arg int8_tArray psbt_arr = init_int8_tArray(psbt_var.datalen, __LINE__); memcpy(psbt_arr->elems, psbt_var.data, psbt_var.datalen); CVec_u8Z_free(psbt_var); - uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 156, (uint32_t)psbt_arr, 0, 0, 0, 0, 0); + uint64_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 159, (uint32_t)psbt_arr, 0, 0, 0, 0, 0); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -16413,6 +18073,24 @@ uint64_t __attribute__((export_name("TS_BigEndianScalar_new"))) TS_BigEndianSca return tag_ptr(ret_ref, true); } +static inline uint64_t BigEndianScalar_clone_ptr(LDKBigEndianScalar *NONNULL_PTR arg) { + LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); + *ret_ref = BigEndianScalar_clone(arg); + return tag_ptr(ret_ref, true); +} +int64_t __attribute__((export_name("TS_BigEndianScalar_clone_ptr"))) TS_BigEndianScalar_clone_ptr(uint64_t arg) { + LDKBigEndianScalar* arg_conv = (LDKBigEndianScalar*)untag_ptr(arg); + int64_t ret_conv = BigEndianScalar_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_BigEndianScalar_clone"))) TS_BigEndianScalar_clone(uint64_t orig) { + LDKBigEndianScalar* orig_conv = (LDKBigEndianScalar*)untag_ptr(orig); + LDKBigEndianScalar* ret_ref = MALLOC(sizeof(LDKBigEndianScalar), "LDKBigEndianScalar"); + *ret_ref = BigEndianScalar_clone(orig_conv); + return tag_ptr(ret_ref, true); +} + static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) { LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error"); *ret_copy = Bech32Error_clone(arg); @@ -16579,6 +18257,116 @@ void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) { Str_free(dummy); } +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_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(uint64_t o) { + LDKRefundMaybeWithDerivedMetadataBuilder 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 = RefundMaybeWithDerivedMetadataBuilder_clone(&o_conv); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone"))) TS_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* orig_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_ok"))) TS_CResult_RefundBolt12SemanticErrorZ_ok(uint64_t o) { + LDKRefund 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 = Refund_clone(&o_conv); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_err"))) TS_CResult_RefundBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_is_ok"))) TS_CResult_RefundBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_RefundBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_free"))) TS_CResult_RefundBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RefundBolt12SemanticErrorZ _res_conv = *(LDKCResult_RefundBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RefundBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_RefundBolt12SemanticErrorZ_clone_ptr(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_RefundBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_RefundBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_RefundBolt12SemanticErrorZ_clone"))) TS_CResult_RefundBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_RefundBolt12SemanticErrorZ* orig_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = CResult_RefundBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + 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); @@ -16885,14 +18673,6 @@ uint64_t __attribute__((export_name("TS_COption_ThirtyTwoBytesZ_clone"))) TS_CO return ret_ref; } -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; @@ -17101,6 +18881,156 @@ uint64_t __attribute__((export_name("TS_CResult_RecipientOnionFieldsNoneZ_clone return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(uint64_t o) { + LDKUnsignedBolt12Invoice 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 = UnsignedBolt12Invoice_clone(&o_conv); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res_conv = *(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone"))) TS_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* orig_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(uint64_t o) { + LDKBolt12Invoice 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 = Bolt12Invoice_clone(&o_conv); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_err"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_free"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res_conv = *(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone"))) TS_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* orig_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_ok"))) TS_CResult_SchnorrSignatureNoneZ_ok(int8_tArray o) { + LDKSchnorrSignature o_ref; + CHECK(o->arr_len == 64); + memcpy(o_ref.compact_form, o->elems, 64); FREE(o); + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_err"))) TS_CResult_SchnorrSignatureNoneZ_err() { + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_is_ok"))) TS_CResult_SchnorrSignatureNoneZ_is_ok(uint64_t o) { + LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_free"))) TS_CResult_SchnorrSignatureNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SchnorrSignatureNoneZ _res_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SchnorrSignatureNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_SchnorrSignatureNoneZ_clone_ptr(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR arg) { + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_clone_ptr"))) TS_CResult_SchnorrSignatureNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_clone"))) TS_CResult_SchnorrSignatureNoneZ_clone(uint64_t orig) { + LDKCResult_SchnorrSignatureNoneZ* orig_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(orig); + LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); + *ret_conv = CResult_SchnorrSignatureNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + void __attribute__((export_name("TS_CVec_ThirtyTwoBytesZ_free"))) TS_CVec_ThirtyTwoBytesZ_free(ptrArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -17178,6 +19108,100 @@ uint64_t __attribute__((export_name("TS_COption_CVec_ThirtyTwoBytesZZ_clone"))) return ret_ref; } +uint64_t __attribute__((export_name("TS_COption_AmountZ_some"))) TS_COption_AmountZ_some(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKAmount o_conv = *(LDKAmount*)(o_ptr); + o_conv = Amount_clone((LDKAmount*)untag_ptr(o)); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_AmountZ_none"))) TS_COption_AmountZ_none() { + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_AmountZ_free"))) TS_COption_AmountZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_AmountZ _res_conv = *(LDKCOption_AmountZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_AmountZ_free(_res_conv); +} + +static inline uint64_t COption_AmountZ_clone_ptr(LDKCOption_AmountZ *NONNULL_PTR arg) { + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_AmountZ_clone_ptr"))) TS_COption_AmountZ_clone_ptr(uint64_t arg) { + LDKCOption_AmountZ* arg_conv = (LDKCOption_AmountZ*)untag_ptr(arg); + int64_t ret_conv = COption_AmountZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_AmountZ_clone"))) TS_COption_AmountZ_clone(uint64_t orig) { + LDKCOption_AmountZ* orig_conv = (LDKCOption_AmountZ*)untag_ptr(orig); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_QuantityZ_some"))) TS_COption_QuantityZ_some(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKQuantity o_conv = *(LDKQuantity*)(o_ptr); + o_conv = Quantity_clone((LDKQuantity*)untag_ptr(o)); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_QuantityZ_none"))) TS_COption_QuantityZ_none() { + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_QuantityZ_free"))) TS_COption_QuantityZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_QuantityZ _res_conv = *(LDKCOption_QuantityZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_QuantityZ_free(_res_conv); +} + +static inline uint64_t COption_QuantityZ_clone_ptr(LDKCOption_QuantityZ *NONNULL_PTR arg) { + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_QuantityZ_clone_ptr"))) TS_COption_QuantityZ_clone_ptr(uint64_t arg) { + LDKCOption_QuantityZ* arg_conv = (LDKCOption_QuantityZ*)untag_ptr(arg); + int64_t ret_conv = COption_QuantityZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_QuantityZ_clone"))) TS_COption_QuantityZ_clone(uint64_t orig) { + LDKCOption_QuantityZ* orig_conv = (LDKCOption_QuantityZ*)untag_ptr(orig); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesNoneZ_ok"))) TS_CResult_ThirtyTwoBytesNoneZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); @@ -17815,7 +19839,7 @@ uint64_t __attribute__((export_name("TS_COption_BigEndianScalarZ_some"))) TS_CO void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar + o_conv = BigEndianScalar_clone((LDKBigEndianScalar*)untag_ptr(o)); LDKCOption_BigEndianScalarZ *ret_copy = MALLOC(sizeof(LDKCOption_BigEndianScalarZ), "LDKCOption_BigEndianScalarZ"); *ret_copy = COption_BigEndianScalarZ_some(o_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); @@ -17923,54 +19947,6 @@ uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_ok"))) TS_CResult_SchnorrSignatureNoneZ_ok(int8_tArray o) { - LDKSchnorrSignature o_ref; - CHECK(o->arr_len == 64); - memcpy(o_ref.compact_form, o->elems, 64); FREE(o); - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_err"))) TS_CResult_SchnorrSignatureNoneZ_err() { - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_is_ok"))) TS_CResult_SchnorrSignatureNoneZ_is_ok(uint64_t o) { - LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_free"))) TS_CResult_SchnorrSignatureNoneZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_SchnorrSignatureNoneZ _res_conv = *(LDKCResult_SchnorrSignatureNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_SchnorrSignatureNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_SchnorrSignatureNoneZ_clone_ptr(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR arg) { - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_clone_ptr"))) TS_CResult_SchnorrSignatureNoneZ_clone_ptr(uint64_t arg) { - LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_SchnorrSignatureNoneZ_clone"))) TS_CResult_SchnorrSignatureNoneZ_clone(uint64_t orig) { - LDKCResult_SchnorrSignatureNoneZ* orig_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(orig); - LDKCResult_SchnorrSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SchnorrSignatureNoneZ), "LDKCResult_SchnorrSignatureNoneZ"); - *ret_conv = CResult_SchnorrSignatureNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - uint64_t __attribute__((export_name("TS_CResult_ECDSASignatureNoneZ_ok"))) TS_CResult_ECDSASignatureNoneZ_ok(int8_tArray o) { LDKECDSASignature o_ref; CHECK(o->arr_len == 64); @@ -18019,6 +19995,56 @@ uint64_t __attribute__((export_name("TS_CResult_ECDSASignatureNoneZ_clone"))) T return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) { + LDKTransaction o_ref; + o_ref.datalen = o->arr_len; + o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); + memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); + o_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TransactionNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) { + LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig); + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok"))) TS_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -18483,56 +20509,6 @@ uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clon return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) { - LDKTransaction o_ref; - o_ref.datalen = o->arr_len; - o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes"); - memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o); - o_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) { - LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TransactionNoneZ_free(_res_conv); -} - -static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) { - LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) { - LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = CResult_TransactionNoneZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) { LDKCVec_ChannelDetailsZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -19714,6 +21690,60 @@ void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_fre CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); } +uint64_t __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_ok"))) TS_CResult_BestBlockDecodeErrorZ_ok(uint64_t o) { + LDKBestBlock 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 = BestBlock_clone(&o_conv); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_err"))) TS_CResult_BestBlockDecodeErrorZ_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_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_is_ok"))) TS_CResult_BestBlockDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_BestBlockDecodeErrorZ* o_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BestBlockDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_free"))) TS_CResult_BestBlockDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_BestBlockDecodeErrorZ _res_conv = *(LDKCResult_BestBlockDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_BestBlockDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_BestBlockDecodeErrorZ_clone_ptr(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_clone_ptr"))) TS_CResult_BestBlockDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_BestBlockDecodeErrorZ* arg_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BestBlockDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_BestBlockDecodeErrorZ_clone"))) TS_CResult_BestBlockDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_BestBlockDecodeErrorZ* orig_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = CResult_BestBlockDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) { LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ"); *ret_conv = C2Tuple_usizeTransactionZ_clone(arg); @@ -19898,81 +21928,86 @@ void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_Monitor CVec_MonitorEventZ_free(_res_constr); } -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); +static inline uint64_t C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C4Tuple_OutPointChannelIdCVec_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); +int64_t __attribute__((export_name("TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C4Tuple_OutPointChannelIdCVec_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_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(orig_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) { +uint64_t __attribute__((export_name("TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_t b, uint64_tArray c, int8_tArray d) { 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"); + LDKChannelId 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 = ChannelId_clone(&b_conv); + LDKCVec_MonitorEventZ c_constr; + c_constr.datalen = c->arr_len; + if (c_constr.datalen > 0) + c_constr.data = MALLOC(c_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_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) { + c_constr.data = NULL; + uint64_t* c_vals = c->elems; + for (size_t o = 0; o < c_constr.datalen; o++) { + uint64_t c_conv_14 = c_vals[o]; + void* c_conv_14_ptr = untag_ptr(c_conv_14); + CHECK_ACCESS(c_conv_14_ptr); + LDKMonitorEvent c_conv_14_conv = *(LDKMonitorEvent*)(c_conv_14_ptr); + c_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(c_conv_14)); + c_constr.data[o] = c_conv_14_conv; + } + FREE(c); + LDKPublicKey d_ref; + CHECK(d->arr_len == 33); + memcpy(d_ref.compressed_form, d->elems, 33); FREE(d); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ"); + *ret_conv = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(a_conv, b_conv, c_constr, d_ref); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free"))) TS_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_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); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv); + C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_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; +void __attribute__((export_name("TS_CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) { + LDKCVec_C4Tuple_OutPointChannelIdCVec_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"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ), "LDKCVec_C4Tuple_OutPointChannelIdCVec_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; + for (size_t f = 0; f < _res_constr.datalen; f++) { + uint64_t _res_conv_57 = _res_vals[f]; + void* _res_conv_57_ptr = untag_ptr(_res_conv_57); + CHECK_ACCESS(_res_conv_57_ptr); + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res_conv_57_conv = *(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)(_res_conv_57_ptr); + FREE(untag_ptr(_res_conv_57)); + _res_constr.data[f] = _res_conv_57_conv; } FREE(_res); - CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr); + CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(_res_constr); } uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) { @@ -20353,6 +22388,225 @@ uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_ok"))) TS_CResult_OfferIdDecodeErrorZ_ok(uint64_t o) { + LDKOfferId 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 = OfferId_clone(&o_conv); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_err"))) TS_CResult_OfferIdDecodeErrorZ_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_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_is_ok"))) TS_CResult_OfferIdDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OfferIdDecodeErrorZ* o_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_free"))) TS_CResult_OfferIdDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferIdDecodeErrorZ _res_conv = *(LDKCResult_OfferIdDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferIdDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferIdDecodeErrorZ_clone_ptr(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_clone_ptr"))) TS_CResult_OfferIdDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OfferIdDecodeErrorZ* arg_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_OfferIdDecodeErrorZ_clone"))) TS_CResult_OfferIdDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_OfferIdDecodeErrorZ* orig_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = CResult_OfferIdDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_ok"))) TS_CResult_NoneBolt12SemanticErrorZ_ok() { + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_err"))) TS_CResult_NoneBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_is_ok"))) TS_CResult_NoneBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_free"))) TS_CResult_NoneBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_NoneBolt12SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_NoneBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_NoneBolt12SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_NoneBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_clone"))) TS_CResult_NoneBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_NoneBolt12SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_ok"))) TS_CResult_OfferBolt12SemanticErrorZ_ok(uint64_t o) { + LDKOffer 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 = Offer_clone(&o_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_err"))) TS_CResult_OfferBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_is_ok"))) TS_CResult_OfferBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_OfferBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_free"))) TS_CResult_OfferBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferBolt12SemanticErrorZ _res_conv = *(LDKCResult_OfferBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferBolt12SemanticErrorZ_clone_ptr(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_OfferBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OfferBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_OfferBolt12SemanticErrorZ_clone"))) TS_CResult_OfferBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_OfferBolt12SemanticErrorZ* orig_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok"))) TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(uint64_t o) { + LDKInvoiceRequestWithDerivedPayerIdBuilder 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 LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err"))) TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok"))) TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free"))) TS_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok"))) TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(uint64_t o) { + LDKInvoiceRequestWithExplicitPayerIdBuilder 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 LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err"))) TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok"))) TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free"))) TS_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(_res_conv); +} + uint64_t __attribute__((export_name("TS_CResult_OfferBolt12ParseErrorZ_ok"))) TS_CResult_OfferBolt12ParseErrorZ_ok(uint64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -20408,55 +22662,6 @@ uint64_t __attribute__((export_name("TS_CResult_OfferBolt12ParseErrorZ_clone")) return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_ok"))) TS_CResult_PublicKeySecp256k1ErrorZ_ok(int8_tArray o) { - LDKPublicKey o_ref; - CHECK(o->arr_len == 33); - memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_ok(o_ref); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_err"))) TS_CResult_PublicKeySecp256k1ErrorZ_err(uint32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_is_ok"))) TS_CResult_PublicKeySecp256k1ErrorZ_is_ok(uint64_t o) { - LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_free"))) TS_CResult_PublicKeySecp256k1ErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_PublicKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PublicKeySecp256k1ErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_PublicKeySecp256k1ErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_PublicKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_clone_ptr"))) TS_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_clone"))) TS_CResult_PublicKeySecp256k1ErrorZ_clone(uint64_t orig) { - LDKCResult_PublicKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = CResult_PublicKeySecp256k1ErrorZ_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); @@ -20511,6 +22716,55 @@ uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_ok"))) TS_CResult_PublicKeySecp256k1ErrorZ_ok(int8_tArray o) { + LDKPublicKey o_ref; + CHECK(o->arr_len == 33); + memcpy(o_ref.compressed_form, o->elems, 33); FREE(o); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_err"))) TS_CResult_PublicKeySecp256k1ErrorZ_err(uint32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_is_ok"))) TS_CResult_PublicKeySecp256k1ErrorZ_is_ok(uint64_t o) { + LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_free"))) TS_CResult_PublicKeySecp256k1ErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PublicKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PublicKeySecp256k1ErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PublicKeySecp256k1ErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_PublicKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR arg) { + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_clone_ptr"))) TS_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_PublicKeySecp256k1ErrorZ_clone"))) TS_CResult_PublicKeySecp256k1ErrorZ_clone(uint64_t orig) { + LDKCResult_PublicKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(orig); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = CResult_PublicKeySecp256k1ErrorZ_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); @@ -21296,6 +23550,34 @@ uint64_t __attribute__((export_name("TS_COption_CVec_SocketAddressZZ_clone"))) return ret_ref; } +uint64_t __attribute__((export_name("TS_CResult_u64ShortChannelIdErrorZ_ok"))) TS_CResult_u64ShortChannelIdErrorZ_ok(int64_t o) { + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = CResult_u64ShortChannelIdErrorZ_ok(o); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_u64ShortChannelIdErrorZ_err"))) TS_CResult_u64ShortChannelIdErrorZ_err(uint32_t e) { + LDKShortChannelIdError e_conv = LDKShortChannelIdError_from_js(e); + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = CResult_u64ShortChannelIdErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_u64ShortChannelIdErrorZ_is_ok"))) TS_CResult_u64ShortChannelIdErrorZ_is_ok(uint64_t o) { + LDKCResult_u64ShortChannelIdErrorZ* o_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_u64ShortChannelIdErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_u64ShortChannelIdErrorZ_free"))) TS_CResult_u64ShortChannelIdErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_u64ShortChannelIdErrorZ _res_conv = *(LDKCResult_u64ShortChannelIdErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_u64ShortChannelIdErrorZ_free(_res_conv); +} + uint64_t __attribute__((export_name("TS_CResult_PendingHTLCInfoInboundHTLCErrZ_ok"))) TS_CResult_PendingHTLCInfoInboundHTLCErrZ_ok(uint64_t o) { LDKPendingHTLCInfo o_conv; o_conv.inner = untag_ptr(o); @@ -21312,8 +23594,7 @@ uint64_t __attribute__((export_name("TS_CResult_PendingHTLCInfoInboundHTLCErrZ_ e_conv.inner = untag_ptr(e); e_conv.is_owned = ptr_is_owned(e); CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - // WARNING: we need a move here but no clone is available for LDKInboundHTLCErr - + e_conv = InboundHTLCErr_clone(&e_conv); LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_err(e_conv); return tag_ptr(ret_conv, true); @@ -21334,6 +23615,24 @@ void __attribute__((export_name("TS_CResult_PendingHTLCInfoInboundHTLCErrZ_free CResult_PendingHTLCInfoInboundHTLCErrZ_free(_res_conv); } +static inline uint64_t CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR arg) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr"))) TS_CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(uint64_t arg) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* arg_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_PendingHTLCInfoInboundHTLCErrZ_clone"))) TS_CResult_PendingHTLCInfoInboundHTLCErrZ_clone(uint64_t orig) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* orig_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(orig); + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + void __attribute__((export_name("TS_CVec_HTLCOutputInCommitmentZ_free"))) TS_CVec_HTLCOutputInCommitmentZ_free(uint64_tArray _res) { LDKCVec_HTLCOutputInCommitmentZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -21573,6 +23872,53 @@ uint64_t __attribute__((export_name("TS_CResult_CVec_UtxoZNoneZ_clone"))) TS_CR return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_COption_PaymentContextZ_some"))) TS_COption_PaymentContextZ_some(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); + o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_PaymentContextZ_none"))) TS_COption_PaymentContextZ_none() { + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_PaymentContextZ_free"))) TS_COption_PaymentContextZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_PaymentContextZ _res_conv = *(LDKCOption_PaymentContextZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_PaymentContextZ_free(_res_conv); +} + +static inline uint64_t COption_PaymentContextZ_clone_ptr(LDKCOption_PaymentContextZ *NONNULL_PTR arg) { + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_PaymentContextZ_clone_ptr"))) TS_COption_PaymentContextZ_clone_ptr(uint64_t arg) { + LDKCOption_PaymentContextZ* arg_conv = (LDKCOption_PaymentContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentContextZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_PaymentContextZ_clone"))) TS_COption_PaymentContextZ_clone(uint64_t orig) { + LDKCOption_PaymentContextZ* orig_conv = (LDKCOption_PaymentContextZ*)untag_ptr(orig); + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + static inline uint64_t C2Tuple_u64u16Z_clone_ptr(LDKC2Tuple_u64u16Z *NONNULL_PTR arg) { LDKC2Tuple_u64u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u16Z), "LDKC2Tuple_u64u16Z"); *ret_conv = C2Tuple_u64u16Z_clone(arg); @@ -21653,99 +23999,57 @@ uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u16ZZ_clone"))) TS_C return ret_ref; } -uint64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_some"))) TS_COption_ChannelShutdownStateZ_some(uint32_t o) { - LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_js(o); - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_some(o_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_none"))) TS_COption_ChannelShutdownStateZ_none() { - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_none(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_COption_ChannelShutdownStateZ_free"))) TS_COption_ChannelShutdownStateZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_ChannelShutdownStateZ _res_conv = *(LDKCOption_ChannelShutdownStateZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_ChannelShutdownStateZ_free(_res_conv); -} - -static inline uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg) { - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_clone_ptr"))) TS_COption_ChannelShutdownStateZ_clone_ptr(uint64_t arg) { - LDKCOption_ChannelShutdownStateZ* arg_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(arg); - int64_t ret_conv = COption_ChannelShutdownStateZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_clone"))) TS_COption_ChannelShutdownStateZ_clone(uint64_t orig) { - LDKCOption_ChannelShutdownStateZ* orig_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(orig); - LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = COption_ChannelShutdownStateZ_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_ok"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_ok(int8_tArray o) { - LDKThirtyTwoBytes o_ref; - CHECK(o->arr_len == 32); - memcpy(o_ref.data, o->elems, 32); FREE(o); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_ok(o_ref); +uint64_t __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_ok"))) TS_CResult_ChannelIdAPIErrorZ_ok(uint64_t o) { + LDKChannelId 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 = ChannelId_clone(&o_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_err"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_err"))) TS_CResult_ChannelIdAPIErrorZ_err(uint64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_err(e_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_is_ok"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(uint64_t o) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_is_ok"))) TS_CResult_ChannelIdAPIErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelIdAPIErrorZ* o_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdAPIErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_free"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_free"))) TS_CResult_ChannelIdAPIErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ThirtyTwoBytesAPIErrorZ _res_conv = *(LDKCResult_ThirtyTwoBytesAPIErrorZ*)(_res_ptr); + LDKCResult_ChannelIdAPIErrorZ _res_conv = *(LDKCResult_ChannelIdAPIErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ThirtyTwoBytesAPIErrorZ_free(_res_conv); + CResult_ChannelIdAPIErrorZ_free(_res_conv); } -static inline uint64_t CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR arg) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(arg); +static inline uint64_t CResult_ChannelIdAPIErrorZ_clone_ptr(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_clone_ptr"))) TS_CResult_ChannelIdAPIErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelIdAPIErrorZ* arg_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_clone"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_clone(uint64_t orig) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* orig_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(orig); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelIdAPIErrorZ_clone"))) TS_CResult_ChannelIdAPIErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelIdAPIErrorZ* orig_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(orig); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = CResult_ChannelIdAPIErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } @@ -22142,63 +24446,136 @@ uint64_t __attribute__((export_name("TS_CResult_CVec_C2Tuple_ThirtyTwoBytesThir return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR arg) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKC2Tuple_ThirtyTwoBytesPublicKeyZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(arg); +static inline uint64_t C2Tuple_ChannelIdPublicKeyZ_clone_ptr(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR arg) { + LDKC2Tuple_ChannelIdPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKC2Tuple_ChannelIdPublicKeyZ"); + *ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr"))) TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(uint64_t arg) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* arg_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_C2Tuple_ChannelIdPublicKeyZ_clone_ptr"))) TS_C2Tuple_ChannelIdPublicKeyZ_clone_ptr(uint64_t arg) { + LDKC2Tuple_ChannelIdPublicKeyZ* arg_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone"))) TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(uint64_t orig) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* orig_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(orig); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKC2Tuple_ThirtyTwoBytesPublicKeyZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_C2Tuple_ChannelIdPublicKeyZ_clone"))) TS_C2Tuple_ChannelIdPublicKeyZ_clone(uint64_t orig) { + LDKC2Tuple_ChannelIdPublicKeyZ* orig_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(orig); + LDKC2Tuple_ChannelIdPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKC2Tuple_ChannelIdPublicKeyZ"); + *ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_new"))) TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_new(int8_tArray a, int8_tArray b) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); +uint64_t __attribute__((export_name("TS_C2Tuple_ChannelIdPublicKeyZ_new"))) TS_C2Tuple_ChannelIdPublicKeyZ_new(uint64_t a, int8_tArray b) { + LDKChannelId 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 = ChannelId_clone(&a_conv); LDKPublicKey b_ref; CHECK(b->arr_len == 33); memcpy(b_ref.compressed_form, b->elems, 33); FREE(b); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKC2Tuple_ThirtyTwoBytesPublicKeyZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_new(a_ref, b_ref); + LDKC2Tuple_ChannelIdPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKC2Tuple_ChannelIdPublicKeyZ"); + *ret_conv = C2Tuple_ChannelIdPublicKeyZ_new(a_conv, b_ref); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_free"))) TS_C2Tuple_ThirtyTwoBytesPublicKeyZ_free(uint64_t _res) { +void __attribute__((export_name("TS_C2Tuple_ChannelIdPublicKeyZ_free"))) TS_C2Tuple_ChannelIdPublicKeyZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res_conv = *(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)(_res_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ _res_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_ThirtyTwoBytesPublicKeyZ_free(_res_conv); + C2Tuple_ChannelIdPublicKeyZ_free(_res_conv); } -void __attribute__((export_name("TS_CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free"))) TS_CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(uint64_tArray _res) { - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res_constr; +void __attribute__((export_name("TS_CVec_C2Tuple_ChannelIdPublicKeyZZ_free"))) TS_CVec_C2Tuple_ChannelIdPublicKeyZZ_free(uint64_tArray _res) { + LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); else _res_constr.data = NULL; uint64_t* _res_vals = _res->elems; - for (size_t j = 0; j < _res_constr.datalen; j++) { - uint64_t _res_conv_35 = _res_vals[j]; - void* _res_conv_35_ptr = untag_ptr(_res_conv_35); - CHECK_ACCESS(_res_conv_35_ptr); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res_conv_35_conv = *(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)(_res_conv_35_ptr); - FREE(untag_ptr(_res_conv_35)); - _res_constr.data[j] = _res_conv_35_conv; + for (size_t e = 0; e < _res_constr.datalen; e++) { + uint64_t _res_conv_30 = _res_vals[e]; + void* _res_conv_30_ptr = untag_ptr(_res_conv_30); + CHECK_ACCESS(_res_conv_30_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ _res_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(_res_conv_30_ptr); + FREE(untag_ptr(_res_conv_30)); + _res_constr.data[e] = _res_conv_30_conv; } FREE(_res); - CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(_res_constr); + CVec_C2Tuple_ChannelIdPublicKeyZZ_free(_res_constr); +} + +void __attribute__((export_name("TS_CVec_ChannelIdZ_free"))) TS_CVec_ChannelIdZ_free(uint64_tArray _res) { + LDKCVec_ChannelIdZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ 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]; + LDKChannelId _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_ChannelIdZ_free(_res_constr); +} + +uint64_t __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(uint64_t o) { + LDKOfferWithDerivedMetadataBuilder 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 = OfferWithDerivedMetadataBuilder_clone(&o_conv); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone"))) TS_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* orig_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } uint64_t __attribute__((export_name("TS_COption_StrZ_some"))) TS_COption_StrZ_some(jstring o) { @@ -22245,52 +24622,6 @@ uint64_t __attribute__((export_name("TS_COption_StrZ_clone"))) TS_COption_StrZ_ return ret_ref; } -uint64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_ok"))) TS_CResult_NoneBolt12SemanticErrorZ_ok() { - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_err"))) TS_CResult_NoneBolt12SemanticErrorZ_err(uint32_t e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_is_ok"))) TS_CResult_NoneBolt12SemanticErrorZ_is_ok(uint64_t o) { - LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_free"))) TS_CResult_NoneBolt12SemanticErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_NoneBolt12SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt12SemanticErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_NoneBolt12SemanticErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_NoneBolt12SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_NoneBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_NoneBolt12SemanticErrorZ_clone"))) TS_CResult_NoneBolt12SemanticErrorZ_clone(uint64_t orig) { - LDKCResult_NoneBolt12SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(orig); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - uint64_t __attribute__((export_name("TS_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok"))) TS_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -22340,6 +24671,58 @@ uint64_t __attribute__((export_name("TS_CResult_C2Tuple_ThirtyTwoBytesThirtyTwo return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_ok"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_ok(int8_tArray o) { + LDKThirtyTwoBytes o_ref; + CHECK(o->arr_len == 32); + memcpy(o_ref.data, o->elems, 32); FREE(o); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_ok(o_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_err"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_err(uint64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKAPIError e_conv = *(LDKAPIError*)(e_ptr); + e_conv = APIError_clone((LDKAPIError*)untag_ptr(e)); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_is_ok"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(uint64_t o) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_free"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ThirtyTwoBytesAPIErrorZ _res_conv = *(LDKCResult_ThirtyTwoBytesAPIErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ThirtyTwoBytesAPIErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR arg) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_ThirtyTwoBytesAPIErrorZ_clone"))) TS_CResult_ThirtyTwoBytesAPIErrorZ_clone(uint64_t orig) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* orig_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(orig); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_COption_OffersMessageZ_some"))) TS_COption_OffersMessageZ_some(uint64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -22453,168 +24836,6 @@ void __attribute__((export_name("TS_CVec_C3Tuple_OffersMessageDestinationBlinde CVec_C3Tuple_OffersMessageDestinationBlindedPathZZ_free(_res_constr); } -uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) { - LDKCounterpartyForwardingInfo 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 = CounterpartyForwardingInfo_clone(&o_conv); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_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_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) { - LDKChannelCounterparty 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 = ChannelCounterparty_clone(&o_conv); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_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_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) { - LDKChannelDetails 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 = ChannelDetails_clone(&o_conv); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_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_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_ok(uint64_t o) { LDKPhantomRouteHints o_conv; o_conv.inner = untag_ptr(o); @@ -22880,56 +25101,6 @@ uint64_t __attribute__((export_name("TS_CResult_BlindedFailureDecodeErrorZ_clon return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_ok"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_ok(uint32_t o) { - LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_js(o); - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_err"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_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_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_is_ok"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* o_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_free"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelShutdownStateDecodeErrorZ _res_conv = *(LDKCResult_ChannelShutdownStateDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* arg_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_clone"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelShutdownStateDecodeErrorZ* orig_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint64_tArray _res) { LDKCVec_ChannelMonitorZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -23662,27 +25833,6 @@ void __attribute__((export_name("TS_CVec_CommitmentTransactionZ_free"))) TS_CVe CVec_CommitmentTransactionZ_free(_res_constr); } -void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) { - LDKCVec_TransactionZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ 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]; - LDKTransaction _res_conv_12_ref; - _res_conv_12_ref.datalen = _res_conv_12->arr_len; - _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12); - _res_conv_12_ref.data_is_owned = true; - _res_constr.data[m] = _res_conv_12_ref; - } - FREE(_res); - CVec_TransactionZ_free(_res_constr); -} - static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) { LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ"); *ret_conv = C2Tuple_u32TxOutZ_clone(arg); @@ -24383,64 +26533,24 @@ uint64_t __attribute__((export_name("TS_COption_SocketAddressZ_clone"))) TS_COp return ret_ref; } -static inline uint64_t C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR arg) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr"))) TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(uint64_t arg) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* arg_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone"))) TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(uint64_t orig) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* orig_conv = (LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)untag_ptr(orig); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_new"))) TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_new(int8_tArray a, uint64_t b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - void* b_ptr = untag_ptr(b); - CHECK_ACCESS(b_ptr); - LDKCOption_SocketAddressZ b_conv = *(LDKCOption_SocketAddressZ*)(b_ptr); - b_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(b)); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv = C2Tuple_PublicKeyCOption_SocketAddressZZ_new(a_ref, b_conv); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_free"))) TS_C2Tuple_PublicKeyCOption_SocketAddressZZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res_conv = *(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)(_res_ptr); - FREE(untag_ptr(_res)); - C2Tuple_PublicKeyCOption_SocketAddressZZ_free(_res_conv); -} - -void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free"))) TS_CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(uint64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res_constr; +void __attribute__((export_name("TS_CVec_PeerDetailsZ_free"))) TS_CVec_PeerDetailsZ_free(uint64_tArray _res) { + LDKCVec_PeerDetailsZ _res_constr; _res_constr.datalen = _res->arr_len; if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPeerDetails), "LDKCVec_PeerDetailsZ Elements"); else _res_constr.data = NULL; uint64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - uint64_t _res_conv_43 = _res_vals[r]; - void* _res_conv_43_ptr = untag_ptr(_res_conv_43); - CHECK_ACCESS(_res_conv_43_ptr); - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res_conv_43_conv = *(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ*)(_res_conv_43_ptr); - FREE(untag_ptr(_res_conv_43)); - _res_constr.data[r] = _res_conv_43_conv; + for (size_t n = 0; n < _res_constr.datalen; n++) { + uint64_t _res_conv_13 = _res_vals[n]; + LDKPeerDetails _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_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(_res_constr); + CVec_PeerDetailsZ_free(_res_constr); } uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) { @@ -24932,6 +27042,108 @@ uint64_t __attribute__((export_name("TS_CResult_C2Tuple_ThirtyTwoBytesChannelMo return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(uint64_t o) { + LDKUnsignedInvoiceRequest 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 = UnsignedInvoiceRequest_clone(&o_conv); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res_conv = *(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone"))) TS_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* orig_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_ok"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_ok(uint64_t o) { + LDKInvoiceRequest 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 = InvoiceRequest_clone(&o_conv); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_err"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_free"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestBolt12SemanticErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestBolt12SemanticErrorZ_clone"))) TS_CResult_InvoiceRequestBolt12SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* orig_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + uint64_t __attribute__((export_name("TS_COption_SecretKeyZ_some"))) TS_COption_SecretKeyZ_some(int8_tArray o) { LDKSecretKey o_ref; CHECK(o->arr_len == 32); @@ -24978,6 +27190,40 @@ uint64_t __attribute__((export_name("TS_COption_SecretKeyZ_clone"))) TS_COption return ret_ref; } +uint64_t __attribute__((export_name("TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok"))) TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(uint64_t o) { + LDKInvoiceWithExplicitSigningPubkeyBuilder 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 LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err"))) TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok"))) TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free"))) TS_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); +} + uint64_t __attribute__((export_name("TS_CResult_VerifiedInvoiceRequestNoneZ_ok"))) TS_CResult_VerifiedInvoiceRequestNoneZ_ok(uint64_t o) { LDKVerifiedInvoiceRequest o_conv; o_conv.inner = untag_ptr(o); @@ -25028,6 +27274,94 @@ uint64_t __attribute__((export_name("TS_CResult_VerifiedInvoiceRequestNoneZ_clo return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok"))) TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(uint64_t o) { + LDKInvoiceWithDerivedSigningPubkeyBuilder 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 LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err"))) TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(uint32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_js(e); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok"))) TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free"))) TS_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res_conv = *(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(_res_conv); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_ok"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_ok(uint64_t o) { + LDKInvoiceRequestFields 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 = InvoiceRequestFields_clone(&o_conv); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_err"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_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_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_free"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res_conv = *(LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceRequestFieldsDecodeErrorZ_free(_res_conv); +} + +static inline uint64_t CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_InvoiceRequestFieldsDecodeErrorZ_clone"))) TS_CResult_InvoiceRequestFieldsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* orig_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); +} + uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() { uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some()); return ret_conv; @@ -25064,6 +27398,52 @@ void __attribute__((export_name("TS_CVec_WitnessZ_free"))) TS_CVec_WitnessZ_fre CVec_WitnessZ_free(_res_constr); } +uint64_t __attribute__((export_name("TS_COption_ECDSASignatureZ_some"))) TS_COption_ECDSASignatureZ_some(int8_tArray o) { + LDKECDSASignature o_ref; + CHECK(o->arr_len == 64); + memcpy(o_ref.compact_form, o->elems, 64); FREE(o); + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_some(o_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_COption_ECDSASignatureZ_none"))) TS_COption_ECDSASignatureZ_none() { + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_COption_ECDSASignatureZ_free"))) TS_COption_ECDSASignatureZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_ECDSASignatureZ _res_conv = *(LDKCOption_ECDSASignatureZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_ECDSASignatureZ_free(_res_conv); +} + +static inline uint64_t COption_ECDSASignatureZ_clone_ptr(LDKCOption_ECDSASignatureZ *NONNULL_PTR arg) { + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_COption_ECDSASignatureZ_clone_ptr"))) TS_COption_ECDSASignatureZ_clone_ptr(uint64_t arg) { + LDKCOption_ECDSASignatureZ* arg_conv = (LDKCOption_ECDSASignatureZ*)untag_ptr(arg); + int64_t ret_conv = COption_ECDSASignatureZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_COption_ECDSASignatureZ_clone"))) TS_COption_ECDSASignatureZ_clone(uint64_t orig) { + LDKCOption_ECDSASignatureZ* orig_conv = (LDKCOption_ECDSASignatureZ*)untag_ptr(orig); + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint64_t __attribute__((export_name("TS_COption_i64Z_some"))) TS_COption_i64Z_some(int64_t o) { LDKCOption_i64Z *ret_copy = MALLOC(sizeof(LDKCOption_i64Z), "LDKCOption_i64Z"); *ret_copy = COption_i64Z_some(o); @@ -28118,6438 +30498,6024 @@ uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceSignOrCreationErro return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_ok"))) TS_CResult_OffersMessageDecodeErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKOffersMessage o_conv = *(LDKOffersMessage*)(o_ptr); - o_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(o)); - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_err"))) TS_CResult_OffersMessageDecodeErrorZ_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_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_InboundHTLCStateDetailsZ_some"))) TS_COption_InboundHTLCStateDetailsZ_some(uint32_t o) { + LDKInboundHTLCStateDetails o_conv = LDKInboundHTLCStateDetails_from_js(o); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_is_ok"))) TS_CResult_OffersMessageDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_OffersMessageDecodeErrorZ* o_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OffersMessageDecodeErrorZ_is_ok(o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_COption_InboundHTLCStateDetailsZ_none"))) TS_COption_InboundHTLCStateDetailsZ_none() { + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_free"))) TS_CResult_OffersMessageDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_InboundHTLCStateDetailsZ_free"))) TS_COption_InboundHTLCStateDetailsZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_OffersMessageDecodeErrorZ _res_conv = *(LDKCResult_OffersMessageDecodeErrorZ*)(_res_ptr); + LDKCOption_InboundHTLCStateDetailsZ _res_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OffersMessageDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_clone_ptr"))) TS_CResult_OffersMessageDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_OffersMessageDecodeErrorZ* arg_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OffersMessageDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_clone"))) TS_CResult_OffersMessageDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_OffersMessageDecodeErrorZ* orig_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); - *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + COption_InboundHTLCStateDetailsZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_COption_HTLCClaimZ_some"))) TS_COption_HTLCClaimZ_some(uint32_t o) { - LDKHTLCClaim o_conv = LDKHTLCClaim_from_js(o); - LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); - *ret_copy = COption_HTLCClaimZ_some(o_conv); +static inline uint64_t COption_InboundHTLCStateDetailsZ_clone_ptr(LDKCOption_InboundHTLCStateDetailsZ *NONNULL_PTR arg) { + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_clone(arg); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } +int64_t __attribute__((export_name("TS_COption_InboundHTLCStateDetailsZ_clone_ptr"))) TS_COption_InboundHTLCStateDetailsZ_clone_ptr(uint64_t arg) { + LDKCOption_InboundHTLCStateDetailsZ* arg_conv = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(arg); + int64_t ret_conv = COption_InboundHTLCStateDetailsZ_clone_ptr(arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_COption_HTLCClaimZ_none"))) TS_COption_HTLCClaimZ_none() { - LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); - *ret_copy = COption_HTLCClaimZ_none(); +uint64_t __attribute__((export_name("TS_COption_InboundHTLCStateDetailsZ_clone"))) TS_COption_InboundHTLCStateDetailsZ_clone(uint64_t orig) { + LDKCOption_InboundHTLCStateDetailsZ* orig_conv = (LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(orig); + LDKCOption_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = COption_InboundHTLCStateDetailsZ_clone(orig_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_COption_HTLCClaimZ_free"))) TS_COption_HTLCClaimZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); - FREE(untag_ptr(_res)); - COption_HTLCClaimZ_free(_res_conv); -} - -uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) { - LDKCounterpartyCommitmentSecrets 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 = CounterpartyCommitmentSecrets_clone(&o_conv); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_InboundHTLCStateDetailsZ o_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(o_ptr); + o_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(o)); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_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_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* o_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv); + CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* arg_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); - *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone"))) TS_CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* orig_conv = (LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_InboundHTLCStateDetailsZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) { - LDKTxCreationKeys o_conv; +uint64_t __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_ok"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_ok(uint64_t o) { + LDKInboundHTLCDetails o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = TxCreationKeys_clone(&o_conv); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); + o_conv = InboundHTLCDetails_clone(&o_conv); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_err"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_err(uint64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_is_ok"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* o_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_free"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); + LDKCResult_InboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_InboundHTLCDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); + CResult_InboundHTLCDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); +static inline uint64_t CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_InboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* arg_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); - *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) { - LDKChannelPublicKeys o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ChannelPublicKeys_clone(&o_conv); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_InboundHTLCDetailsDecodeErrorZ_clone"))) TS_CResult_InboundHTLCDetailsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_InboundHTLCDetailsDecodeErrorZ* orig_conv = (LDKCResult_InboundHTLCDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_InboundHTLCDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); - e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_OutboundHTLCStateDetailsZ_some"))) TS_COption_OutboundHTLCStateDetailsZ_some(uint32_t o) { + LDKOutboundHTLCStateDetails o_conv = LDKOutboundHTLCStateDetails_from_js(o); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_COption_OutboundHTLCStateDetailsZ_none"))) TS_COption_OutboundHTLCStateDetailsZ_none() { + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_OutboundHTLCStateDetailsZ_free"))) TS_COption_OutboundHTLCStateDetailsZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); + LDKCOption_OutboundHTLCStateDetailsZ _res_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); + COption_OutboundHTLCStateDetailsZ_free(_res_conv); } -static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_OutboundHTLCStateDetailsZ_clone_ptr(LDKCOption_OutboundHTLCStateDetailsZ *NONNULL_PTR arg) { + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_COption_OutboundHTLCStateDetailsZ_clone_ptr"))) TS_COption_OutboundHTLCStateDetailsZ_clone_ptr(uint64_t arg) { + LDKCOption_OutboundHTLCStateDetailsZ* arg_conv = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(arg); + int64_t ret_conv = COption_OutboundHTLCStateDetailsZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); - *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_OutboundHTLCStateDetailsZ_clone"))) TS_COption_OutboundHTLCStateDetailsZ_clone(uint64_t orig) { + LDKCOption_OutboundHTLCStateDetailsZ* orig_conv = (LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(orig); + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = COption_OutboundHTLCStateDetailsZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) { - LDKHTLCOutputInCommitment 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 = HTLCOutputInCommitment_clone(&o_conv); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_OutboundHTLCStateDetailsZ o_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(o_ptr); + o_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(o)); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_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_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* o_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ _res_conv = *(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); + CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); +static inline uint64_t CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* arg_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); - *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone"))) TS_CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* orig_conv = (LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ*)untag_ptr(orig); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = CResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) { - LDKCounterpartyChannelTransactionParameters o_conv; +uint64_t __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_ok"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_ok(uint64_t o) { + LDKOutboundHTLCDetails 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 = CounterpartyChannelTransactionParameters_clone(&o_conv); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv); + o_conv = OutboundHTLCDetails_clone(&o_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_err"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* o_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_free"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ _res_conv = *(LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv); + CResult_OutboundHTLCDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); +static inline uint64_t CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(LDKCResult_OutboundHTLCDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* arg_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_OutboundHTLCDetailsDecodeErrorZ_clone"))) TS_CResult_OutboundHTLCDetailsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* orig_conv = (LDKCResult_OutboundHTLCDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = CResult_OutboundHTLCDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) { - LDKChannelTransactionParameters o_conv; +uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) { + LDKCounterpartyForwardingInfo 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 = ChannelTransactionParameters_clone(&o_conv); - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv); + o_conv = CounterpartyForwardingInfo_clone(&o_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv); + CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); - *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) { - LDKHolderCommitmentTransaction o_conv; +uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) { + LDKChannelCounterparty 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 = HolderCommitmentTransaction_clone(&o_conv); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); + o_conv = ChannelCounterparty_clone(&o_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv); + CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) { - LDKBuiltCommitmentTransaction 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 = BuiltCommitmentTransaction_clone(&o_conv); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_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_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_some"))) TS_COption_ChannelShutdownStateZ_some(uint32_t o) { + LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_js(o); + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_none"))) TS_COption_ChannelShutdownStateZ_none() { + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_ChannelShutdownStateZ_free"))) TS_COption_ChannelShutdownStateZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCOption_ChannelShutdownStateZ _res_conv = *(LDKCOption_ChannelShutdownStateZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv); + COption_ChannelShutdownStateZ_free(_res_conv); } -static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +static inline uint64_t COption_ChannelShutdownStateZ_clone_ptr(LDKCOption_ChannelShutdownStateZ *NONNULL_PTR arg) { + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_clone_ptr"))) TS_COption_ChannelShutdownStateZ_clone_ptr(uint64_t arg) { + LDKCOption_ChannelShutdownStateZ* arg_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(arg); + int64_t ret_conv = COption_ChannelShutdownStateZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) { - LDKTrustedClosingTransaction 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 LDKTrustedClosingTransaction - - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() { - LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); - *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_ChannelShutdownStateZ_clone"))) TS_COption_ChannelShutdownStateZ_clone(uint64_t orig) { + LDKCOption_ChannelShutdownStateZ* orig_conv = (LDKCOption_ChannelShutdownStateZ*)untag_ptr(orig); + LDKCOption_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = COption_ChannelShutdownStateZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) { - LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); - return ret_conv; +void __attribute__((export_name("TS_CVec_InboundHTLCDetailsZ_free"))) TS_CVec_InboundHTLCDetailsZ_free(uint64_tArray _res) { + LDKCVec_InboundHTLCDetailsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t u = 0; u < _res_constr.datalen; u++) { + uint64_t _res_conv_20 = _res_vals[u]; + LDKInboundHTLCDetails _res_conv_20_conv; + _res_conv_20_conv.inner = untag_ptr(_res_conv_20); + _res_conv_20_conv.is_owned = ptr_is_owned(_res_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_20_conv); + _res_constr.data[u] = _res_conv_20_conv; + } + FREE(_res); + CVec_InboundHTLCDetailsZ_free(_res_constr); } -void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_TrustedClosingTransactionNoneZ_free(_res_conv); +void __attribute__((export_name("TS_CVec_OutboundHTLCDetailsZ_free"))) TS_CVec_OutboundHTLCDetailsZ_free(uint64_tArray _res) { + LDKCVec_OutboundHTLCDetailsZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t v = 0; v < _res_constr.datalen; v++) { + uint64_t _res_conv_21 = _res_vals[v]; + LDKOutboundHTLCDetails _res_conv_21_conv; + _res_conv_21_conv.inner = untag_ptr(_res_conv_21); + _res_conv_21_conv.is_owned = ptr_is_owned(_res_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_21_conv); + _res_constr.data[v] = _res_conv_21_conv; + } + FREE(_res); + CVec_OutboundHTLCDetailsZ_free(_res_constr); } -uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) { - LDKCommitmentTransaction o_conv; +uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) { + LDKChannelDetails 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 = CommitmentTransaction_clone(&o_conv); - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv); + o_conv = ChannelDetails_clone(&o_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv); + CResult_ChannelDetailsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig); - LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); - *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) { - LDKTrustedCommitmentTransaction 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 LDKTrustedCommitmentTransaction - - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_ok"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_ok(uint32_t o) { + LDKChannelShutdownState o_conv = LDKChannelShutdownState_from_js(o); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() { - LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); - *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); +uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_err"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_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_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) { - LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_is_ok"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* o_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_free"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); + LDKCResult_ChannelShutdownStateDecodeErrorZ _res_conv = *(LDKCResult_ChannelShutdownStateDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); + CResult_ChannelShutdownStateDecodeErrorZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_ok"))) TS_CResult_CVec_ECDSASignatureZNoneZ_ok(ptrArray o) { - LDKCVec_ECDSASignatureZ o_constr; - o_constr.datalen = o->arr_len; - if (o_constr.datalen > 0) - o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); - else - o_constr.data = NULL; - int8_tArray* o_vals = (void*) o->elems; - for (size_t m = 0; m < o_constr.datalen; m++) { - int8_tArray o_conv_12 = o_vals[m]; - LDKECDSASignature o_conv_12_ref; - CHECK(o_conv_12->arr_len == 64); - memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12); - o_constr.data[m] = o_conv_12_ref; - } - FREE(o); - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_ok(o_constr); +static inline uint64_t CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(LDKCResult_ChannelShutdownStateDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* arg_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_err"))) TS_CResult_CVec_ECDSASignatureZNoneZ_err() { - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_err(); +uint64_t __attribute__((export_name("TS_CResult_ChannelShutdownStateDecodeErrorZ_clone"))) TS_CResult_ChannelShutdownStateDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelShutdownStateDecodeErrorZ* orig_conv = (LDKCResult_ChannelShutdownStateDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = CResult_ChannelShutdownStateDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_is_ok"))) TS_CResult_CVec_ECDSASignatureZNoneZ_is_ok(uint64_t o) { - LDKCResult_CVec_ECDSASignatureZNoneZ* o_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_CVec_ECDSASignatureZNoneZ_is_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_ok"))) TS_CResult_OffersMessageDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOffersMessage o_conv = *(LDKOffersMessage*)(o_ptr); + o_conv = OffersMessage_clone((LDKOffersMessage*)untag_ptr(o)); + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_err"))) TS_CResult_OffersMessageDecodeErrorZ_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_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_is_ok"))) TS_CResult_OffersMessageDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OffersMessageDecodeErrorZ* o_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OffersMessageDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_free"))) TS_CResult_CVec_ECDSASignatureZNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_free"))) TS_CResult_OffersMessageDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_CVec_ECDSASignatureZNoneZ _res_conv = *(LDKCResult_CVec_ECDSASignatureZNoneZ*)(_res_ptr); + LDKCResult_OffersMessageDecodeErrorZ _res_conv = *(LDKCResult_OffersMessageDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_CVec_ECDSASignatureZNoneZ_free(_res_conv); + CResult_OffersMessageDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR arg) { - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(arg); +static inline uint64_t CResult_OffersMessageDecodeErrorZ_clone_ptr(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(uint64_t arg) { - LDKCResult_CVec_ECDSASignatureZNoneZ* arg_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_clone_ptr"))) TS_CResult_OffersMessageDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OffersMessageDecodeErrorZ* arg_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OffersMessageDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_clone"))) TS_CResult_CVec_ECDSASignatureZNoneZ_clone(uint64_t orig) { - LDKCResult_CVec_ECDSASignatureZNoneZ* orig_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(orig); - LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); - *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_OffersMessageDecodeErrorZ_clone"))) TS_CResult_OffersMessageDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_OffersMessageDecodeErrorZ* orig_conv = (LDKCResult_OffersMessageDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OffersMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OffersMessageDecodeErrorZ), "LDKCResult_OffersMessageDecodeErrorZ"); + *ret_conv = CResult_OffersMessageDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_COption_usizeZ_some"))) TS_COption_usizeZ_some(uint32_t o) { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_some(o); +uint64_t __attribute__((export_name("TS_COption_HTLCClaimZ_some"))) TS_COption_HTLCClaimZ_some(uint32_t o) { + LDKHTLCClaim o_conv = LDKHTLCClaim_from_js(o); + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_some(o_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_COption_usizeZ_none"))) TS_COption_usizeZ_none() { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_none(); +uint64_t __attribute__((export_name("TS_COption_HTLCClaimZ_none"))) TS_COption_HTLCClaimZ_none() { + LDKCOption_HTLCClaimZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCClaimZ), "LDKCOption_HTLCClaimZ"); + *ret_copy = COption_HTLCClaimZ_none(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_COption_usizeZ_free"))) TS_COption_usizeZ_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_HTLCClaimZ_free"))) TS_COption_HTLCClaimZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_usizeZ _res_conv = *(LDKCOption_usizeZ*)(_res_ptr); + LDKCOption_HTLCClaimZ _res_conv = *(LDKCOption_HTLCClaimZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_usizeZ_free(_res_conv); -} - -static inline uint64_t COption_usizeZ_clone_ptr(LDKCOption_usizeZ *NONNULL_PTR arg) { - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_COption_usizeZ_clone_ptr"))) TS_COption_usizeZ_clone_ptr(uint64_t arg) { - LDKCOption_usizeZ* arg_conv = (LDKCOption_usizeZ*)untag_ptr(arg); - int64_t ret_conv = COption_usizeZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_COption_usizeZ_clone"))) TS_COption_usizeZ_clone(uint64_t orig) { - LDKCOption_usizeZ* orig_conv = (LDKCOption_usizeZ*)untag_ptr(orig); - LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); - *ret_copy = COption_usizeZ_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + COption_HTLCClaimZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) { - LDKShutdownScript o_conv; +uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) { + LDKCounterpartyCommitmentSecrets 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 = ShutdownScript_clone(&o_conv); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv); + o_conv = CounterpartyCommitmentSecrets_clone(&o_conv); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_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_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); + CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); +static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); - *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ"); + *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) { - LDKShutdownScript o_conv; +uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) { + LDKTxCreationKeys o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = ShutdownScript_clone(&o_conv); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv); + o_conv = TxCreationKeys_clone(&o_conv); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) { - LDKInvalidShutdownScript e_conv; - e_conv.inner = untag_ptr(e); - e_conv.is_owned = ptr_is_owned(e); - CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); - e_conv = InvalidShutdownScript_clone(&e_conv); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o); - jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); + LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv); + CResult_TxCreationKeysDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg); +static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) { - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig); - LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); - *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ"); + *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_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); +uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) { + LDKChannelPublicKeys o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = ChannelPublicKeys_clone(&o_conv); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentPurposeDecodeErrorZ_free(_res_conv); + CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ"); - *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ"); + *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_ok"))) TS_CResult_ClaimedHTLCDecodeErrorZ_ok(uint64_t o) { - LDKClaimedHTLC o_conv; +uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) { + LDKHTLCOutputInCommitment 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 = ClaimedHTLC_clone(&o_conv); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_ok(o_conv); + o_conv = HTLCOutputInCommitment_clone(&o_conv); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_err"))) TS_CResult_ClaimedHTLCDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_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_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_err(e_conv); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_is_ok"))) TS_CResult_ClaimedHTLCDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_ClaimedHTLCDecodeErrorZ* o_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ClaimedHTLCDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_free"))) TS_CResult_ClaimedHTLCDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_ClaimedHTLCDecodeErrorZ _res_conv = *(LDKCResult_ClaimedHTLCDecodeErrorZ*)(_res_ptr); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_ClaimedHTLCDecodeErrorZ_free(_res_conv); + CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_ClaimedHTLCDecodeErrorZ* arg_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(arg_conv); +static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_clone"))) TS_CResult_ClaimedHTLCDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_ClaimedHTLCDecodeErrorZ* orig_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(orig); - LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); - *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ"); + *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) { + LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_clone(&o_conv); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_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_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_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_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_COption_PathFailureZ_free"))) TS_COption_PathFailureZ_free(uint64_t _res) { +jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_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); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_PathFailureZ_free(_res_conv); + CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_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; +static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -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); +int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_COption_PathFailureZ_clone"))) TS_COption_PathFailureZ_clone(uint64_t orig) { - LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig); - LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); - *ret_copy = COption_PathFailureZ_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) { + LDKChannelTransactionParameters 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 = ChannelTransactionParameters_clone(&o_conv); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); + CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_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_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ"); + *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_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) { - 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); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) { + LDKHolderCommitmentTransaction 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 = HolderCommitmentTransaction_clone(&o_conv); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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; +uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_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_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) { +jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_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); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_ClosureReasonZ_free(_res_conv); + CResult_HolderCommitmentTransactionDecodeErrorZ_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); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -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_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_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 ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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); +uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) { + LDKBuiltCommitmentTransaction 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 = BuiltCommitmentTransaction_clone(&o_conv); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_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); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_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); +jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_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); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); + CResult_BuiltCommitmentTransactionDecodeErrorZ_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 CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_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_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_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_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_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) { - 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; +uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) { + LDKTrustedClosingTransaction 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 LDKTrustedClosingTransaction + + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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; +uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() { + LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ"); + *ret_conv = CResult_TrustedClosingTransactionNoneZ_err(); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) { +jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) { + LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_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); + LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_HTLCDestinationZ_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); - 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); - 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 ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + CResult_TrustedClosingTransactionNoneZ_free(_res_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); +uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) { + LDKCommitmentTransaction 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 = CommitmentTransaction_clone(&o_conv); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); + CResult_CommitmentTransactionDecodeErrorZ_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); +static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg); 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); +int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_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_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig); + LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ"); + *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -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); +uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) { + LDKTrustedCommitmentTransaction 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 LDKTrustedCommitmentTransaction + + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -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_PaymentFailureReasonDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentFailureReasonDecodeErrorZ), "LDKCResult_PaymentFailureReasonDecodeErrorZ"); - *ret_conv = CResult_PaymentFailureReasonDecodeErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() { + LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ"); + *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err(); return tag_ptr(ret_conv, true); } -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); +jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) { + LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_PaymentFailureReasonDecodeErrorZ_free"))) TS_CResult_PaymentFailureReasonDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); + LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); + CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv); } -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); +uint64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_ok"))) TS_CResult_CVec_ECDSASignatureZNoneZ_ok(ptrArray o) { + LDKCVec_ECDSASignatureZ o_constr; + o_constr.datalen = o->arr_len; + if (o_constr.datalen > 0) + o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKECDSASignature), "LDKCVec_ECDSASignatureZ Elements"); + else + o_constr.data = NULL; + int8_tArray* o_vals = (void*) o->elems; + for (size_t m = 0; m < o_constr.datalen; m++) { + int8_tArray o_conv_12 = o_vals[m]; + LDKECDSASignature o_conv_12_ref; + CHECK(o_conv_12->arr_len == 64); + memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12); + o_constr.data[m] = o_conv_12_ref; + } + FREE(o); + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_ok(o_constr); return tag_ptr(ret_conv, true); } -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); + +uint64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_err"))) TS_CResult_CVec_ECDSASignatureZNoneZ_err() { + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_err(); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_is_ok"))) TS_CResult_CVec_ECDSASignatureZNoneZ_is_ok(uint64_t o) { + LDKCResult_CVec_ECDSASignatureZNoneZ* o_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_CVec_ECDSASignatureZNoneZ_is_ok(o_conv); return ret_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); +void __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_free"))) TS_CResult_CVec_ECDSASignatureZNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_CVec_ECDSASignatureZNoneZ _res_conv = *(LDKCResult_CVec_ECDSASignatureZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_CVec_ECDSASignatureZNoneZ_free(_res_conv); +} + +static inline uint64_t CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(LDKCResult_CVec_ECDSASignatureZNoneZ *NONNULL_PTR arg) { + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_CVec_ECDSASignatureZNoneZ* arg_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_CVec_ECDSASignatureZNoneZ_clone"))) TS_CResult_CVec_ECDSASignatureZNoneZ_clone(uint64_t orig) { + LDKCResult_CVec_ECDSASignatureZNoneZ* orig_conv = (LDKCResult_CVec_ECDSASignatureZNoneZ*)untag_ptr(orig); + LDKCResult_CVec_ECDSASignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_ECDSASignatureZNoneZ), "LDKCResult_CVec_ECDSASignatureZNoneZ"); + *ret_conv = CResult_CVec_ECDSASignatureZNoneZ_clone(orig_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 __attribute__((export_name("TS_COption_usizeZ_some"))) TS_COption_usizeZ_some(uint32_t o) { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_some(o); 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 __attribute__((export_name("TS_COption_usizeZ_none"))) TS_COption_usizeZ_none() { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_none(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_COption_U128Z_free"))) TS_COption_U128Z_free(uint64_t _res) { +void __attribute__((export_name("TS_COption_usizeZ_free"))) TS_COption_usizeZ_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); + LDKCOption_usizeZ _res_conv = *(LDKCOption_usizeZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_U128Z_free(_res_conv); + COption_usizeZ_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); +static inline uint64_t COption_usizeZ_clone_ptr(LDKCOption_usizeZ *NONNULL_PTR arg) { + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_clone(arg); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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_COption_usizeZ_clone_ptr"))) TS_COption_usizeZ_clone_ptr(uint64_t arg) { + LDKCOption_usizeZ* arg_conv = (LDKCOption_usizeZ*)untag_ptr(arg); + int64_t ret_conv = COption_usizeZ_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_COption_usizeZ_clone"))) TS_COption_usizeZ_clone(uint64_t orig) { + LDKCOption_usizeZ* orig_conv = (LDKCOption_usizeZ*)untag_ptr(orig); + LDKCOption_usizeZ *ret_copy = MALLOC(sizeof(LDKCOption_usizeZ), "LDKCOption_usizeZ"); + *ret_copy = COption_usizeZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_CVec_ClaimedHTLCZ_free"))) TS_CVec_ClaimedHTLCZ_free(uint64_tArray _res) { - LDKCVec_ClaimedHTLCZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ 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]; - LDKClaimedHTLC _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_ClaimedHTLCZ_free(_res_constr); +uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) { + LDKShutdownScript 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 = ShutdownScript_clone(&o_conv); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_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; +uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_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_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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; +jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_COption_PaymentFailureReasonZ_free"))) TS_COption_PaymentFailureReasonZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); + LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_PaymentFailureReasonZ_free(_res_conv); + CResult_ShutdownScriptDecodeErrorZ_free(_res_conv); } -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; +static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -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); +int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -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_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ"); + *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_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_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) { + LDKShutdownScript 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 = ShutdownScript_clone(&o_conv); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_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; +uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) { + LDKInvalidShutdownScript e_conv; + e_conv.inner = untag_ptr(e); + e_conv.is_owned = ptr_is_owned(e); + CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv); + e_conv = InvalidShutdownScript_clone(&e_conv); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) { +jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o); + jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_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_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_EventZ_free(_res_conv); + CResult_ShutdownScriptInvalidShutdownScriptZ_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_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_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_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_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_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) { + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig); + LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ"); + *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_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 __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) { + LDKCVec_TransactionZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ 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]; + LDKTransaction _res_conv_12_ref; + _res_conv_12_ref.datalen = _res_conv_12->arr_len; + _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes"); + memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12); + _res_conv_12_ref.data_is_owned = true; + _res_constr.data[m] = _res_conv_12_ref; + } + FREE(_res); + CVec_TransactionZ_free(_res_constr); +} + +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); - 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); + 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_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) { +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_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ"); - *ret_conv = CResult_COption_EventZDecodeErrorZ_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_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_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_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_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_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_COption_EventZDecodeErrorZ_free(_res_conv); + CResult_PaymentPurposeDecodeErrorZ_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_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_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_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_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_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); } -uint64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_ok"))) TS_CResult_SiPrefixBolt11ParseErrorZ_ok(uint32_t o) { - LDKSiPrefix o_conv = LDKSiPrefix_from_js(o); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_ok"))) TS_CResult_ClaimedHTLCDecodeErrorZ_ok(uint64_t o) { + LDKClaimedHTLC 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 = ClaimedHTLC_clone(&o_conv); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_err"))) TS_CResult_SiPrefixBolt11ParseErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_err"))) TS_CResult_ClaimedHTLCDecodeErrorZ_err(uint64_t e) { void* e_ptr = untag_ptr(e); CHECK_ACCESS(e_ptr); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_is_ok"))) TS_CResult_SiPrefixBolt11ParseErrorZ_is_ok(uint64_t o) { - LDKCResult_SiPrefixBolt11ParseErrorZ* o_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SiPrefixBolt11ParseErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_is_ok"))) TS_CResult_ClaimedHTLCDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ClaimedHTLCDecodeErrorZ* o_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ClaimedHTLCDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_free"))) TS_CResult_SiPrefixBolt11ParseErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_free"))) TS_CResult_ClaimedHTLCDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SiPrefixBolt11ParseErrorZ _res_conv = *(LDKCResult_SiPrefixBolt11ParseErrorZ*)(_res_ptr); + LDKCResult_ClaimedHTLCDecodeErrorZ _res_conv = *(LDKCResult_ClaimedHTLCDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SiPrefixBolt11ParseErrorZ_free(_res_conv); + CResult_ClaimedHTLCDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(arg); +static inline uint64_t CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(LDKCResult_ClaimedHTLCDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_SiPrefixBolt11ParseErrorZ* arg_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ClaimedHTLCDecodeErrorZ* arg_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_clone"))) TS_CResult_SiPrefixBolt11ParseErrorZ_clone(uint64_t orig) { - LDKCResult_SiPrefixBolt11ParseErrorZ* orig_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(orig); - LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); - *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(uint64_t o) { - LDKBolt11Invoice 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 = Bolt11Invoice_clone(&o_conv); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_ClaimedHTLCDecodeErrorZ_clone"))) TS_CResult_ClaimedHTLCDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ClaimedHTLCDecodeErrorZ* orig_conv = (LDKCResult_ClaimedHTLCDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ClaimedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClaimedHTLCDecodeErrorZ), "LDKCResult_ClaimedHTLCDecodeErrorZ"); + *ret_conv = CResult_ClaimedHTLCDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +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; } -jboolean __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(o_conv); - return ret_conv; +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_CResult_Bolt11InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)(_res_ptr); + LDKCOption_PathFailureZ _res_conv = *(LDKCOption_PathFailureZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(_res_conv); + COption_PathFailureZ_free(_res_conv); } -static inline uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +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_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_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_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) { - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_PathFailureZ_clone"))) TS_COption_PathFailureZ_clone(uint64_t orig) { + LDKCOption_PathFailureZ* orig_conv = (LDKCOption_PathFailureZ*)untag_ptr(orig); + LDKCOption_PathFailureZ *ret_copy = MALLOC(sizeof(LDKCOption_PathFailureZ), "LDKCOption_PathFailureZ"); + *ret_copy = COption_PathFailureZ_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(uint64_t o) { - LDKSignedRawBolt11Invoice 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 = SignedRawBolt11Invoice_clone(&o_conv); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_ok"))) TS_CResult_COption_PathFailureZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKCOption_PathFailureZ o_conv = *(LDKCOption_PathFailureZ*)(o_ptr); + o_conv = COption_PathFailureZ_clone((LDKCOption_PathFailureZ*)untag_ptr(o)); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(uint64_t e) { +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); - LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); - e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err(e_conv); + LDKDecodeError e_conv = *(LDKDecodeError*)(e_ptr); + e_conv = DecodeError_clone((LDKDecodeError*)untag_ptr(e)); + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(uint64_t o) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* o_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_is_ok"))) TS_CResult_COption_PathFailureZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_COption_PathFailureZDecodeErrorZ* o_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_COption_PathFailureZDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_free"))) TS_CResult_COption_PathFailureZDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res_conv = *(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)(_res_ptr); + LDKCResult_COption_PathFailureZDecodeErrorZ _res_conv = *(LDKCResult_COption_PathFailureZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free(_res_conv); + CResult_COption_PathFailureZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(arg); +static inline uint64_t CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_COption_PathFailureZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_PathFailureZDecodeErrorZ), "LDKCResult_COption_PathFailureZDecodeErrorZ"); + *ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* arg_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_COption_PathFailureZDecodeErrorZ* arg_conv = (LDKCResult_COption_PathFailureZDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_COption_PathFailureZDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(uint64_t orig) { - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* orig_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(orig); - LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); - *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -static inline uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(arg); +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); } -int64_t __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(uint64_t arg) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(uint64_t orig) { - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(orig); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_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) { + 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); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) { - LDKRawBolt11Invoice 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 = RawBolt11Invoice_clone(&a_conv); - LDKThirtyTwoBytes b_ref; - CHECK(b->arr_len == 32); - memcpy(b_ref.data, b->elems, 32); FREE(b); - LDKBolt11InvoiceSignature 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 = Bolt11InvoiceSignature_clone(&c_conv); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); - *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a_conv, b_ref, c_conv); - return tag_ptr(ret_conv, true); +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_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_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); - LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)(_res_ptr); + LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(_res_conv); + COption_ClosureReasonZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_ok"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_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_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_ok(o_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); + 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); + 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 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); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_err"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_err(uint32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_err(e_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); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_is_ok"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_is_ok(uint64_t o) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* o_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_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_PayeePubKeySecp256k1ErrorZ_free"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_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_PayeePubKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PayeePubKeySecp256k1ErrorZ*)(_res_ptr); + LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PayeePubKeySecp256k1ErrorZ_free(_res_conv); + CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(arg); +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_PayeePubKeySecp256k1ErrorZ_clone_ptr"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(arg_conv); +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_PayeePubKeySecp256k1ErrorZ_clone"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_clone(uint64_t orig) { - LDKCResult_PayeePubKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); - *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) { - LDKCVec_PrivateRouteZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t o = 0; o < _res_constr.datalen; o++) { - uint64_t _res_conv_14 = _res_vals[o]; - LDKPrivateRoute _res_conv_14_conv; - _res_conv_14_conv.inner = untag_ptr(_res_conv_14); - _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); - _res_constr.data[o] = _res_conv_14_conv; - } - FREE(_res); - CVec_PrivateRouteZ_free(_res_constr); -} - -uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) { - LDKPositiveTimestamp o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PositiveTimestamp_clone(&o_conv); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); +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); } -uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) { - LDKCreationError e_conv = LDKCreationError_from_js(e); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_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; } -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_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_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) { +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_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); + LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PositiveTimestampCreationErrorZ_free(_res_conv); + COption_HTLCDestinationZ_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); - 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_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_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_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) { - LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig); - LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); - *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_COption_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_NoneBolt11SemanticErrorZ_ok"))) TS_CResult_NoneBolt11SemanticErrorZ_ok() { - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_ok(); +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_NoneBolt11SemanticErrorZ_err"))) TS_CResult_NoneBolt11SemanticErrorZ_err(uint32_t e) { - LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_js(e); - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_err(e_conv); +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_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_NoneBolt11SemanticErrorZ_is_ok"))) TS_CResult_NoneBolt11SemanticErrorZ_is_ok(uint64_t o) { - LDKCResult_NoneBolt11SemanticErrorZ* o_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt11SemanticErrorZ_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_NoneBolt11SemanticErrorZ_free"))) TS_CResult_NoneBolt11SemanticErrorZ_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_NoneBolt11SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt11SemanticErrorZ*)(_res_ptr); + LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_NoneBolt11SemanticErrorZ_free(_res_conv); + CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_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_NoneBolt11SemanticErrorZ_clone_ptr"))) TS_CResult_NoneBolt11SemanticErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_NoneBolt11SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt11SemanticErrorZ_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_NoneBolt11SemanticErrorZ_clone"))) TS_CResult_NoneBolt11SemanticErrorZ_clone(uint64_t orig) { - LDKCResult_NoneBolt11SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(orig); - LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); - *ret_conv = CResult_NoneBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ_ok"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(uint64_t o) { - LDKBolt11Invoice 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 = Bolt11Invoice_clone(&o_conv); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ_err"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(uint32_t e) { - LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_js(e); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e_conv); +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_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_Bolt11InvoiceBolt11SemanticErrorZ_is_ok"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(uint64_t o) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ_free"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)(_res_ptr); + LDKCResult_PaymentFailureReasonDecodeErrorZ _res_conv = *(LDKCResult_PaymentFailureReasonDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(_res_conv); + CResult_PaymentFailureReasonDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_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_Bolt11InvoiceBolt11SemanticErrorZ_clone"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(uint64_t orig) { - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(orig); - LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); - *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) { - LDKDescription o_conv; - o_conv.inner = untag_ptr(o); - o_conv.is_owned = ptr_is_owned(o); - CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = Description_clone(&o_conv); - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv); +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_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); +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_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_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_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_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_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); + LDKCOption_U128Z _res_conv = *(LDKCOption_U128Z*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DescriptionCreationErrorZ_free(_res_conv); + COption_U128Z_free(_res_conv); } -static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); - *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +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_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_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_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_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_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); +void __attribute__((export_name("TS_CVec_ClaimedHTLCZ_free"))) TS_CVec_ClaimedHTLCZ_free(uint64_tArray _res) { + LDKCVec_ClaimedHTLCZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKClaimedHTLC), "LDKCVec_ClaimedHTLCZ 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]; + LDKClaimedHTLC _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_ClaimedHTLCZ_free(_res_constr); } -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_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_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; +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_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_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_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); + LDKCOption_PaymentFailureReasonZ _res_conv = *(LDKCOption_PaymentFailureReasonZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PrivateRouteCreationErrorZ_free(_res_conv); + COption_PaymentFailureReasonZ_free(_res_conv); } -static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); - return tag_ptr(ret_conv, true); +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_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_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_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) { - LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig); - LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); - *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) { - LDKOutPoint 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 = OutPoint_clone(&o_conv); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_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_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_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_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); + LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_OutPointDecodeErrorZ_free(_res_conv); + COption_EventZ_free(_res_conv); } -static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = CResult_OutPointDecodeErrorZ_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_BigSizeDecodeErrorZ_ok"))) TS_CResult_BigSizeDecodeErrorZ_ok(uint64_t o) { - LDKBigSize 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 = BigSize_clone(&o_conv); - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_err"))) TS_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_is_ok"))) TS_CResult_BigSizeDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_BigSizeDecodeErrorZ* o_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_free"))) TS_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ _res_conv = *(LDKCResult_BigSizeDecodeErrorZ*)(_res_ptr); + LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BigSizeDecodeErrorZ_free(_res_conv); + CResult_COption_EventZDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ_clone_ptr"))) TS_CResult_BigSizeDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_BigSizeDecodeErrorZ* arg_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_BigSizeDecodeErrorZ_clone_ptr(arg_conv); +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_BigSizeDecodeErrorZ_clone"))) TS_CResult_BigSizeDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_BigSizeDecodeErrorZ* orig_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(orig); - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = CResult_BigSizeDecodeErrorZ_clone(orig_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); } -uint64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_ok"))) TS_CResult_HostnameDecodeErrorZ_ok(uint64_t o) { - LDKHostname 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 = Hostname_clone(&o_conv); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_ok"))) TS_CResult_SiPrefixBolt11ParseErrorZ_ok(uint32_t o) { + LDKSiPrefix o_conv = LDKSiPrefix_from_js(o); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_err"))) TS_CResult_HostnameDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_err"))) TS_CResult_SiPrefixBolt11ParseErrorZ_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_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); + LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); + e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_is_ok"))) TS_CResult_HostnameDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_free"))) TS_CResult_HostnameDecodeErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_HostnameDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_clone_ptr"))) TS_CResult_HostnameDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HostnameDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_clone"))) TS_CResult_HostnameDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_ok"))) TS_CResult_TransactionU16LenLimitedNoneZ_ok(uint64_t o) { - LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_err"))) TS_CResult_TransactionU16LenLimitedNoneZ_err() { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); - return tag_ptr(ret_conv, true); -} - -jboolean __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_is_ok"))) TS_CResult_TransactionU16LenLimitedNoneZ_is_ok(uint64_t o) { - LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_is_ok"))) TS_CResult_SiPrefixBolt11ParseErrorZ_is_ok(uint64_t o) { + LDKCResult_SiPrefixBolt11ParseErrorZ* o_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SiPrefixBolt11ParseErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_free"))) TS_CResult_TransactionU16LenLimitedNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_free"))) TS_CResult_SiPrefixBolt11ParseErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); + LDKCResult_SiPrefixBolt11ParseErrorZ _res_conv = *(LDKCResult_SiPrefixBolt11ParseErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); + CResult_SiPrefixBolt11ParseErrorZ_free(_res_conv); } -static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); +static inline uint64_t CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(LDKCResult_SiPrefixBolt11ParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_clone_ptr"))) TS_CResult_TransactionU16LenLimitedNoneZ_clone_ptr(uint64_t arg) { - LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_SiPrefixBolt11ParseErrorZ* arg_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_clone"))) TS_CResult_TransactionU16LenLimitedNoneZ_clone(uint64_t orig) { - LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_SiPrefixBolt11ParseErrorZ_clone"))) TS_CResult_SiPrefixBolt11ParseErrorZ_clone(uint64_t orig) { + LDKCResult_SiPrefixBolt11ParseErrorZ* orig_conv = (LDKCResult_SiPrefixBolt11ParseErrorZ*)untag_ptr(orig); + LDKCResult_SiPrefixBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixBolt11ParseErrorZ), "LDKCResult_SiPrefixBolt11ParseErrorZ"); + *ret_conv = CResult_SiPrefixBolt11ParseErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_ok"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_ok(uint64_t o) { - LDKTransactionU16LenLimited o_conv; +uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(uint64_t o) { + LDKBolt11Invoice 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 = TransactionU16LenLimited_clone(&o_conv); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o_conv); + o_conv = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_err"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_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_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_err(e_conv); + LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr); + e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e)); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_free"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TransactionU16LenLimitedDecodeErrorZ_free(_res_conv); + CResult_Bolt11InvoiceParseOrSemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) { + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ), "LDKCResult_Bolt11InvoiceParseOrSemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceParseOrSemanticErrorZ_clone(orig_conv); 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; +uint64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(uint64_t o) { + LDKSignedRawBolt11Invoice 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); + o_conv = SignedRawBolt11Invoice_clone(&o_conv); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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) { +uint64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_err"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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); + LDKBolt11ParseError e_conv = *(LDKBolt11ParseError*)(e_ptr); + e_conv = Bolt11ParseError_clone((LDKBolt11ParseError*)untag_ptr(e)); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(uint64_t o) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* o_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_UntrustedStringDecodeErrorZ_free"))) TS_CResult_UntrustedStringDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_free"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ _res_conv = *(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_UntrustedStringDecodeErrorZ_free(_res_conv); + CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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); +static inline uint64_t CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ *NONNULL_PTR arg) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* arg_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone"))) TS_CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(uint64_t orig) { + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* orig_conv = (LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ*)untag_ptr(orig); + LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ), "LDKCResult_SignedRawBolt11InvoiceBolt11ParseErrorZ"); + *ret_conv = CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_clone(arg); +static inline uint64_t C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ *NONNULL_PTR arg) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_C2Tuple__u832u16Z_clone_ptr"))) TS_C2Tuple__u832u16Z_clone_ptr(uint64_t arg) { - LDKC2Tuple__u832u16Z* arg_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(arg); - int64_t ret_conv = C2Tuple__u832u16Z_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(uint64_t arg) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_C2Tuple__u832u16Z_clone"))) TS_C2Tuple__u832u16Z_clone(uint64_t orig) { - LDKC2Tuple__u832u16Z* orig_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(orig); - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_clone(orig_conv); +uint64_t __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(uint64_t orig) { + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)untag_ptr(orig); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C2Tuple__u832u16Z_new"))) TS_C2Tuple__u832u16Z_new(int8_tArray a, int16_t b) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); - *ret_conv = C2Tuple__u832u16Z_new(a_ref, b); +uint64_t __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) { + LDKRawBolt11Invoice 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 = RawBolt11Invoice_clone(&a_conv); + LDKThirtyTwoBytes b_ref; + CHECK(b->arr_len == 32); + memcpy(b_ref.data, b->elems, 32); FREE(b); + LDKBolt11InvoiceSignature 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 = Bolt11InvoiceSignature_clone(&c_conv); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ), "LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ"); + *ret_conv = C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a_conv, b_ref, c_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_C2Tuple__u832u16Z_free"))) TS_C2Tuple__u832u16Z_free(uint64_t _res) { +void __attribute__((export_name("TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free"))) TS_C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_res_ptr); + LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple__u832u16Z_free(_res_conv); + C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_ok"))) TS_CResult_PaymentRelayDecodeErrorZ_ok(uint64_t o) { - LDKPaymentRelay o_conv; +uint64_t __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_ok"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_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 = PaymentRelay_clone(&o_conv); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_ok(o_conv); + o_conv = PayeePubKey_clone(&o_conv); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_err"))) TS_CResult_PaymentRelayDecodeErrorZ_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_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_err"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_err(uint32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_is_ok"))) TS_CResult_PaymentRelayDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_PaymentRelayDecodeErrorZ* o_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentRelayDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_is_ok"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_is_ok(uint64_t o) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* o_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_free"))) TS_CResult_PaymentRelayDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_free"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentRelayDecodeErrorZ _res_conv = *(LDKCResult_PaymentRelayDecodeErrorZ*)(_res_ptr); + LDKCResult_PayeePubKeySecp256k1ErrorZ _res_conv = *(LDKCResult_PayeePubKeySecp256k1ErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentRelayDecodeErrorZ_free(_res_conv); + CResult_PayeePubKeySecp256k1ErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentRelayDecodeErrorZ_clone_ptr(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PayeePubKeySecp256k1ErrorZ *NONNULL_PTR arg) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentRelayDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_PaymentRelayDecodeErrorZ* arg_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentRelayDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_clone"))) TS_CResult_PaymentRelayDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_PaymentRelayDecodeErrorZ* orig_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); - *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_PayeePubKeySecp256k1ErrorZ_clone"))) TS_CResult_PayeePubKeySecp256k1ErrorZ_clone(uint64_t orig) { + LDKCResult_PayeePubKeySecp256k1ErrorZ* orig_conv = (LDKCResult_PayeePubKeySecp256k1ErrorZ*)untag_ptr(orig); + LDKCResult_PayeePubKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeySecp256k1ErrorZ), "LDKCResult_PayeePubKeySecp256k1ErrorZ"); + *ret_conv = CResult_PayeePubKeySecp256k1ErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_ok"))) TS_CResult_PaymentConstraintsDecodeErrorZ_ok(uint64_t o) { - LDKPaymentConstraints o_conv; +void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) { + LDKCVec_PrivateRouteZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t o = 0; o < _res_constr.datalen; o++) { + uint64_t _res_conv_14 = _res_vals[o]; + LDKPrivateRoute _res_conv_14_conv; + _res_conv_14_conv.inner = untag_ptr(_res_conv_14); + _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv); + _res_constr.data[o] = _res_conv_14_conv; + } + FREE(_res); + CVec_PrivateRouteZ_free(_res_constr); +} + +uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) { + LDKPositiveTimestamp o_conv; o_conv.inner = untag_ptr(o); o_conv.is_owned = ptr_is_owned(o); CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); - o_conv = PaymentConstraints_clone(&o_conv); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_ok(o_conv); + o_conv = PositiveTimestamp_clone(&o_conv); + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_err"))) TS_CResult_PaymentConstraintsDecodeErrorZ_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_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_err(e_conv); +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); } -jboolean __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_is_ok"))) TS_CResult_PaymentConstraintsDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_PaymentConstraintsDecodeErrorZ* o_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PaymentConstraintsDecodeErrorZ_is_ok(o_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; } -void __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_free"))) TS_CResult_PaymentConstraintsDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PaymentConstraintsDecodeErrorZ _res_conv = *(LDKCResult_PaymentConstraintsDecodeErrorZ*)(_res_ptr); + LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PaymentConstraintsDecodeErrorZ_free(_res_conv); + CResult_PositiveTimestampCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ"); + *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_PaymentConstraintsDecodeErrorZ* arg_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(arg_conv); +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_CResult_PaymentConstraintsDecodeErrorZ_clone"))) TS_CResult_PaymentConstraintsDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_PaymentConstraintsDecodeErrorZ* orig_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(orig); - LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); - *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(orig_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); return tag_ptr(ret_conv, true); } -static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); +uint64_t __attribute__((export_name("TS_CResult_NoneBolt11SemanticErrorZ_ok"))) TS_CResult_NoneBolt11SemanticErrorZ_ok() { + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_ok(); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(uint64_t arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(uint64_t orig) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_NoneBolt11SemanticErrorZ_err"))) TS_CResult_NoneBolt11SemanticErrorZ_err(uint32_t e) { + LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_js(e); + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, uint64_t b, uint64_t c) { - LDKThirtyTwoBytes a_ref; - CHECK(a->arr_len == 32); - memcpy(a_ref.data, a->elems, 32); FREE(a); - 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 = RecipientOnionFields_clone(&b_conv); - LDKRouteParameters 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 = RouteParameters_clone(&c_conv); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); - *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_CResult_NoneBolt11SemanticErrorZ_is_ok"))) TS_CResult_NoneBolt11SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_NoneBolt11SemanticErrorZ* o_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt11SemanticErrorZ_is_ok(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_NoneBolt11SemanticErrorZ_free"))) TS_CResult_NoneBolt11SemanticErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); + LDKCResult_NoneBolt11SemanticErrorZ _res_conv = *(LDKCResult_NoneBolt11SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); + CResult_NoneBolt11SemanticErrorZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); - o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); +static inline uint64_t CResult_NoneBolt11SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt11SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_NoneBolt11SemanticErrorZ_clone_ptr"))) TS_CResult_NoneBolt11SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_NoneBolt11SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt11SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CResult_NoneBolt11SemanticErrorZ_clone"))) TS_CResult_NoneBolt11SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_NoneBolt11SemanticErrorZ* orig_conv = (LDKCResult_NoneBolt11SemanticErrorZ*)untag_ptr(orig); + LDKCResult_NoneBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt11SemanticErrorZ), "LDKCResult_NoneBolt11SemanticErrorZ"); + *ret_conv = CResult_NoneBolt11SemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err() { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); +uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(uint64_t o) { + LDKBolt11Invoice 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 = Bolt11Invoice_clone(&o_conv); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(uint64_t o) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(uint32_t e) { + LDKBolt11SemanticError e_conv = LDKBolt11SemanticError_from_js(e); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(uint64_t o) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* o_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ _res_conv = *(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_Bolt11InvoiceBolt11SemanticErrorZ_free(_res_conv); } -static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); +static inline uint64_t CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(uint64_t arg) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* arg_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(uint64_t orig) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone"))) TS_CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(uint64_t orig) { + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* orig_conv = (LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ*)untag_ptr(orig); + LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ), "LDKCResult_Bolt11InvoiceBolt11SemanticErrorZ"); + *ret_conv = CResult_Bolt11InvoiceBolt11SemanticErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_ok"))) TS_CResult_StrSecp256k1ErrorZ_ok(jstring o) { - LDKStr o_conv = str_ref_to_owned_c(o); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_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); } -uint64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_err"))) TS_CResult_StrSecp256k1ErrorZ_err(uint32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) { + LDKCreationError e_conv = LDKCreationError_from_js(e); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_is_ok"))) TS_CResult_StrSecp256k1ErrorZ_is_ok(uint64_t o) { - LDKCResult_StrSecp256k1ErrorZ* o_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_StrSecp256k1ErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) { + LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_free"))) TS_CResult_StrSecp256k1ErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); + LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_StrSecp256k1ErrorZ_free(_res_conv); + CResult_DescriptionCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg) { - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(arg); +static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_clone_ptr"))) TS_CResult_StrSecp256k1ErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_StrSecp256k1ErrorZ* arg_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_StrSecp256k1ErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_clone"))) TS_CResult_StrSecp256k1ErrorZ_clone(uint64_t orig) { - LDKCResult_StrSecp256k1ErrorZ* orig_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(orig); - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = CResult_StrSecp256k1ErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) { + LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig); + LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ"); + *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); - o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) { + LDKPrivateRoute o_conv; + o_conv.inner = untag_ptr(o); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = PrivateRoute_clone(&o_conv); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_err"))) TS_CResult_TxOutUtxoLookupErrorZ_err(uint32_t e) { - LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_js(e); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) { + LDKCreationError e_conv = LDKCreationError_from_js(e); + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_is_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_is_ok(uint64_t o) { - LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) { + LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_free"))) TS_CResult_TxOutUtxoLookupErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); + LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_TxOutUtxoLookupErrorZ_free(_res_conv); + CResult_PrivateRouteCreationErrorZ_free(_res_conv); } -static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); +static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) { + LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ"); + *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_clone_ptr"))) TS_CResult_TxOutUtxoLookupErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_clone"))) TS_CResult_TxOutUtxoLookupErrorZ_clone(uint64_t orig) { - LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); - LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); - *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); +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); } -static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(arg); +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); + o_conv.is_owned = ptr_is_owned(o); + CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv); + o_conv = OutPoint_clone(&o_conv); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(uint64_t arg) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* arg_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(uint64_t orig) { - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* orig_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(orig); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_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_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(int8_tArray a, uint64_t b, uint64_t c) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); - LDKOnionMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv = OnionMessage_clone(&b_conv); - void* c_ptr = untag_ptr(c); - CHECK_ACCESS(c_ptr); - LDKCOption_CVec_SocketAddressZZ c_conv = *(LDKCOption_CVec_SocketAddressZZ*)(c_ptr); - c_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(c)); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); - *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(a_ref, b_conv, c_conv); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -void __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); + LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); -} - -uint64_t __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(o_ptr); - o_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone((LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(o)); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); + CResult_OutPointDecodeErrorZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(uint64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(e_conv); +static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } - -jboolean __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(uint64_t o) { - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* o_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(o_conv); +int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); +uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_ok"))) TS_CResult_PeeledOnionNoneZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKPeeledOnion o_conv = *(LDKPeeledOnion*)(o_ptr); - o_conv = PeeledOnion_clone((LDKPeeledOnion*)untag_ptr(o)); - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_BigSizeDecodeErrorZ_ok"))) TS_CResult_BigSizeDecodeErrorZ_ok(uint64_t o) { + LDKBigSize 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 = BigSize_clone(&o_conv); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_err"))) TS_CResult_PeeledOnionNoneZ_err() { - LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); - *ret_conv = CResult_PeeledOnionNoneZ_err(); +uint64_t __attribute__((export_name("TS_CResult_BigSizeDecodeErrorZ_err"))) TS_CResult_BigSizeDecodeErrorZ_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_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_is_ok"))) TS_CResult_PeeledOnionNoneZ_is_ok(uint64_t o) { - LDKCResult_PeeledOnionNoneZ* o_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_PeeledOnionNoneZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_BigSizeDecodeErrorZ_is_ok"))) TS_CResult_BigSizeDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_BigSizeDecodeErrorZ* o_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BigSizeDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_free"))) TS_CResult_PeeledOnionNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_BigSizeDecodeErrorZ_free"))) TS_CResult_BigSizeDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_PeeledOnionNoneZ _res_conv = *(LDKCResult_PeeledOnionNoneZ*)(_res_ptr); + LDKCResult_BigSizeDecodeErrorZ _res_conv = *(LDKCResult_BigSizeDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_PeeledOnionNoneZ_free(_res_conv); -} - -uint64_t __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_ok"))) TS_CResult_SendSuccessSendErrorZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKSendSuccess o_conv = *(LDKSendSuccess*)(o_ptr); - o_conv = SendSuccess_clone((LDKSendSuccess*)untag_ptr(o)); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_ok(o_conv); - return tag_ptr(ret_conv, true); + CResult_BigSizeDecodeErrorZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_err"))) TS_CResult_SendSuccessSendErrorZ_err(uint64_t e) { - void* e_ptr = untag_ptr(e); - CHECK_ACCESS(e_ptr); - LDKSendError e_conv = *(LDKSendError*)(e_ptr); - e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); - LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); - *ret_conv = CResult_SendSuccessSendErrorZ_err(e_conv); +static inline uint64_t CResult_BigSizeDecodeErrorZ_clone_ptr(LDKCResult_BigSizeDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } - -jboolean __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_is_ok"))) TS_CResult_SendSuccessSendErrorZ_is_ok(uint64_t o) { - LDKCResult_SendSuccessSendErrorZ* o_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_SendSuccessSendErrorZ_is_ok(o_conv); +int64_t __attribute__((export_name("TS_CResult_BigSizeDecodeErrorZ_clone_ptr"))) TS_CResult_BigSizeDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_BigSizeDecodeErrorZ* arg_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BigSizeDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_free"))) TS_CResult_SendSuccessSendErrorZ_free(uint64_t _res) { - if (!ptr_is_owned(_res)) return; - void* _res_ptr = untag_ptr(_res); - CHECK_ACCESS(_res_ptr); - LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); - FREE(untag_ptr(_res)); - CResult_SendSuccessSendErrorZ_free(_res_conv); +uint64_t __attribute__((export_name("TS_CResult_BigSizeDecodeErrorZ_clone"))) TS_CResult_BigSizeDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_BigSizeDecodeErrorZ* orig_conv = (LDKCResult_BigSizeDecodeErrorZ*)untag_ptr(orig); + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = CResult_BigSizeDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_ok"))) TS_CResult_BlindedPathNoneZ_ok(uint64_t o) { - LDKBlindedPath o_conv; +uint64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_ok"))) TS_CResult_HostnameDecodeErrorZ_ok(uint64_t o) { + LDKHostname 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); + o_conv = Hostname_clone(&o_conv); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_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(); +uint64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_err"))) TS_CResult_HostnameDecodeErrorZ_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_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_err(e_conv); 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); +jboolean __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_is_ok"))) TS_CResult_HostnameDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_HostnameDecodeErrorZ* o_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HostnameDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_BlindedPathNoneZ_free"))) TS_CResult_BlindedPathNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_free"))) TS_CResult_HostnameDecodeErrorZ_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); + LDKCResult_HostnameDecodeErrorZ _res_conv = *(LDKCResult_HostnameDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathNoneZ_free(_res_conv); + CResult_HostnameDecodeErrorZ_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); +static inline uint64_t CResult_HostnameDecodeErrorZ_clone_ptr(LDKCResult_HostnameDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_clone_ptr"))) TS_CResult_HostnameDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_HostnameDecodeErrorZ* arg_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HostnameDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_HostnameDecodeErrorZ_clone"))) TS_CResult_HostnameDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_HostnameDecodeErrorZ* orig_conv = (LDKCResult_HostnameDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = CResult_HostnameDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(uint64_t o) { - void* o_ptr = untag_ptr(o); - CHECK_ACCESS(o_ptr); - LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_ptr); - o_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o)); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_ok"))) TS_CResult_TransactionU16LenLimitedNoneZ_ok(uint64_t o) { + LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err() { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); +uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_err"))) TS_CResult_TransactionU16LenLimitedNoneZ_err() { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(uint64_t o) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* o_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_is_ok"))) TS_CResult_TransactionU16LenLimitedNoneZ_is_ok(uint64_t o) { + LDKCResult_TransactionU16LenLimitedNoneZ* o_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedNoneZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_free"))) TS_CResult_TransactionU16LenLimitedNoneZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); + LDKCResult_TransactionU16LenLimitedNoneZ _res_conv = *(LDKCResult_TransactionU16LenLimitedNoneZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); + CResult_TransactionU16LenLimitedNoneZ_free(_res_conv); } -static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); +static inline uint64_t CResult_TransactionU16LenLimitedNoneZ_clone_ptr(LDKCResult_TransactionU16LenLimitedNoneZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(uint64_t arg) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* arg_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_clone_ptr"))) TS_CResult_TransactionU16LenLimitedNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_TransactionU16LenLimitedNoneZ* arg_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(uint64_t orig) { - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* orig_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(orig); - LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedNoneZ_clone"))) TS_CResult_TransactionU16LenLimitedNoneZ_clone(uint64_t orig) { + LDKCResult_TransactionU16LenLimitedNoneZ* orig_conv = (LDKCResult_TransactionU16LenLimitedNoneZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = CResult_TransactionU16LenLimitedNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CVec_ForwardNodeZ_free"))) TS_CVec_ForwardNodeZ_free(uint64_tArray _res) { - LDKCVec_ForwardNodeZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ 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]; - LDKForwardNode _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_ForwardNodeZ_free(_res_constr); -} - -uint64_t __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_ok"))) TS_CResult_BlindedPathDecodeErrorZ_ok(uint64_t o) { - LDKBlindedPath o_conv; +uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_ok"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_ok(uint64_t o) { + LDKTransactionU16LenLimited 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); + o_conv = TransactionU16LenLimited_clone(&o_conv); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_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) { +uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_err"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_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); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_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); +jboolean __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* o_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_BlindedPathDecodeErrorZ_free"))) TS_CResult_BlindedPathDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_free"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_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); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ _res_conv = *(LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedPathDecodeErrorZ_free(_res_conv); + CResult_TransactionU16LenLimitedDecodeErrorZ_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); +static inline uint64_t CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(LDKCResult_TransactionU16LenLimitedDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_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); +int64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* arg_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_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); +uint64_t __attribute__((export_name("TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone"))) TS_CResult_TransactionU16LenLimitedDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* orig_conv = (LDKCResult_TransactionU16LenLimitedDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = CResult_TransactionU16LenLimitedDecodeErrorZ_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_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 = BlindedHop_clone(&o_conv); - LDKCResult_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_ok(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_BlindedHopDecodeErrorZ_err"))) TS_CResult_BlindedHopDecodeErrorZ_err(uint64_t e) { +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_BlindedHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedHopDecodeErrorZ), "LDKCResult_BlindedHopDecodeErrorZ"); - *ret_conv = CResult_BlindedHopDecodeErrorZ_err(e_conv); + 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_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_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_BlindedHopDecodeErrorZ_free"))) TS_CResult_BlindedHopDecodeErrorZ_free(uint64_t _res) { +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_BlindedHopDecodeErrorZ _res_conv = *(LDKCResult_BlindedHopDecodeErrorZ*)(_res_ptr); + LDKCResult_UntrustedStringDecodeErrorZ _res_conv = *(LDKCResult_UntrustedStringDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_BlindedHopDecodeErrorZ_free(_res_conv); + CResult_UntrustedStringDecodeErrorZ_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_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_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_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_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_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_InvoiceErrorDecodeErrorZ_ok"))) TS_CResult_InvoiceErrorDecodeErrorZ_ok(uint64_t o) { - LDKInvoiceError o_conv; +uint64_t __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_ok"))) TS_CResult_ChannelIdDecodeErrorZ_ok(uint64_t o) { + LDKChannelId 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 = InvoiceError_clone(&o_conv); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); + o_conv = ChannelId_clone(&o_conv); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_err"))) TS_CResult_InvoiceErrorDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_err"))) TS_CResult_ChannelIdDecodeErrorZ_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_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_is_ok"))) TS_CResult_InvoiceErrorDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_is_ok"))) TS_CResult_ChannelIdDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_free"))) TS_CResult_InvoiceErrorDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_free"))) TS_CResult_ChannelIdDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_InvoiceErrorDecodeErrorZ_free(_res_conv); + CResult_ChannelIdDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(arg); +static inline uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceErrorDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_InvoiceErrorDecodeErrorZ* arg_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelIdDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_clone"))) TS_CResult_InvoiceErrorDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_InvoiceErrorDecodeErrorZ* orig_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(orig); - LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); - *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_ChannelIdDecodeErrorZ_clone"))) TS_CResult_ChannelIdDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_ChannelIdDecodeErrorZ* orig_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(orig); + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(uint64_t o) { - LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_clone(&o_conv); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o_conv); +static inline uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg) { + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_clone(arg); return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_C2Tuple__u832u16Z_clone_ptr"))) TS_C2Tuple__u832u16Z_clone_ptr(uint64_t arg) { + LDKC2Tuple__u832u16Z* arg_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(arg); + int64_t ret_conv = C2Tuple__u832u16Z_clone_ptr(arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_err"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_err(e_conv); +uint64_t __attribute__((export_name("TS_C2Tuple__u832u16Z_clone"))) TS_C2Tuple__u832u16Z_clone(uint64_t orig) { + LDKC2Tuple__u832u16Z* orig_conv = (LDKC2Tuple__u832u16Z*)untag_ptr(orig); + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_C2Tuple__u832u16Z_new"))) TS_C2Tuple__u832u16Z_new(int8_tArray a, int16_t b) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + LDKC2Tuple__u832u16Z* ret_conv = MALLOC(sizeof(LDKC2Tuple__u832u16Z), "LDKC2Tuple__u832u16Z"); + *ret_conv = C2Tuple__u832u16Z_new(a_ref, b); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_free"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_C2Tuple__u832u16Z_free"))) TS_C2Tuple__u832u16Z_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)(_res_ptr); + LDKC2Tuple__u832u16Z _res_conv = *(LDKC2Tuple__u832u16Z*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DelayedPaymentBasepointDecodeErrorZ_free(_res_conv); -} - -static inline uint64_t CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(arg); - return tag_ptr(ret_conv, true); -} -int64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(orig_conv); - return tag_ptr(ret_conv, true); + C2Tuple__u832u16Z_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_ok(uint64_t o) { - LDKDelayedPaymentKey o_conv; +uint64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_ok"))) TS_CResult_PaymentRelayDecodeErrorZ_ok(uint64_t o) { + LDKPaymentRelay 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 = DelayedPaymentKey_clone(&o_conv); - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_ok(o_conv); + o_conv = PaymentRelay_clone(&o_conv); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_err"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_err"))) TS_CResult_PaymentRelayDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_err(e_conv); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_is_ok"))) TS_CResult_PaymentRelayDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_PaymentRelayDecodeErrorZ* o_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentRelayDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_free"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_free"))) TS_CResult_PaymentRelayDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_DelayedPaymentKeyDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentRelayDecodeErrorZ _res_conv = *(LDKCResult_PaymentRelayDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_DelayedPaymentKeyDecodeErrorZ_free(_res_conv); + CResult_PaymentRelayDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PaymentRelayDecodeErrorZ_clone_ptr(LDKCResult_PaymentRelayDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentRelayDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PaymentRelayDecodeErrorZ* arg_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentRelayDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_PaymentRelayDecodeErrorZ_clone"))) TS_CResult_PaymentRelayDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_PaymentRelayDecodeErrorZ* orig_conv = (LDKCResult_PaymentRelayDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentRelayDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentRelayDecodeErrorZ), "LDKCResult_PaymentRelayDecodeErrorZ"); + *ret_conv = CResult_PaymentRelayDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_ok"))) TS_CResult_HtlcBasepointDecodeErrorZ_ok(uint64_t o) { - LDKHtlcBasepoint o_conv; +uint64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_ok"))) TS_CResult_PaymentConstraintsDecodeErrorZ_ok(uint64_t o) { + LDKPaymentConstraints 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 = HtlcBasepoint_clone(&o_conv); - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_ok(o_conv); + o_conv = PaymentConstraints_clone(&o_conv); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_err"))) TS_CResult_HtlcBasepointDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_err"))) TS_CResult_PaymentConstraintsDecodeErrorZ_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_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_err(e_conv); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_is_ok"))) TS_CResult_HtlcBasepointDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_HtlcBasepointDecodeErrorZ* o_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HtlcBasepointDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_is_ok"))) TS_CResult_PaymentConstraintsDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_PaymentConstraintsDecodeErrorZ* o_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentConstraintsDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_free"))) TS_CResult_HtlcBasepointDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_free"))) TS_CResult_PaymentConstraintsDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HtlcBasepointDecodeErrorZ _res_conv = *(LDKCResult_HtlcBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentConstraintsDecodeErrorZ _res_conv = *(LDKCResult_PaymentConstraintsDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HtlcBasepointDecodeErrorZ_free(_res_conv); + CResult_PaymentConstraintsDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HtlcBasepointDecodeErrorZ_clone_ptr(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_clone_ptr"))) TS_CResult_HtlcBasepointDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_HtlcBasepointDecodeErrorZ* arg_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PaymentConstraintsDecodeErrorZ* arg_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_clone"))) TS_CResult_HtlcBasepointDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_HtlcBasepointDecodeErrorZ* orig_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_PaymentConstraintsDecodeErrorZ_clone"))) TS_CResult_PaymentConstraintsDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_PaymentConstraintsDecodeErrorZ* orig_conv = (LDKCResult_PaymentConstraintsDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentConstraintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentConstraintsDecodeErrorZ), "LDKCResult_PaymentConstraintsDecodeErrorZ"); + *ret_conv = CResult_PaymentConstraintsDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_ok"))) TS_CResult_HtlcKeyDecodeErrorZ_ok(uint64_t o) { - LDKHtlcKey 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 = HtlcKey_clone(&o_conv); - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_ok"))) TS_CResult_PaymentContextDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPaymentContext o_conv = *(LDKPaymentContext*)(o_ptr); + o_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(o)); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_err"))) TS_CResult_HtlcKeyDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_err"))) TS_CResult_PaymentContextDecodeErrorZ_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_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_err(e_conv); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_is_ok"))) TS_CResult_HtlcKeyDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_HtlcKeyDecodeErrorZ* o_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_HtlcKeyDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_is_ok"))) TS_CResult_PaymentContextDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_free"))) TS_CResult_HtlcKeyDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_free"))) TS_CResult_PaymentContextDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_HtlcKeyDecodeErrorZ _res_conv = *(LDKCResult_HtlcKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_HtlcKeyDecodeErrorZ_free(_res_conv); + CResult_PaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_HtlcKeyDecodeErrorZ_clone_ptr(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_PaymentContextDecodeErrorZ_clone_ptr(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_clone_ptr"))) TS_CResult_HtlcKeyDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_HtlcKeyDecodeErrorZ* arg_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_HtlcKeyDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentContextDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_clone"))) TS_CResult_HtlcKeyDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_HtlcKeyDecodeErrorZ* orig_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_PaymentContextDecodeErrorZ_clone"))) TS_CResult_PaymentContextDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_PaymentContextDecodeErrorZ* orig_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_ok"))) TS_CResult_RevocationBasepointDecodeErrorZ_ok(uint64_t o) { - LDKRevocationBasepoint o_conv; +uint64_t __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_ok"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_ok(uint64_t o) { + LDKUnknownPaymentContext 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 = RevocationBasepoint_clone(&o_conv); - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_ok(o_conv); + o_conv = UnknownPaymentContext_clone(&o_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_err"))) TS_CResult_RevocationBasepointDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_err"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_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_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_err(e_conv); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_is_ok"))) TS_CResult_RevocationBasepointDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_RevocationBasepointDecodeErrorZ* o_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevocationBasepointDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_is_ok"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_free"))) TS_CResult_RevocationBasepointDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_free"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_RevocationBasepointDecodeErrorZ _res_conv = *(LDKCResult_RevocationBasepointDecodeErrorZ*)(_res_ptr); + LDKCResult_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RevocationBasepointDecodeErrorZ_free(_res_conv); + CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_RevocationBasepointDecodeErrorZ_clone_ptr(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(arg); +static inline uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_clone_ptr"))) TS_CResult_RevocationBasepointDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_RevocationBasepointDecodeErrorZ* arg_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_clone"))) TS_CResult_RevocationBasepointDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_RevocationBasepointDecodeErrorZ* orig_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_UnknownPaymentContextDecodeErrorZ_clone"))) TS_CResult_UnknownPaymentContextDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* orig_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_ok"))) TS_CResult_RevocationKeyDecodeErrorZ_ok(uint64_t o) { - LDKRevocationKey o_conv; +uint64_t __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_ok"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_ok(uint64_t o) { + LDKBolt12OfferContext 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 = RevocationKey_clone(&o_conv); - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_ok(o_conv); + o_conv = Bolt12OfferContext_clone(&o_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_err"))) TS_CResult_RevocationKeyDecodeErrorZ_err(uint64_t e) { +uint64_t __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_err"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_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_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_err(e_conv); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_is_ok"))) TS_CResult_RevocationKeyDecodeErrorZ_is_ok(uint64_t o) { - LDKCResult_RevocationKeyDecodeErrorZ* o_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_RevocationKeyDecodeErrorZ_is_ok(o_conv); +jboolean __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_is_ok"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_free"))) TS_CResult_RevocationKeyDecodeErrorZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_free"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_RevocationKeyDecodeErrorZ _res_conv = *(LDKCResult_RevocationKeyDecodeErrorZ*)(_res_ptr); + LDKCResult_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_RevocationKeyDecodeErrorZ_free(_res_conv); + CResult_Bolt12OfferContextDecodeErrorZ_free(_res_conv); } -static inline uint64_t CResult_RevocationKeyDecodeErrorZ_clone_ptr(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR arg) { - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(arg); +static inline uint64_t CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_clone_ptr"))) TS_CResult_RevocationKeyDecodeErrorZ_clone_ptr(uint64_t arg) { - LDKCResult_RevocationKeyDecodeErrorZ* arg_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_RevocationKeyDecodeErrorZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_clone"))) TS_CResult_RevocationKeyDecodeErrorZ_clone(uint64_t orig) { - LDKCResult_RevocationKeyDecodeErrorZ* orig_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(orig); - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_CResult_Bolt12OfferContextDecodeErrorZ_clone"))) TS_CResult_Bolt12OfferContextDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_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); - LDKFilter o_conv = *(LDKFilter*)(o_ptr); - if (o_conv.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&o_conv); - } - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_some(o_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_ok"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_ok(uint64_t o) { + LDKBolt12RefundContext 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 = Bolt12RefundContext_clone(&o_conv); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() { - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_none(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_err"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_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_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) { +jboolean __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_is_ok"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_free"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); + LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - COption_FilterZ_free(_res_conv); + CResult_Bolt12RefundContextDecodeErrorZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) { - LDKLockedChannelMonitor 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 LDKLockedChannelMonitor - - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); +static inline uint64_t CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() { - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); +uint64_t __attribute__((export_name("TS_CResult_Bolt12RefundContextDecodeErrorZ_clone"))) TS_CResult_Bolt12RefundContextDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* orig_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(orig); + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) { - LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); +uint64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_ok"))) TS_CResult_StrSecp256k1ErrorZ_ok(jstring o) { + LDKStr o_conv = str_ref_to_owned_c(o); + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = CResult_StrSecp256k1ErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_err"))) TS_CResult_StrSecp256k1ErrorZ_err(uint32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e); + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = CResult_StrSecp256k1ErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_is_ok"))) TS_CResult_StrSecp256k1ErrorZ_is_ok(uint64_t o) { + LDKCResult_StrSecp256k1ErrorZ* o_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_StrSecp256k1ErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) { +void __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_free"))) TS_CResult_StrSecp256k1ErrorZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); + LDKCResult_StrSecp256k1ErrorZ _res_conv = *(LDKCResult_StrSecp256k1ErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_LockedChannelMonitorNoneZ_free(_res_conv); + CResult_StrSecp256k1ErrorZ_free(_res_conv); } -void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_free(uint64_tArray _res) { - LDKCVec_OutPointZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ 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]; - LDKOutPoint _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_OutPointZ_free(_res_constr); +static inline uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg) { + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = CResult_StrSecp256k1ErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_clone_ptr"))) TS_CResult_StrSecp256k1ErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_StrSecp256k1ErrorZ* arg_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_StrSecp256k1ErrorZ_clone_ptr(arg_conv); + return ret_conv; } -void __attribute__((export_name("TS_CVec_MonitorUpdateIdZ_free"))) TS_CVec_MonitorUpdateIdZ_free(uint64_tArray _res) { - LDKCVec_MonitorUpdateIdZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - uint64_t _res_conv_17 = _res_vals[r]; - LDKMonitorUpdateId _res_conv_17_conv; - _res_conv_17_conv.inner = untag_ptr(_res_conv_17); - _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); - _res_constr.data[r] = _res_conv_17_conv; - } - FREE(_res); - CVec_MonitorUpdateIdZ_free(_res_constr); +uint64_t __attribute__((export_name("TS_CResult_StrSecp256k1ErrorZ_clone"))) TS_CResult_StrSecp256k1ErrorZ_clone(uint64_t orig) { + LDKCResult_StrSecp256k1ErrorZ* orig_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(orig); + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = CResult_StrSecp256k1ErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); +static inline uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(arg); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(uint64_t arg) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(uint64_t arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(uint64_t orig) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); +uint64_t __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(uint64_t orig) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* orig_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(orig); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(uint64_t a, uint64_tArray b) { - LDKOutPoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = OutPoint_clone(&a_conv); - LDKCVec_MonitorUpdateIdZ b_constr; - b_constr.datalen = b->arr_len; - if (b_constr.datalen > 0) - b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); - else - b_constr.data = NULL; - uint64_t* b_vals = b->elems; - for (size_t r = 0; r < b_constr.datalen; r++) { - uint64_t b_conv_17 = b_vals[r]; - LDKMonitorUpdateId b_conv_17_conv; - b_conv_17_conv.inner = untag_ptr(b_conv_17); - b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); - b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); - b_constr.data[r] = b_conv_17_conv; - } - FREE(b); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); +uint64_t __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, uint64_t b, uint64_t c) { + LDKThirtyTwoBytes a_ref; + CHECK(a->arr_len == 32); + memcpy(a_ref.data, a->elems, 32); FREE(a); + 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 = RecipientOnionFields_clone(&b_conv); + LDKRouteParameters 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 = RouteParameters_clone(&c_conv); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ), "LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ"); + *ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(a_ref, b_conv, c_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(uint64_t _res) { +void __attribute__((export_name("TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free"))) TS_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(uint64_t _res) { if (!ptr_is_owned(_res)) return; void* _res_ptr = untag_ptr(_res); CHECK_ACCESS(_res_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ _res_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(_res_ptr); FREE(untag_ptr(_res)); - C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); } -void __attribute__((export_name("TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free"))) TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(uint64_tArray _res) { - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; - _res_constr.datalen = _res->arr_len; - if (_res_constr.datalen > 0) - _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); - else - _res_constr.data = NULL; - uint64_t* _res_vals = _res->elems; - for (size_t p = 0; p < _res_constr.datalen; p++) { - uint64_t _res_conv_41 = _res_vals[p]; - void* _res_conv_41_ptr = untag_ptr(_res_conv_41); - CHECK_ACCESS(_res_conv_41_ptr); - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); - FREE(untag_ptr(_res_conv_41)); - _res_constr.data[p] = _res_conv_41_conv; - } - FREE(_res); - CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); +uint64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o_conv = *(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)(o_ptr); + o_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone((LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(o)); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_APIError_free"))) TS_APIError_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); - LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - APIError_free(this_ptr_conv); +uint64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err() { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); + return tag_ptr(ret_conv, true); } -static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) { - LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg); - int64_t ret_conv = APIError_clone_ptr(arg_conv); +jboolean __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(uint64_t o) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(uint64_t orig) { - LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ _res_conv = *(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_apimisuse_error(err_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +static inline uint64_t CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* arg_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone"))) TS_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(uint64_t orig) { + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* orig_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(orig); + LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); + *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_APIError_invalid_route"))) TS_APIError_invalid_route(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_invalid_route(err_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKTxOut o_conv = *(LDKTxOut*)(o_ptr); + o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o)); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) { - LDKStr err_conv = str_ref_to_owned_c(err); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_channel_unavailable(err_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_err"))) TS_CResult_TxOutUtxoLookupErrorZ_err(uint32_t e) { + LDKUtxoLookupError e_conv = LDKUtxoLookupError_from_js(e); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_APIError_monitor_update_in_progress"))) TS_APIError_monitor_update_in_progress() { - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_monitor_update_in_progress(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_is_ok"))) TS_CResult_TxOutUtxoLookupErrorZ_is_ok(uint64_t o) { + LDKCResult_TxOutUtxoLookupErrorZ* o_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TxOutUtxoLookupErrorZ_is_ok(o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) { - LDKShutdownScript script_conv; - script_conv.inner = untag_ptr(script); - script_conv.is_owned = ptr_is_owned(script); - CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); - script_conv = ShutdownScript_clone(&script_conv); - LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); - *ret_copy = APIError_incompatible_shutdown_script(script_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_free"))) TS_CResult_TxOutUtxoLookupErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TxOutUtxoLookupErrorZ _res_conv = *(LDKCResult_TxOutUtxoLookupErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TxOutUtxoLookupErrorZ_free(_res_conv); } -jboolean __attribute__((export_name("TS_APIError_eq"))) TS_APIError_eq(uint64_t a, uint64_t b) { - LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); - LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); - jboolean ret_conv = APIError_eq(a_conv, b_conv); +static inline uint64_t CResult_TxOutUtxoLookupErrorZ_clone_ptr(LDKCResult_TxOutUtxoLookupErrorZ *NONNULL_PTR arg) { + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_clone_ptr"))) TS_CResult_TxOutUtxoLookupErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_TxOutUtxoLookupErrorZ* arg_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TxOutUtxoLookupErrorZ_clone_ptr(arg_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_APIError_write"))) TS_APIError_write(uint64_t obj) { - LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj); - LDKCVec_u8Z ret_var = APIError_write(obj_conv); - int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); - memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); - CVec_u8Z_free(ret_var); - return ret_arr; +uint64_t __attribute__((export_name("TS_CResult_TxOutUtxoLookupErrorZ_clone"))) TS_CResult_TxOutUtxoLookupErrorZ_clone(uint64_t orig) { + LDKCResult_TxOutUtxoLookupErrorZ* orig_conv = (LDKCResult_TxOutUtxoLookupErrorZ*)untag_ptr(orig); + LDKCResult_TxOutUtxoLookupErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutUtxoLookupErrorZ), "LDKCResult_TxOutUtxoLookupErrorZ"); + *ret_conv = CResult_TxOutUtxoLookupErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_APIError_read"))) TS_APIError_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ"); - *ret_conv = APIError_read(ser_ref); - FREE(ser); +static inline uint64_t C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR arg) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(arg); return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(uint64_t arg) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* arg_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone_ptr(arg_conv); + return ret_conv; +} -void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) { - LDKBigSize this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - BigSize_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(uint64_t orig) { + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* orig_conv = (LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(orig); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) { - LDKBigSize this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = BigSize_get_a(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(int8_tArray a, uint64_t b, uint64_t c) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKOnionMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv = OnionMessage_clone(&b_conv); + void* c_ptr = untag_ptr(c); + CHECK_ACCESS(c_ptr); + LDKCOption_CVec_SocketAddressZZ c_conv = *(LDKCOption_CVec_SocketAddressZZ*)(c_ptr); + c_conv = COption_CVec_SocketAddressZZ_clone((LDKCOption_CVec_SocketAddressZZ*)untag_ptr(c)); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ), "LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ"); + *ret_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(a_ref, b_conv, c_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) { - LDKBigSize this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - BigSize_set_a(&this_ptr_conv, val); +void __attribute__((export_name("TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free"))) TS_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ _res_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_free(_res_conv); } -uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) { - LDKBigSize ret_var = BigSize_new(a_arg); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +uint64_t __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o_conv = *(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)(o_ptr); + o_conv = C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_clone((LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ*)untag_ptr(o)); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -static inline uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg) { - LDKBigSize ret_var = BigSize_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_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(uint64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_BigSize_clone_ptr"))) TS_BigSize_clone_ptr(uint64_t arg) { - LDKBigSize 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 = BigSize_clone_ptr(&arg_conv); + +jboolean __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(uint64_t o) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* o_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(o_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_BigSize_clone"))) TS_BigSize_clone(uint64_t orig) { - LDKBigSize 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; - LDKBigSize ret_var = BigSize_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_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res_conv = *(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_conv); } -int64_t __attribute__((export_name("TS_BigSize_hash"))) TS_BigSize_hash(uint64_t o) { - LDKBigSize 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 = BigSize_hash(&o_conv); - return ret_conv; +static inline uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -jboolean __attribute__((export_name("TS_BigSize_eq"))) TS_BigSize_eq(uint64_t a, uint64_t b) { - LDKBigSize 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; - LDKBigSize 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 = BigSize_eq(&a_conv, &b_conv); +int64_t __attribute__((export_name("TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* arg_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_BigSize_write"))) TS_BigSize_write(uint64_t obj) { - LDKBigSize 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 = BigSize_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_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone"))) TS_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(uint64_t orig) { + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* orig_conv = (LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ*)untag_ptr(orig); + LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_BigSize_read"))) TS_BigSize_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); - *ret_conv = BigSize_read(ser_ref); - FREE(ser); +uint64_t __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_ok"))) TS_CResult_PeeledOnionNoneZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKPeeledOnion o_conv = *(LDKPeeledOnion*)(o_ptr); + o_conv = PeeledOnion_clone((LDKPeeledOnion*)untag_ptr(o)); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) { - LDKHostname 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); - Hostname_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_err"))) TS_CResult_PeeledOnionNoneZ_err() { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_err(); + return tag_ptr(ret_conv, true); } -static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) { - LDKHostname ret_var = Hostname_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_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) { - LDKHostname 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 = Hostname_clone_ptr(&arg_conv); +jboolean __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_is_ok"))) TS_CResult_PeeledOnionNoneZ_is_ok(uint64_t o) { + LDKCResult_PeeledOnionNoneZ* o_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_PeeledOnionNoneZ_is_ok(o_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) { - LDKHostname 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; - LDKHostname ret_var = Hostname_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_CResult_PeeledOnionNoneZ_free"))) TS_CResult_PeeledOnionNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PeeledOnionNoneZ _res_conv = *(LDKCResult_PeeledOnionNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PeeledOnionNoneZ_free(_res_conv); } -int64_t __attribute__((export_name("TS_Hostname_hash"))) TS_Hostname_hash(uint64_t o) { - LDKHostname 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 = Hostname_hash(&o_conv); - return ret_conv; +static inline uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg) { + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(arg); + return tag_ptr(ret_conv, true); } - -jboolean __attribute__((export_name("TS_Hostname_eq"))) TS_Hostname_eq(uint64_t a, uint64_t b) { - LDKHostname a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHostname b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); +int64_t __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_clone_ptr"))) TS_CResult_PeeledOnionNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); return ret_conv; } -int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) { - LDKHostname this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_t ret_conv = Hostname_len(&this_arg_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_PeeledOnionNoneZ_clone"))) TS_CResult_PeeledOnionNoneZ_clone(uint64_t orig) { + LDKCResult_PeeledOnionNoneZ* orig_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(orig); + LDKCResult_PeeledOnionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PeeledOnionNoneZ), "LDKCResult_PeeledOnionNoneZ"); + *ret_conv = CResult_PeeledOnionNoneZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_Hostname_write"))) TS_Hostname_write(uint64_t obj) { - LDKHostname 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 = Hostname_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_SendSuccessSendErrorZ_ok"))) TS_CResult_SendSuccessSendErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKSendSuccess o_conv = *(LDKSendSuccess*)(o_ptr); + o_conv = SendSuccess_clone((LDKSendSuccess*)untag_ptr(o)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_Hostname_read"))) TS_Hostname_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); - *ret_conv = Hostname_read(ser_ref); - FREE(ser); +uint64_t __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_err"))) TS_CResult_SendSuccessSendErrorZ_err(uint64_t e) { + void* e_ptr = untag_ptr(e); + CHECK_ACCESS(e_ptr); + LDKSendError e_conv = *(LDKSendError*)(e_ptr); + e_conv = SendError_clone((LDKSendError*)untag_ptr(e)); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_err(e_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_TransactionU16LenLimited_free"))) TS_TransactionU16LenLimited_free(uint64_t this_obj) { - LDKTransactionU16LenLimited 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); - TransactionU16LenLimited_free(this_obj_conv); +jboolean __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_is_ok"))) TS_CResult_SendSuccessSendErrorZ_is_ok(uint64_t o) { + LDKCResult_SendSuccessSendErrorZ* o_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_SendSuccessSendErrorZ_is_ok(o_conv); + return ret_conv; } -static inline uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg) { - LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_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_CResult_SendSuccessSendErrorZ_free"))) TS_CResult_SendSuccessSendErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_SendSuccessSendErrorZ _res_conv = *(LDKCResult_SendSuccessSendErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_SendSuccessSendErrorZ_free(_res_conv); } -int64_t __attribute__((export_name("TS_TransactionU16LenLimited_clone_ptr"))) TS_TransactionU16LenLimited_clone_ptr(uint64_t arg) { - LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_clone_ptr(&arg_conv); + +static inline uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg) { + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_SendSuccessSendErrorZ_clone_ptr"))) TS_CResult_SendSuccessSendErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_TransactionU16LenLimited_clone"))) TS_TransactionU16LenLimited_clone(uint64_t orig) { - LDKTransactionU16LenLimited 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; - LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_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_CResult_SendSuccessSendErrorZ_clone"))) TS_CResult_SendSuccessSendErrorZ_clone(uint64_t orig) { + LDKCResult_SendSuccessSendErrorZ* orig_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(orig); + LDKCResult_SendSuccessSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SendSuccessSendErrorZ), "LDKCResult_SendSuccessSendErrorZ"); + *ret_conv = CResult_SendSuccessSendErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_TransactionU16LenLimited_hash"))) TS_TransactionU16LenLimited_hash(uint64_t o) { - LDKTransactionU16LenLimited o_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.is_owned = false; - int64_t ret_conv = TransactionU16LenLimited_hash(&o_conv); - return ret_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); } -jboolean __attribute__((export_name("TS_TransactionU16LenLimited_eq"))) TS_TransactionU16LenLimited_eq(uint64_t a, uint64_t b) { - LDKTransactionU16LenLimited 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; - LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_eq(&a_conv, &b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_BlindedPathNoneZ_err"))) TS_CResult_BlindedPathNoneZ_err() { + LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); + *ret_conv = CResult_BlindedPathNoneZ_err(); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_TransactionU16LenLimited_new"))) TS_TransactionU16LenLimited_new(int8_tArray transaction) { - 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; - LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); - *ret_conv = TransactionU16LenLimited_new(transaction_ref); - 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; } -int8_tArray __attribute__((export_name("TS_TransactionU16LenLimited_into_transaction"))) TS_TransactionU16LenLimited_into_transaction(uint64_t this_arg) { - LDKTransactionU16LenLimited this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = TransactionU16LenLimited_clone(&this_arg_conv); - LDKTransaction ret_var = TransactionU16LenLimited_into_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; +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); } -int8_tArray __attribute__((export_name("TS_TransactionU16LenLimited_write"))) TS_TransactionU16LenLimited_write(uint64_t obj) { - LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_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 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_TransactionU16LenLimited_read"))) TS_TransactionU16LenLimited_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); - *ret_conv = TransactionU16LenLimited_read(ser_ref); - FREE(ser); +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_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); - *ret_conv = sign(msg_ref, sk_ref); - FREE(msg); +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ o_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(o_ptr); + o_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(o)); + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); + *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - LDKStr sig_conv = str_ref_to_owned_c(sig); - LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); - *ret_conv = recover_pk(msg_ref, sig_conv); - FREE(msg); +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err() { + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); + *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_err(); return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) { - LDKu8slice msg_ref; - msg_ref.datalen = msg->arr_len; - msg_ref.data = msg->elems; - LDKStr sig_conv = str_ref_to_owned_c(sig); - LDKPublicKey pk_ref; - CHECK(pk->arr_len == 33); - memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); - jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); - FREE(msg); +jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(uint64_t o) { + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* o_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_is_ok(o_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) { - LDKu8slice hrp_bytes_ref; - hrp_bytes_ref.datalen = hrp_bytes->arr_len; - hrp_bytes_ref.data = hrp_bytes->elems; - LDKCVec_U5Z data_without_signature_constr; - data_without_signature_constr.datalen = data_without_signature->arr_len; - if (data_without_signature_constr.datalen > 0) - data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); - else - data_without_signature_constr.data = NULL; - int8_t* data_without_signature_vals = (void*) data_without_signature->elems; - for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { - int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; - - data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 }; - } - FREE(data_without_signature); - LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); - 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); - FREE(hrp_bytes); - return ret_arr; +void __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ _res_conv = *(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_free(_res_conv); } -void __attribute__((export_name("TS_KVStore_free"))) TS_KVStore_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); - LDKKVStore this_ptr_conv = *(LDKKVStore*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - KVStore_free(this_ptr_conv); +static inline uint64_t CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ *NONNULL_PTR arg) { + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); + *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(arg); + return tag_ptr(ret_conv, true); } - -void __attribute__((export_name("TS_Persister_free"))) TS_Persister_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); - LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Persister_free(this_ptr_conv); +int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(uint64_t arg) { + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* arg_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone_ptr(arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_read_channel_monitors"))) TS_read_channel_monitors(uint64_t kv_store, uint64_t entropy_source, uint64_t signer_provider) { - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_conv); - } - 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* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = read_channel_monitors(kv_store_conv, entropy_source_conv, signer_provider_conv); +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone"))) TS_CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(uint64_t orig) { + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* orig_conv = (LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ*)untag_ptr(orig); + LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); + *ret_conv = CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_clone(orig_conv); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_MonitorUpdatingPersister_free"))) TS_MonitorUpdatingPersister_free(uint64_t this_obj) { - LDKMonitorUpdatingPersister 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); - MonitorUpdatingPersister_free(this_obj_conv); -} - -uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_new"))) TS_MonitorUpdatingPersister_new(uint64_t kv_store, uint64_t logger, int64_t maximum_pending_updates, uint64_t entropy_source, uint64_t signer_provider) { - void* kv_store_ptr = untag_ptr(kv_store); - CHECK_ACCESS(kv_store_ptr); - LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); - if (kv_store_conv.free == LDKKVStore_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKKVStore_JCalls_cloned(&kv_store_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* 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* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); +void __attribute__((export_name("TS_CVec_ForwardNodeZ_free"))) TS_CVec_ForwardNodeZ_free(uint64_tArray _res) { + LDKCVec_ForwardNodeZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKForwardNode), "LDKCVec_ForwardNodeZ 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]; + LDKForwardNode _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; } - LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + FREE(_res); + CVec_ForwardNodeZ_free(_res_constr); } -uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_read_all_channel_monitors_with_updates"))) TS_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(uint64_t this_arg, uint64_t broadcaster, uint64_t fee_estimator) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); +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_MonitorUpdatingPersister_read_channel_monitor_with_updates"))) TS_MonitorUpdatingPersister_read_channel_monitor_with_updates(uint64_t this_arg, uint64_t broadcaster, uint64_t fee_estimator, jstring monitor_key) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); - LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); +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); } -uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_cleanup_stale_updates"))) TS_MonitorUpdatingPersister_cleanup_stale_updates(uint64_t this_arg, jboolean lazy) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = MonitorUpdatingPersister_cleanup_stale_updates(&this_arg_conv, lazy); - 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; } -uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_as_Persist"))) TS_MonitorUpdatingPersister_as_Persist(uint64_t this_arg) { - LDKMonitorUpdatingPersister this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *ret_ret = MonitorUpdatingPersister_as_Persist(&this_arg_conv); - return tag_ptr(ret_ret, true); +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); } -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); - UntrustedString_free(this_obj_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); } - -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 = UntrustedString_get_a(&this_ptr_conv); - jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); - Str_free(ret_str); +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; } -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); - UntrustedString_set_a(&this_ptr_conv, val_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_UntrustedString_new"))) TS_UntrustedString_new(jstring a_arg) { - LDKStr a_arg_conv = str_ref_to_owned_c(a_arg); - 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; +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); } -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; +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); } -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); + +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; } -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; +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); } -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; +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_UntrustedString_hash"))) TS_UntrustedString_hash(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.is_owned = false; - int64_t ret_conv = UntrustedString_hash(&o_conv); +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; } -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_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_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); +uint64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_ok"))) TS_CResult_InvoiceErrorDecodeErrorZ_ok(uint64_t o) { + LDKInvoiceError 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 = InvoiceError_clone(&o_conv); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_ok(o_conv); 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); +uint64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_err"))) TS_CResult_InvoiceErrorDecodeErrorZ_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_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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); +jboolean __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_is_ok"))) TS_CResult_InvoiceErrorDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_InvoiceErrorDecodeErrorZ* o_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceErrorDecodeErrorZ_is_ok(o_conv); 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); +void __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_free"))) TS_CResult_InvoiceErrorDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_InvoiceErrorDecodeErrorZ _res_conv = *(LDKCResult_InvoiceErrorDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_InvoiceErrorDecodeErrorZ_free(_res_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; +static inline uint64_t CResult_InvoiceErrorDecodeErrorZ_clone_ptr(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceErrorDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_InvoiceErrorDecodeErrorZ* arg_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; } -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); +uint64_t __attribute__((export_name("TS_CResult_InvoiceErrorDecodeErrorZ_clone"))) TS_CResult_InvoiceErrorDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_InvoiceErrorDecodeErrorZ* orig_conv = (LDKCResult_InvoiceErrorDecodeErrorZ*)untag_ptr(orig); + LDKCResult_InvoiceErrorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceErrorDecodeErrorZ), "LDKCResult_InvoiceErrorDecodeErrorZ"); + *ret_conv = CResult_InvoiceErrorDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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); +uint64_t __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_ok"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_ok(uint64_t o) { + LDKTrackedSpendableOutput 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 = TrackedSpendableOutput_clone(&o_conv); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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; +uint64_t __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_err"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_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_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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); + +jboolean __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_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_CResult_TrackedSpendableOutputDecodeErrorZ_free"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_TrackedSpendableOutputDecodeErrorZ _res_conv = *(LDKCResult_TrackedSpendableOutputDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_TrackedSpendableOutputDecodeErrorZ_free(_res_conv); } -void __attribute__((export_name("TS_Future_register_callback_fn"))) TS_Future_register_callback_fn(uint64_t this_arg, uint64_t callback) { - LDKFuture this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - void* callback_ptr = untag_ptr(callback); - CHECK_ACCESS(callback_ptr); - LDKFutureCallback callback_conv = *(LDKFutureCallback*)(callback_ptr); - if (callback_conv.free == LDKFutureCallback_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFutureCallback_JCalls_cloned(&callback_conv); - } - Future_register_callback_fn(&this_arg_conv, callback_conv); +static inline uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -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)); +int64_t __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_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; +uint64_t __attribute__((export_name("TS_CResult_TrackedSpendableOutputDecodeErrorZ_clone"))) TS_CResult_TrackedSpendableOutputDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* orig_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(orig); + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() { - uint32_t ret_conv = LDKLevel_to_js(Level_trace()); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_ok"))) TS_CResult_OutputSpendStatusDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKOutputSpendStatus o_conv = *(LDKOutputSpendStatus*)(o_ptr); + o_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(o)); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() { - uint32_t ret_conv = LDKLevel_to_js(Level_debug()); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_err"))) TS_CResult_OutputSpendStatusDecodeErrorZ_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_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() { - uint32_t ret_conv = LDKLevel_to_js(Level_info()); +jboolean __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_is_ok"))) TS_CResult_OutputSpendStatusDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); return ret_conv; } -uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() { - uint32_t ret_conv = LDKLevel_to_js(Level_warn()); - return ret_conv; +void __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_free"))) TS_CResult_OutputSpendStatusDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSpendStatusDecodeErrorZ _res_conv = *(LDKCResult_OutputSpendStatusDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSpendStatusDecodeErrorZ_free(_res_conv); } -uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() { - uint32_t ret_conv = LDKLevel_to_js(Level_error()); +static inline uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr"))) TS_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) { - LDKLevel* a_conv = (LDKLevel*)untag_ptr(a); - LDKLevel* b_conv = (LDKLevel*)untag_ptr(b); - jboolean ret_conv = Level_eq(a_conv, b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_OutputSpendStatusDecodeErrorZ_clone"))) TS_CResult_OutputSpendStatusDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_OutputSpendStatusDecodeErrorZ* orig_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(orig); + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) { - LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); - int64_t ret_conv = Level_hash(o_conv); - return ret_conv; +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); + LDKFilter o_conv = *(LDKFilter*)(o_ptr); + if (o_conv.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&o_conv); + } + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_some(o_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() { - uint32_t ret_conv = LDKLevel_to_js(Level_max()); - return ret_conv; +uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() { + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_none(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) { - LDKRecord 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); - Record_free(this_obj_conv); +void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr); + FREE(untag_ptr(_res)); + COption_FilterZ_free(_res_conv); } -uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = LDKLevel_to_js(Record_get_level(&this_ptr_conv)); - return ret_conv; +void __attribute__((export_name("TS_CVec_TrackedSpendableOutputZ_free"))) TS_CVec_TrackedSpendableOutputZ_free(uint64_tArray _res) { + LDKCVec_TrackedSpendableOutputZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTrackedSpendableOutput), "LDKCVec_TrackedSpendableOutputZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t y = 0; y < _res_constr.datalen; y++) { + uint64_t _res_conv_24 = _res_vals[y]; + LDKTrackedSpendableOutput _res_conv_24_conv; + _res_conv_24_conv.inner = untag_ptr(_res_conv_24); + _res_conv_24_conv.is_owned = ptr_is_owned(_res_conv_24); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_24_conv); + _res_constr.data[y] = _res_conv_24_conv; + } + FREE(_res); + CVec_TrackedSpendableOutputZ_free(_res_constr); } -void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKLevel val_conv = LDKLevel_from_js(val); - Record_set_level(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_CResult_OutputSweeperDecodeErrorZ_ok"))) TS_CResult_OutputSweeperDecodeErrorZ_ok(uint64_t o) { + LDKOutputSweeper 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 LDKOutputSweeper + + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_Record_get_peer_id"))) TS_Record_get_peer_id(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, Record_get_peer_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; +uint64_t __attribute__((export_name("TS_CResult_OutputSweeperDecodeErrorZ_err"))) TS_CResult_OutputSweeperDecodeErrorZ_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_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = CResult_OutputSweeperDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Record_set_peer_id"))) TS_Record_set_peer_id(uint64_t this_ptr, int8_tArray val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - Record_set_peer_id(&this_ptr_conv, val_ref); +jboolean __attribute__((export_name("TS_CResult_OutputSweeperDecodeErrorZ_is_ok"))) TS_CResult_OutputSweeperDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Record_get_channel_id"))) TS_Record_get_channel_id(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = Record_get_channel_id(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_CResult_OutputSweeperDecodeErrorZ_free"))) TS_CResult_OutputSweeperDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_OutputSweeperDecodeErrorZ _res_conv = *(LDKCResult_OutputSweeperDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_OutputSweeperDecodeErrorZ_free(_res_conv); } -void __attribute__((export_name("TS_Record_set_channel_id"))) TS_Record_set_channel_id(uint64_t this_ptr, uint64_t val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - Record_set_channel_id(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_C2Tuple_BestBlockOutputSweeperZ_new"))) TS_C2Tuple_BestBlockOutputSweeperZ_new(uint64_t a, uint64_t b) { + LDKBestBlock a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = BestBlock_clone(&a_conv); + LDKOutputSweeper b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + // WARNING: we need a move here but no clone is available for LDKOutputSweeper + + LDKC2Tuple_BestBlockOutputSweeperZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BestBlockOutputSweeperZ), "LDKC2Tuple_BestBlockOutputSweeperZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); } -jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Record_get_args(&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_C2Tuple_BestBlockOutputSweeperZ_free"))) TS_C2Tuple_BestBlockOutputSweeperZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ _res_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_BestBlockOutputSweeperZ_free(_res_conv); } -void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - Record_set_args(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(uint64_t o) { + void* o_ptr = untag_ptr(o); + CHECK_ACCESS(o_ptr); + LDKC2Tuple_BestBlockOutputSweeperZ o_conv = *(LDKC2Tuple_BestBlockOutputSweeperZ*)(o_ptr); + // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BestBlockOutputSweeperZ + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Record_get_module_path(&this_ptr_conv); - jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_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_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - Record_set_module_path(&this_ptr_conv, val_conv); +jboolean __attribute__((export_name("TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Record_get_file(&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_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(_res_conv); } -void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - Record_set_file(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(uint64_t o) { + LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_clone(&o_conv); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Record_get_line(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_err"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_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_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) { - LDKRecord this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Record_set_line(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Record_new"))) TS_Record_new(uint32_t level_arg, int8_tArray peer_id_arg, uint64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { - LDKLevel level_arg_conv = LDKLevel_from_js(level_arg); - LDKPublicKey peer_id_arg_ref; - CHECK(peer_id_arg->arr_len == 33); - memcpy(peer_id_arg_ref.compressed_form, peer_id_arg->elems, 33); FREE(peer_id_arg); - void* channel_id_arg_ptr = untag_ptr(channel_id_arg); - CHECK_ACCESS(channel_id_arg_ptr); - LDKCOption_ThirtyTwoBytesZ channel_id_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(channel_id_arg_ptr); - channel_id_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(channel_id_arg)); - LDKStr args_arg_conv = str_ref_to_owned_c(args_arg); - LDKStr module_path_arg_conv = str_ref_to_owned_c(module_path_arg); - LDKStr file_arg_conv = str_ref_to_owned_c(file_arg); - LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_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_CResult_DelayedPaymentBasepointDecodeErrorZ_free"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DelayedPaymentBasepointDecodeErrorZ_free(_res_conv); } -static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { - LDKRecord ret_var = Record_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; +static inline uint64_t CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) { - LDKRecord 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 = Record_clone_ptr(&arg_conv); +int64_t __attribute__((export_name("TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) { - LDKRecord 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; - LDKRecord ret_var = Record_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_CResult_DelayedPaymentBasepointDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentBasepointDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Logger_free"))) TS_Logger_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); - LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Logger_free(this_ptr_conv); +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_ok(uint64_t o) { + LDKDelayedPaymentKey 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 = DelayedPaymentKey_clone(&o_conv); + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) { - LDKChannelHandshakeConfig 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); - ChannelHandshakeConfig_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_err"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_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_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); +jboolean __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); +void __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_free"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_DelayedPaymentKeyDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_DelayedPaymentKeyDecodeErrorZ_free(_res_conv); } -int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(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_to_self_delay(&this_ptr_conv); +static inline uint64_t CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_to_self_delay"))) TS_ChannelHandshakeConfig_set_our_to_self_delay(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_to_self_delay(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentKeyDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = CResult_DelayedPaymentKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(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; - int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_ok"))) TS_CResult_HtlcBasepointDecodeErrorZ_ok(uint64_t o) { + LDKHtlcBasepoint 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 = HtlcBasepoint_clone(&o_conv); + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_set_our_htlc_minimum_msat(uint64_t this_ptr, int64_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_htlc_minimum_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_err"))) TS_CResult_HtlcBasepointDecodeErrorZ_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_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int8_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel"))) TS_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(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; - int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); +jboolean __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_is_ok"))) TS_CResult_HtlcBasepointDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_HtlcBasepointDecodeErrorZ* o_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HtlcBasepointDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel"))) TS_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(uint64_t this_ptr, int8_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_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); +void __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_free"))) TS_CResult_HtlcBasepointDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HtlcBasepointDecodeErrorZ _res_conv = *(LDKCResult_HtlcBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HtlcBasepointDecodeErrorZ_free(_res_conv); } -jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(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; - jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); +static inline uint64_t CResult_HtlcBasepointDecodeErrorZ_clone_ptr(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_clone_ptr"))) TS_CResult_HtlcBasepointDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_HtlcBasepointDecodeErrorZ* arg_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean 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_negotiate_scid_privacy(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_HtlcBasepointDecodeErrorZ_clone"))) TS_CResult_HtlcBasepointDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_HtlcBasepointDecodeErrorZ* orig_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = CResult_HtlcBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(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; - jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_ok"))) TS_CResult_HtlcKeyDecodeErrorZ_ok(uint64_t o) { + LDKHtlcKey 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 = HtlcKey_clone(&o_conv); + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean 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_announced_channel(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_err"))) TS_CResult_HtlcKeyDecodeErrorZ_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_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(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; - jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); +jboolean __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_is_ok"))) TS_CResult_HtlcKeyDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_HtlcKeyDecodeErrorZ* o_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_HtlcKeyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean 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_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); -} - -int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(uint64_t this_ptr) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv); - return ret_conv; +void __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_free"))) TS_CResult_HtlcKeyDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_HtlcKeyDecodeErrorZ _res_conv = *(LDKCResult_HtlcKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_HtlcKeyDecodeErrorZ_free(_res_conv); } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(uint64_t this_ptr, int32_t val) { - LDKChannelHandshakeConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val); +static inline uint64_t CResult_HtlcKeyDecodeErrorZ_clone_ptr(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); } - -jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx"))) TS_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(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; - jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv); +int64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_clone_ptr"))) TS_CResult_HtlcKeyDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_HtlcKeyDecodeErrorZ* arg_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_HtlcKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx"))) TS_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(uint64_t this_ptr, jboolean 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_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_HtlcKeyDecodeErrorZ_clone"))) TS_CResult_HtlcKeyDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_HtlcKeyDecodeErrorZ* orig_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = CResult_HtlcKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -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; +uint64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_ok"))) TS_CResult_RevocationBasepointDecodeErrorZ_ok(uint64_t o) { + LDKRevocationBasepoint 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 = RevocationBasepoint_clone(&o_conv); + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -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_CResult_RevocationBasepointDecodeErrorZ_err"))) TS_CResult_RevocationBasepointDecodeErrorZ_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_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -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, jboolean negotiate_anchors_zero_fee_htlc_tx_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, negotiate_anchors_zero_fee_htlc_tx_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); - return ret_ref; +jboolean __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_is_ok"))) TS_CResult_RevocationBasepointDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_RevocationBasepointDecodeErrorZ* o_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevocationBasepointDecodeErrorZ_is_ok(o_conv); + return ret_conv; } -static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_CResult_RevocationBasepointDecodeErrorZ_free"))) TS_CResult_RevocationBasepointDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RevocationBasepointDecodeErrorZ _res_conv = *(LDKCResult_RevocationBasepointDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RevocationBasepointDecodeErrorZ_free(_res_conv); } -int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) { - LDKChannelHandshakeConfig 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 = ChannelHandshakeConfig_clone_ptr(&arg_conv); + +static inline uint64_t CResult_RevocationBasepointDecodeErrorZ_clone_ptr(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_RevocationBasepointDecodeErrorZ_clone_ptr"))) TS_CResult_RevocationBasepointDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_RevocationBasepointDecodeErrorZ* arg_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) { - LDKChannelHandshakeConfig 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; - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_CResult_RevocationBasepointDecodeErrorZ_clone"))) TS_CResult_RevocationBasepointDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_RevocationBasepointDecodeErrorZ* orig_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = CResult_RevocationBasepointDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() { - LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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; +uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_ok"))) TS_CResult_RevocationKeyDecodeErrorZ_ok(uint64_t o) { + LDKRevocationKey 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 = RevocationKey_clone(&o_conv); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) { - LDKChannelHandshakeLimits 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); - ChannelHandshakeLimits_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_err"))) TS_CResult_RevocationKeyDecodeErrorZ_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_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); +jboolean __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_is_ok"))) TS_CResult_RevocationKeyDecodeErrorZ_is_ok(uint64_t o) { + LDKCResult_RevocationKeyDecodeErrorZ* o_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RevocationKeyDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); +void __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_free"))) TS_CResult_RevocationKeyDecodeErrorZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_RevocationKeyDecodeErrorZ _res_conv = *(LDKCResult_RevocationKeyDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_RevocationKeyDecodeErrorZ_free(_res_conv); } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); +static inline uint64_t CResult_RevocationKeyDecodeErrorZ_clone_ptr(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR arg) { + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_clone_ptr"))) TS_CResult_RevocationKeyDecodeErrorZ_clone_ptr(uint64_t arg) { + LDKCResult_RevocationKeyDecodeErrorZ* arg_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RevocationKeyDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_RevocationKeyDecodeErrorZ_clone"))) TS_CResult_RevocationKeyDecodeErrorZ_clone(uint64_t orig) { + LDKCResult_RevocationKeyDecodeErrorZ* orig_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(orig); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = CResult_RevocationKeyDecodeErrorZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) { + LDKLockedChannelMonitor 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 LDKLockedChannelMonitor + + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_set_max_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() { + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = CResult_LockedChannelMonitorNoneZ_err(); + return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat"))) TS_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); +jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) { + LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat"))) TS_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); +void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_LockedChannelMonitorNoneZ_free(_res_conv); } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); +static inline uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(arg); + return tag_ptr(ret_conv, true); +} +int64_t __attribute__((export_name("TS_C2Tuple_OutPointChannelIdZ_clone_ptr"))) TS_C2Tuple_OutPointChannelIdZ_clone_ptr(uint64_t arg) { + LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointChannelIdZ_clone"))) TS_C2Tuple_OutPointChannelIdZ_clone(uint64_t orig) { + LDKC2Tuple_OutPointChannelIdZ* orig_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(orig); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointChannelIdZ_new"))) TS_C2Tuple_OutPointChannelIdZ_new(uint64_t a, uint64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKChannelId 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 = ChannelId_clone(&b_conv); + LDKC2Tuple_OutPointChannelIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv = C2Tuple_OutPointChannelIdZ_new(a_conv, b_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_set_min_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); +void __attribute__((export_name("TS_C2Tuple_OutPointChannelIdZ_free"))) TS_C2Tuple_OutPointChannelIdZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointChannelIdZ_free(_res_conv); } -int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); - return ret_conv; +void __attribute__((export_name("TS_CVec_C2Tuple_OutPointChannelIdZZ_free"))) TS_CVec_C2Tuple_OutPointChannelIdZZ_free(uint64_tArray _res) { + LDKCVec_C2Tuple_OutPointChannelIdZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t d = 0; d < _res_constr.datalen; d++) { + uint64_t _res_conv_29 = _res_vals[d]; + void* _res_conv_29_ptr = untag_ptr(_res_conv_29); + CHECK_ACCESS(_res_conv_29_ptr); + LDKC2Tuple_OutPointChannelIdZ _res_conv_29_conv = *(LDKC2Tuple_OutPointChannelIdZ*)(_res_conv_29_ptr); + FREE(untag_ptr(_res_conv_29)); + _res_constr.data[d] = _res_conv_29_conv; + } + FREE(_res); + CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); +void __attribute__((export_name("TS_CVec_MonitorUpdateIdZ_free"))) TS_CVec_MonitorUpdateIdZ_free(uint64_tArray _res) { + LDKCVec_MonitorUpdateIdZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t r = 0; r < _res_constr.datalen; r++) { + uint64_t _res_conv_17 = _res_vals[r]; + LDKMonitorUpdateId _res_conv_17_conv; + _res_conv_17_conv.inner = untag_ptr(_res_conv_17); + _res_conv_17_conv.is_owned = ptr_is_owned(_res_conv_17); + CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_17_conv); + _res_constr.data[r] = _res_conv_17_conv; + } + FREE(_res); + CVec_MonitorUpdateIdZ_free(_res_constr); } -jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); - return ret_conv; +static inline uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(arg); + return tag_ptr(ret_conv, true); } - -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); +int64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(uint64_t arg) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* arg_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(arg_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(uint64_t orig) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* orig_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(orig); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(orig_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(uint64_t a, uint64_tArray b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = OutPoint_clone(&a_conv); + LDKCVec_MonitorUpdateIdZ b_constr; + b_constr.datalen = b->arr_len; + if (b_constr.datalen > 0) + b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorUpdateId), "LDKCVec_MonitorUpdateIdZ Elements"); + else + b_constr.data = NULL; + uint64_t* b_vals = b->elems; + for (size_t r = 0; r < b_constr.datalen; r++) { + uint64_t b_conv_17 = b_vals[r]; + LDKMonitorUpdateId b_conv_17_conv; + b_conv_17_conv.inner = untag_ptr(b_conv_17); + b_conv_17_conv.is_owned = ptr_is_owned(b_conv_17); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv_17_conv); + b_conv_17_conv = MonitorUpdateId_clone(&b_conv_17_conv); + b_constr.data[r] = b_conv_17_conv; + } + FREE(b); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a_conv, b_constr); + return tag_ptr(ret_conv, true); } -int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); - return ret_conv; +void __attribute__((export_name("TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free"))) TS_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(uint64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_ptr); + FREE(untag_ptr(_res)); + C2Tuple_OutPointCVec_MonitorUpdateIdZZ_free(_res_conv); } -void __attribute__((export_name("TS_ChannelHandshakeLimits_set_their_to_self_delay"))) TS_ChannelHandshakeLimits_set_their_to_self_delay(uint64_t this_ptr, int16_t val) { - LDKChannelHandshakeLimits this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); +void __attribute__((export_name("TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free"))) TS_CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(uint64_tArray _res) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ _res_constr; + _res_constr.datalen = _res->arr_len; + if (_res_constr.datalen > 0) + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ Elements"); + else + _res_constr.data = NULL; + uint64_t* _res_vals = _res->elems; + for (size_t p = 0; p < _res_constr.datalen; p++) { + uint64_t _res_conv_41 = _res_vals[p]; + void* _res_conv_41_ptr = untag_ptr(_res_conv_41); + CHECK_ACCESS(_res_conv_41_ptr); + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ _res_conv_41_conv = *(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)(_res_conv_41_ptr); + FREE(untag_ptr(_res_conv_41)); + _res_constr.data[p] = _res_conv_41_conv; + } + FREE(_res); + CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_free(_res_constr); } -uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_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_APIError_free"))) TS_APIError_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); + LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + APIError_free(this_ptr_conv); } -static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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 APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) { - LDKChannelHandshakeLimits 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 = ChannelHandshakeLimits_clone_ptr(&arg_conv); +int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) { + LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg); + int64_t ret_conv = APIError_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) { - LDKChannelHandshakeLimits 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; - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_APIError_clone"))) TS_APIError_clone(uint64_t orig) { + LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() { - LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_apimisuse_error(err_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_MaxDustHTLCExposure_free"))) TS_MaxDustHTLCExposure_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); - LDKMaxDustHTLCExposure this_ptr_conv = *(LDKMaxDustHTLCExposure*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MaxDustHTLCExposure_free(this_ptr_conv); +uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_fee_rate_too_high(err_conv, feerate); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_clone(arg); +uint64_t __attribute__((export_name("TS_APIError_invalid_route"))) TS_APIError_invalid_route(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_invalid_route(err_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_MaxDustHTLCExposure_clone_ptr"))) TS_MaxDustHTLCExposure_clone_ptr(uint64_t arg) { - LDKMaxDustHTLCExposure* arg_conv = (LDKMaxDustHTLCExposure*)untag_ptr(arg); - int64_t ret_conv = MaxDustHTLCExposure_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_clone"))) TS_MaxDustHTLCExposure_clone(uint64_t orig) { - LDKMaxDustHTLCExposure* orig_conv = (LDKMaxDustHTLCExposure*)untag_ptr(orig); - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_clone(orig_conv); +uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) { + LDKStr err_conv = str_ref_to_owned_c(err); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_channel_unavailable(err_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_fixed_limit_msat"))) TS_MaxDustHTLCExposure_fixed_limit_msat(int64_t a) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_fixed_limit_msat(a); +uint64_t __attribute__((export_name("TS_APIError_monitor_update_in_progress"))) TS_APIError_monitor_update_in_progress() { + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_monitor_update_in_progress(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_fee_rate_multiplier"))) TS_MaxDustHTLCExposure_fee_rate_multiplier(int64_t a) { - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = MaxDustHTLCExposure_fee_rate_multiplier(a); +uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) { + LDKShutdownScript script_conv; + script_conv.inner = untag_ptr(script); + script_conv.is_owned = ptr_is_owned(script); + CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv); + script_conv = ShutdownScript_clone(&script_conv); + LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError"); + *ret_copy = APIError_incompatible_shutdown_script(script_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean __attribute__((export_name("TS_MaxDustHTLCExposure_eq"))) TS_MaxDustHTLCExposure_eq(uint64_t a, uint64_t b) { - LDKMaxDustHTLCExposure* a_conv = (LDKMaxDustHTLCExposure*)untag_ptr(a); - LDKMaxDustHTLCExposure* b_conv = (LDKMaxDustHTLCExposure*)untag_ptr(b); - jboolean ret_conv = MaxDustHTLCExposure_eq(a_conv, b_conv); +jboolean __attribute__((export_name("TS_APIError_eq"))) TS_APIError_eq(uint64_t a, uint64_t b) { + LDKAPIError* a_conv = (LDKAPIError*)untag_ptr(a); + LDKAPIError* b_conv = (LDKAPIError*)untag_ptr(b); + jboolean ret_conv = APIError_eq(a_conv, b_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_MaxDustHTLCExposure_write"))) TS_MaxDustHTLCExposure_write(uint64_t obj) { - LDKMaxDustHTLCExposure* obj_conv = (LDKMaxDustHTLCExposure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = MaxDustHTLCExposure_write(obj_conv); +int8_tArray __attribute__((export_name("TS_APIError_write"))) TS_APIError_write(uint64_t obj) { + LDKAPIError* obj_conv = (LDKAPIError*)untag_ptr(obj); + LDKCVec_u8Z ret_var = APIError_write(obj_conv); int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__); memcpy(ret_arr->elems, ret_var.data, ret_var.datalen); CVec_u8Z_free(ret_var); return ret_arr; } -uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_read"))) TS_MaxDustHTLCExposure_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_APIError_read"))) TS_APIError_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_MaxDustHTLCExposureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MaxDustHTLCExposureDecodeErrorZ), "LDKCResult_MaxDustHTLCExposureDecodeErrorZ"); - *ret_conv = MaxDustHTLCExposure_read(ser_ref); + LDKCResult_COption_APIErrorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_APIErrorZDecodeErrorZ), "LDKCResult_COption_APIErrorZDecodeErrorZ"); + *ret_conv = APIError_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) { - LDKChannelConfig this_obj_conv; +void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) { + LDKBigSize this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelConfig_free(this_obj_conv); + BigSize_free(this_obj_conv); } -int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) { - LDKChannelConfig this_ptr_conv; +int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) { + LDKBigSize this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); + int64_t ret_conv = BigSize_get_a(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelConfig_set_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_set_forwarding_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; +void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) { + LDKBigSize this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); + BigSize_set_a(&this_ptr_conv, val); } -int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) { + LDKBigSize ret_var = BigSize_new(a_arg); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_ChannelConfig_set_forwarding_fee_base_msat"))) TS_ChannelConfig_set_forwarding_fee_base_msat(uint64_t this_ptr, int32_t val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); +static inline uint64_t BigSize_clone_ptr(LDKBigSize *NONNULL_PTR arg) { + LDKBigSize ret_var = BigSize_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; } - -int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); +int64_t __attribute__((export_name("TS_BigSize_clone_ptr"))) TS_BigSize_clone_ptr(uint64_t arg) { + LDKBigSize 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 = BigSize_clone_ptr(&arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); -} - -uint64_t __attribute__((export_name("TS_ChannelConfig_get_max_dust_htlc_exposure"))) TS_ChannelConfig_get_max_dust_htlc_exposure(uint64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); - *ret_copy = ChannelConfig_get_max_dust_htlc_exposure(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +uint64_t __attribute__((export_name("TS_BigSize_clone"))) TS_BigSize_clone(uint64_t orig) { + LDKBigSize 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; + LDKBigSize ret_var = BigSize_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_ChannelConfig_set_max_dust_htlc_exposure"))) TS_ChannelConfig_set_max_dust_htlc_exposure(uint64_t this_ptr, uint64_t val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - LDKMaxDustHTLCExposure val_conv = *(LDKMaxDustHTLCExposure*)(val_ptr); - val_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(val)); - ChannelConfig_set_max_dust_htlc_exposure(&this_ptr_conv, val_conv); -} - -int64_t __attribute__((export_name("TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); +int64_t __attribute__((export_name("TS_BigSize_hash"))) TS_BigSize_hash(uint64_t o) { + LDKBigSize 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 = BigSize_hash(&o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr, int64_t val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_BigSize_eq"))) TS_BigSize_eq(uint64_t a, uint64_t b) { + LDKBigSize 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; + LDKBigSize 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 = BigSize_eq(&a_conv, &b_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_ChannelConfig_get_accept_underpaying_htlcs"))) TS_ChannelConfig_get_accept_underpaying_htlcs(uint64_t this_ptr) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfig_get_accept_underpaying_htlcs(&this_ptr_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_BigSize_write"))) TS_BigSize_write(uint64_t obj) { + LDKBigSize 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 = BigSize_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_ChannelConfig_set_accept_underpaying_htlcs"))) TS_ChannelConfig_set_accept_underpaying_htlcs(uint64_t this_ptr, jboolean val) { - LDKChannelConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelConfig_set_accept_underpaying_htlcs(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_BigSize_read"))) TS_BigSize_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BigSizeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BigSizeDecodeErrorZ), "LDKCResult_BigSizeDecodeErrorZ"); + *ret_conv = BigSize_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelConfig_new"))) TS_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, uint64_t max_dust_htlc_exposure_arg, int64_t force_close_avoidance_max_fee_satoshis_arg, jboolean accept_underpaying_htlcs_arg) { - void* max_dust_htlc_exposure_arg_ptr = untag_ptr(max_dust_htlc_exposure_arg); - CHECK_ACCESS(max_dust_htlc_exposure_arg_ptr); - LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg_conv = *(LDKMaxDustHTLCExposure*)(max_dust_htlc_exposure_arg_ptr); - max_dust_htlc_exposure_arg_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(max_dust_htlc_exposure_arg)); - LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg_conv, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) { + LDKHostname 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); + Hostname_free(this_obj_conv); } -static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { - LDKChannelConfig ret_var = ChannelConfig_clone(arg); +static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) { + LDKHostname ret_var = Hostname_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_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) { - LDKChannelConfig arg_conv; +int64_t __attribute__((export_name("TS_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) { + LDKHostname 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 = ChannelConfig_clone_ptr(&arg_conv); + int64_t ret_conv = Hostname_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) { - LDKChannelConfig orig_conv; +uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) { + LDKHostname 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; - LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv); + LDKHostname ret_var = Hostname_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_ChannelConfig_eq"))) TS_ChannelConfig_eq(uint64_t a, uint64_t b) { - LDKChannelConfig a_conv; +int64_t __attribute__((export_name("TS_Hostname_hash"))) TS_Hostname_hash(uint64_t o) { + LDKHostname 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 = Hostname_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_Hostname_eq"))) TS_Hostname_eq(uint64_t a, uint64_t b) { + LDKHostname a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKChannelConfig b_conv; + LDKHostname b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); + jboolean ret_conv = Hostname_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelConfig_apply"))) TS_ChannelConfig_apply(uint64_t this_arg, uint64_t update) { - LDKChannelConfig this_arg_conv; +int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) { + LDKHostname this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelConfigUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv.is_owned = false; - ChannelConfig_apply(&this_arg_conv, &update_conv); + int8_t ret_conv = Hostname_len(&this_arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() { - LDKChannelConfig ret_var = ChannelConfig_default(); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +jstring __attribute__((export_name("TS_Hostname_to_str"))) TS_Hostname_to_str(uint64_t o) { + LDKHostname 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; + LDKStr ret_str = Hostname_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) { - LDKChannelConfig obj_conv; +int8_tArray __attribute__((export_name("TS_Hostname_write"))) TS_Hostname_write(uint64_t obj) { + LDKHostname 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 = ChannelConfig_write(&obj_conv); + LDKCVec_u8Z ret_var = Hostname_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_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_Hostname_read"))) TS_Hostname_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); - *ret_conv = ChannelConfig_read(ser_ref); + LDKCResult_HostnameDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HostnameDecodeErrorZ), "LDKCResult_HostnameDecodeErrorZ"); + *ret_conv = Hostname_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelConfigUpdate_free"))) TS_ChannelConfigUpdate_free(uint64_t this_obj) { - LDKChannelConfigUpdate this_obj_conv; +void __attribute__((export_name("TS_TransactionU16LenLimited_free"))) TS_TransactionU16LenLimited_free(uint64_t this_obj) { + LDKTransactionU16LenLimited 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); - ChannelConfigUpdate_free(this_obj_conv); + TransactionU16LenLimited_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t TransactionU16LenLimited_clone_ptr(LDKTransactionU16LenLimited *NONNULL_PTR arg) { + LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_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_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths"))) TS_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(uint64_t this_ptr, uint64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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)); - ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_TransactionU16LenLimited_clone_ptr"))) TS_TransactionU16LenLimited_clone_ptr(uint64_t arg) { + LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_forwarding_fee_base_msat"))) TS_ChannelConfigUpdate_get_forwarding_fee_base_msat(uint64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfigUpdate_get_forwarding_fee_base_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +uint64_t __attribute__((export_name("TS_TransactionU16LenLimited_clone"))) TS_TransactionU16LenLimited_clone(uint64_t orig) { + LDKTransactionU16LenLimited 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; + LDKTransactionU16LenLimited ret_var = TransactionU16LenLimited_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_ChannelConfigUpdate_set_forwarding_fee_base_msat"))) TS_ChannelConfigUpdate_set_forwarding_fee_base_msat(uint64_t this_ptr, uint64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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)); - ChannelConfigUpdate_set_forwarding_fee_base_msat(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_cltv_expiry_delta"))) TS_ChannelConfigUpdate_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelConfigUpdate_get_cltv_expiry_delta(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t __attribute__((export_name("TS_TransactionU16LenLimited_hash"))) TS_TransactionU16LenLimited_hash(uint64_t o) { + LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_hash(&o_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelConfigUpdate_set_cltv_expiry_delta"))) TS_ChannelConfigUpdate_set_cltv_expiry_delta(uint64_t this_ptr, uint64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); - ChannelConfigUpdate_set_cltv_expiry_delta(&this_ptr_conv, val_conv); +jboolean __attribute__((export_name("TS_TransactionU16LenLimited_eq"))) TS_TransactionU16LenLimited_eq(uint64_t a, uint64_t b) { + LDKTransactionU16LenLimited 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; + LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_eq(&a_conv, &b_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat"))) TS_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(uint64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_MaxDustHTLCExposureZ *ret_copy = MALLOC(sizeof(LDKCOption_MaxDustHTLCExposureZ), "LDKCOption_MaxDustHTLCExposureZ"); - *ret_copy = ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_TransactionU16LenLimited_new"))) TS_TransactionU16LenLimited_new(int8_tArray transaction) { + 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; + LDKCResult_TransactionU16LenLimitedNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedNoneZ), "LDKCResult_TransactionU16LenLimitedNoneZ"); + *ret_conv = TransactionU16LenLimited_new(transaction_ref); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat"))) TS_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(uint64_t this_ptr, uint64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_MaxDustHTLCExposureZ val_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(val_ptr); - val_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(val)); - ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val_conv); +int8_tArray __attribute__((export_name("TS_TransactionU16LenLimited_into_transaction"))) TS_TransactionU16LenLimited_into_transaction(uint64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = TransactionU16LenLimited_clone(&this_arg_conv); + LDKTransaction ret_var = TransactionU16LenLimited_into_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; } -uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_tArray __attribute__((export_name("TS_TransactionU16LenLimited_as_transaction"))) TS_TransactionU16LenLimited_as_transaction(uint64_t this_arg) { + LDKTransactionU16LenLimited this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = TransactionU16LenLimited_as_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; } -void __attribute__((export_name("TS_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr, uint64_t val) { - LDKChannelConfigUpdate this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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)); - ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val_conv); +int8_tArray __attribute__((export_name("TS_TransactionU16LenLimited_write"))) TS_TransactionU16LenLimited_write(uint64_t obj) { + LDKTransactionU16LenLimited 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 = TransactionU16LenLimited_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_ChannelConfigUpdate_new"))) TS_ChannelConfigUpdate_new(uint64_t forwarding_fee_proportional_millionths_arg, uint64_t forwarding_fee_base_msat_arg, uint64_t cltv_expiry_delta_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg) { - void* forwarding_fee_proportional_millionths_arg_ptr = untag_ptr(forwarding_fee_proportional_millionths_arg); - CHECK_ACCESS(forwarding_fee_proportional_millionths_arg_ptr); - LDKCOption_u32Z forwarding_fee_proportional_millionths_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_proportional_millionths_arg_ptr); - forwarding_fee_proportional_millionths_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_proportional_millionths_arg)); - void* forwarding_fee_base_msat_arg_ptr = untag_ptr(forwarding_fee_base_msat_arg); - CHECK_ACCESS(forwarding_fee_base_msat_arg_ptr); - LDKCOption_u32Z forwarding_fee_base_msat_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_base_msat_arg_ptr); - forwarding_fee_base_msat_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_base_msat_arg)); - void* cltv_expiry_delta_arg_ptr = untag_ptr(cltv_expiry_delta_arg); - CHECK_ACCESS(cltv_expiry_delta_arg_ptr); - LDKCOption_u16Z cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(cltv_expiry_delta_arg_ptr); - cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(cltv_expiry_delta_arg)); - void* max_dust_htlc_exposure_msat_arg_ptr = untag_ptr(max_dust_htlc_exposure_msat_arg); - CHECK_ACCESS(max_dust_htlc_exposure_msat_arg_ptr); - LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(max_dust_htlc_exposure_msat_arg_ptr); - max_dust_htlc_exposure_msat_arg_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(max_dust_htlc_exposure_msat_arg)); - void* force_close_avoidance_max_fee_satoshis_arg_ptr = untag_ptr(force_close_avoidance_max_fee_satoshis_arg); - CHECK_ACCESS(force_close_avoidance_max_fee_satoshis_arg_ptr); - LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg_conv = *(LDKCOption_u64Z*)(force_close_avoidance_max_fee_satoshis_arg_ptr); - force_close_avoidance_max_fee_satoshis_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(force_close_avoidance_max_fee_satoshis_arg)); - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg_conv, forwarding_fee_base_msat_arg_conv, cltv_expiry_delta_arg_conv, max_dust_htlc_exposure_msat_arg_conv, force_close_avoidance_max_fee_satoshis_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_TransactionU16LenLimited_read"))) TS_TransactionU16LenLimited_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TransactionU16LenLimitedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionU16LenLimitedDecodeErrorZ), "LDKCResult_TransactionU16LenLimitedDecodeErrorZ"); + *ret_conv = TransactionU16LenLimited_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_default"))) TS_ChannelConfigUpdate_default() { - LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_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; +uint64_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKCResult_StrSecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StrSecp256k1ErrorZ), "LDKCResult_StrSecp256k1ErrorZ"); + *ret_conv = sign(msg_ref, sk_ref); + FREE(msg); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) { - LDKUserConfig this_obj_conv; +uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + LDKStr sig_conv = str_ref_to_owned_c(sig); + LDKCResult_PublicKeySecp256k1ErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeySecp256k1ErrorZ), "LDKCResult_PublicKeySecp256k1ErrorZ"); + *ret_conv = recover_pk(msg_ref, sig_conv); + FREE(msg); + return tag_ptr(ret_conv, true); +} + +jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) { + LDKu8slice msg_ref; + msg_ref.datalen = msg->arr_len; + msg_ref.data = msg->elems; + LDKStr sig_conv = str_ref_to_owned_c(sig); + LDKPublicKey pk_ref; + CHECK(pk->arr_len == 33); + memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk); + jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref); + FREE(msg); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) { + LDKu8slice hrp_bytes_ref; + hrp_bytes_ref.datalen = hrp_bytes->arr_len; + hrp_bytes_ref.data = hrp_bytes->elems; + LDKCVec_U5Z data_without_signature_constr; + data_without_signature_constr.datalen = data_without_signature->arr_len; + if (data_without_signature_constr.datalen > 0) + data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKU5), "LDKCVec_U5Z Elements"); + else + data_without_signature_constr.data = NULL; + int8_t* data_without_signature_vals = (void*) data_without_signature->elems; + for (size_t h = 0; h < data_without_signature_constr.datalen; h++) { + int8_t data_without_signature_conv_7 = data_without_signature_vals[h]; + + data_without_signature_constr.data[h] = (LDKU5){ ._0 = data_without_signature_conv_7 }; + } + FREE(data_without_signature); + LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr); + 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); + FREE(hrp_bytes); + return ret_arr; +} + +void __attribute__((export_name("TS_KVStore_free"))) TS_KVStore_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); + LDKKVStore this_ptr_conv = *(LDKKVStore*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + KVStore_free(this_ptr_conv); +} + +void __attribute__((export_name("TS_Persister_free"))) TS_Persister_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); + LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Persister_free(this_ptr_conv); +} + +uint64_t __attribute__((export_name("TS_read_channel_monitors"))) TS_read_channel_monitors(uint64_t kv_store, uint64_t entropy_source, uint64_t signer_provider) { + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&kv_store_conv); + } + 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* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); + *ret_conv = read_channel_monitors(kv_store_conv, entropy_source_conv, signer_provider_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_MonitorUpdatingPersister_free"))) TS_MonitorUpdatingPersister_free(uint64_t this_obj) { + LDKMonitorUpdatingPersister 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); - UserConfig_free(this_obj_conv); + MonitorUpdatingPersister_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_new"))) TS_MonitorUpdatingPersister_new(uint64_t kv_store, uint64_t logger, int64_t maximum_pending_updates, uint64_t entropy_source, uint64_t signer_provider) { + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&kv_store_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* 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* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + LDKMonitorUpdatingPersister ret_var = MonitorUpdatingPersister_new(kv_store_conv, logger_conv, maximum_pending_updates, entropy_source_conv, signer_provider_conv); uint64_t ret_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_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelHandshakeConfig 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 = ChannelHandshakeConfig_clone(&val_conv); - UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_read_all_channel_monitors_with_updates"))) TS_MonitorUpdatingPersister_read_all_channel_monitors_with_updates(uint64_t this_arg, uint64_t broadcaster, uint64_t fee_estimator) { + LDKMonitorUpdatingPersister this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_read_all_channel_monitors_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&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_MonitorUpdatingPersister_read_channel_monitor_with_updates"))) TS_MonitorUpdatingPersister_read_channel_monitor_with_updates(uint64_t this_arg, uint64_t broadcaster, uint64_t fee_estimator, jstring monitor_key) { + LDKMonitorUpdatingPersister this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + LDKStr monitor_key_conv = str_ref_to_owned_c(monitor_key); + LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_read_channel_monitor_with_updates(&this_arg_conv, broadcaster_conv, fee_estimator_conv, monitor_key_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelHandshakeLimits 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 = ChannelHandshakeLimits_clone(&val_conv); - UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_MonitorUpdatingPersister_cleanup_stale_updates"))) TS_MonitorUpdatingPersister_cleanup_stale_updates(uint64_t this_arg, jboolean lazy) { + LDKMonitorUpdatingPersister this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = MonitorUpdatingPersister_cleanup_stale_updates(&this_arg_conv, lazy); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelConfig ret_var = UserConfig_get_channel_config(&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_MonitorUpdatingPersister_as_Persist"))) TS_MonitorUpdatingPersister_as_Persist(uint64_t this_arg) { + LDKMonitorUpdatingPersister this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPersist* ret_ret = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *ret_ret = MonitorUpdatingPersister_as_Persist(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelConfig 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 = ChannelConfig_clone(&val_conv); - UserConfig_set_channel_config(&this_ptr_conv, val_conv); +uint32_t __attribute__((export_name("TS_ShortChannelIdError_clone"))) TS_ShortChannelIdError_clone(uint64_t orig) { + LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); + uint32_t ret_conv = LDKShortChannelIdError_to_js(ShortChannelIdError_clone(orig_conv)); + return ret_conv; } -jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_ShortChannelIdError_block_overflow"))) TS_ShortChannelIdError_block_overflow() { + uint32_t ret_conv = LDKShortChannelIdError_to_js(ShortChannelIdError_block_overflow()); return ret_conv; } -void __attribute__((export_name("TS_UserConfig_set_accept_forwards_to_priv_channels"))) TS_UserConfig_set_accept_forwards_to_priv_channels(uint64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); +uint32_t __attribute__((export_name("TS_ShortChannelIdError_tx_index_overflow"))) TS_ShortChannelIdError_tx_index_overflow() { + uint32_t ret_conv = LDKShortChannelIdError_to_js(ShortChannelIdError_tx_index_overflow()); + return ret_conv; } -jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_ShortChannelIdError_vout_index_overflow"))) TS_ShortChannelIdError_vout_index_overflow() { + uint32_t ret_conv = LDKShortChannelIdError_to_js(ShortChannelIdError_vout_index_overflow()); return ret_conv; } -void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_ShortChannelIdError_eq"))) TS_ShortChannelIdError_eq(uint64_t a, uint64_t b) { + LDKShortChannelIdError* a_conv = (LDKShortChannelIdError*)untag_ptr(a); + LDKShortChannelIdError* b_conv = (LDKShortChannelIdError*)untag_ptr(b); + jboolean ret_conv = ShortChannelIdError_eq(a_conv, b_conv); + return ret_conv; } -jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); +int32_t __attribute__((export_name("TS_block_from_scid"))) TS_block_from_scid(int64_t short_channel_id) { + int32_t ret_conv = block_from_scid(short_channel_id); return ret_conv; } -void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); +int32_t __attribute__((export_name("TS_tx_index_from_scid"))) TS_tx_index_from_scid(int64_t short_channel_id) { + int32_t ret_conv = tx_index_from_scid(short_channel_id); + return ret_conv; } -jboolean __attribute__((export_name("TS_UserConfig_get_accept_intercept_htlcs"))) TS_UserConfig_get_accept_intercept_htlcs(uint64_t this_ptr) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); +int16_t __attribute__((export_name("TS_vout_from_scid"))) TS_vout_from_scid(int64_t short_channel_id) { + int16_t ret_conv = vout_from_scid(short_channel_id); return ret_conv; } -void __attribute__((export_name("TS_UserConfig_set_accept_intercept_htlcs"))) TS_UserConfig_set_accept_intercept_htlcs(uint64_t this_ptr, jboolean val) { - LDKUserConfig this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_scid_from_parts"))) TS_scid_from_parts(int64_t block, int64_t tx_index, int64_t vout_index) { + LDKCResult_u64ShortChannelIdErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_u64ShortChannelIdErrorZ), "LDKCResult_u64ShortChannelIdErrorZ"); + *ret_conv = scid_from_parts(block, tx_index, vout_index); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_UserConfig_get_accept_mpp_keysend"))) TS_UserConfig_get_accept_mpp_keysend(uint64_t this_ptr) { - LDKUserConfig this_ptr_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); + UntrustedString_free(this_obj_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; - jboolean ret_conv = UserConfig_get_accept_mpp_keysend(&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_UserConfig_set_accept_mpp_keysend"))) TS_UserConfig_set_accept_mpp_keysend(uint64_t this_ptr, jboolean val) { - LDKUserConfig 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; - UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); -} - -uint64_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(uint64_t channel_handshake_config_arg, uint64_t channel_handshake_limits_arg, uint64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg) { - LDKChannelHandshakeConfig channel_handshake_config_arg_conv; - channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); - channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv); - channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv); - LDKChannelHandshakeLimits channel_handshake_limits_arg_conv; - channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg); - channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv); - channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv); - LDKChannelConfig channel_config_arg_conv; - channel_config_arg_conv.inner = untag_ptr(channel_config_arg); - channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); - channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); - LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_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 UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { - LDKUserConfig ret_var = UserConfig_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_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) { - LDKUserConfig 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 = UserConfig_clone_ptr(&arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) { - LDKUserConfig 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; - LDKUserConfig ret_var = UserConfig_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; + LDKStr val_conv = str_ref_to_owned_c(val); + UntrustedString_set_a(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() { - LDKUserConfig ret_var = UserConfig_default(); +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); + 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_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) { - LDKBestBlock 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); - BestBlock_free(this_obj_conv); -} - -static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { - LDKBestBlock ret_var = BestBlock_clone(arg); +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; } -int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) { - LDKBestBlock arg_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 = BestBlock_clone_ptr(&arg_conv); + int64_t ret_conv = UntrustedString_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) { - LDKBestBlock orig_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; - LDKBestBlock ret_var = BestBlock_clone(&orig_conv); + 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; } -jboolean __attribute__((export_name("TS_BestBlock_eq"))) TS_BestBlock_eq(uint64_t a, uint64_t b) { - LDKBestBlock a_conv; +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; - LDKBestBlock b_conv; + 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 = BestBlock_eq(&a_conv, &b_conv); + jboolean ret_conv = UntrustedString_eq(&a_conv, &b_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_BestBlock_from_network"))) TS_BestBlock_from_network(uint32_t network) { - LDKNetwork network_conv = LDKNetwork_from_js(network); - LDKBestBlock ret_var = BestBlock_from_network(network_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) { - LDKThirtyTwoBytes block_hash_ref; - CHECK(block_hash->arr_len == 32); - memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash); - LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height); - uint64_t ret_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_UntrustedString_hash"))) TS_UntrustedString_hash(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.is_owned = false; + int64_t ret_conv = UntrustedString_hash(&o_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBlock_block_hash(uint64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, BestBlock_block_hash(&this_arg_conv).data, 32); +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; } -int32_t __attribute__((export_name("TS_BestBlock_height"))) TS_BestBlock_height(uint64_t this_arg) { - LDKBestBlock this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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 = BestBlock_height(&this_arg_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Listen_free(this_ptr_conv); -} - -void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_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); - LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Confirm_free(this_ptr_conv); -} - -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_clone"))) TS_ChannelMonitorUpdateStatus_clone(uint64_t orig) { - LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); - uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_clone(orig_conv)); - return ret_conv; +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); } -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_completed"))) TS_ChannelMonitorUpdateStatus_completed() { - uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_completed()); +jstring __attribute__((export_name("TS_UntrustedString_to_str"))) TS_UntrustedString_to_str(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.is_owned = false; + LDKStr ret_str = UntrustedString_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_in_progress"))) TS_ChannelMonitorUpdateStatus_in_progress() { - uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_in_progress()); - return ret_conv; +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); } -uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_unrecoverable_error"))) TS_ChannelMonitorUpdateStatus_unrecoverable_error() { - uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_unrecoverable_error()); +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; } -jboolean __attribute__((export_name("TS_ChannelMonitorUpdateStatus_eq"))) TS_ChannelMonitorUpdateStatus_eq(uint64_t a, uint64_t b) { - LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); - LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); - jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); - return ret_conv; +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); } -void __attribute__((export_name("TS_Watch_free"))) TS_Watch_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); - LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Watch_free(this_ptr_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_Filter_free"))) TS_Filter_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); - LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Filter_free(this_ptr_conv); +jstring __attribute__((export_name("TS_PrintableString_to_str"))) TS_PrintableString_to_str(uint64_t o) { + LDKPrintableString 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; + LDKStr ret_str = PrintableString_to_str(&o_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_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) { - LDKWatchedOutput this_obj_conv; +void __attribute__((export_name("TS_TrackedSpendableOutput_free"))) TS_TrackedSpendableOutput_free(uint64_t this_obj) { + LDKTrackedSpendableOutput 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); - WatchedOutput_free(this_obj_conv); + TrackedSpendableOutput_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +uint64_t __attribute__((export_name("TS_TrackedSpendableOutput_get_descriptor"))) TS_TrackedSpendableOutput_get_descriptor(uint64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); - *ret_copy = WatchedOutput_get_block_hash(&this_ptr_conv); + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, uint64_t val) { - LDKWatchedOutput this_ptr_conv; +void __attribute__((export_name("TS_TrackedSpendableOutput_set_descriptor"))) TS_TrackedSpendableOutput_set_descriptor(uint64_t this_ptr, uint64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); - val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); - WatchedOutput_set_block_hash(&this_ptr_conv, val_conv); + LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); + val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); + TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +uint64_t __attribute__((export_name("TS_TrackedSpendableOutput_get_channel_id"))) TS_TrackedSpendableOutput_get_channel_id(uint64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = WatchedOutput_get_outpoint(&this_ptr_conv); + LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); uint64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) { - LDKWatchedOutput this_ptr_conv; +void __attribute__((export_name("TS_TrackedSpendableOutput_set_channel_id"))) TS_TrackedSpendableOutput_set_channel_id(uint64_t this_ptr, uint64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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; + LDKChannelId 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); - WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); + val_conv = ChannelId_clone(&val_conv); + TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) { - LDKWatchedOutput this_ptr_conv; +uint64_t __attribute__((export_name("TS_TrackedSpendableOutput_get_status"))) TS_TrackedSpendableOutput_get_status(uint64_t this_ptr) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = WatchedOutput_get_script_pubkey(&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; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKWatchedOutput this_ptr_conv; +void __attribute__((export_name("TS_TrackedSpendableOutput_set_status"))) TS_TrackedSpendableOutput_set_status(uint64_t this_ptr, uint64_t val) { + LDKTrackedSpendableOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); + val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); + TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_new(uint64_t block_hash_arg, uint64_t outpoint_arg, int8_tArray script_pubkey_arg) { - void* block_hash_arg_ptr = untag_ptr(block_hash_arg); - CHECK_ACCESS(block_hash_arg_ptr); - LDKCOption_ThirtyTwoBytesZ block_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(block_hash_arg_ptr); - block_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(block_hash_arg)); - LDKOutPoint outpoint_arg_conv; - outpoint_arg_conv.inner = untag_ptr(outpoint_arg); - outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); - outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); - LDKCVec_u8Z script_pubkey_arg_ref; - script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; - script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); - LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_conv, outpoint_arg_conv, script_pubkey_arg_ref); +uint64_t __attribute__((export_name("TS_TrackedSpendableOutput_new"))) TS_TrackedSpendableOutput_new(uint64_t descriptor_arg, uint64_t channel_id_arg, uint64_t status_arg) { + void* descriptor_arg_ptr = untag_ptr(descriptor_arg); + CHECK_ACCESS(descriptor_arg_ptr); + LDKSpendableOutputDescriptor descriptor_arg_conv = *(LDKSpendableOutputDescriptor*)(descriptor_arg_ptr); + descriptor_arg_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptor_arg)); + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + void* status_arg_ptr = untag_ptr(status_arg); + CHECK_ACCESS(status_arg_ptr); + LDKOutputSpendStatus status_arg_conv = *(LDKOutputSpendStatus*)(status_arg_ptr); + status_arg_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(status_arg)); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_new(descriptor_arg_conv, channel_id_arg_conv, status_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 WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { - LDKWatchedOutput ret_var = WatchedOutput_clone(arg); +static inline uint64_t TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_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_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) { - LDKWatchedOutput arg_conv; +int64_t __attribute__((export_name("TS_TrackedSpendableOutput_clone_ptr"))) TS_TrackedSpendableOutput_clone_ptr(uint64_t arg) { + LDKTrackedSpendableOutput 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 = WatchedOutput_clone_ptr(&arg_conv); + int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) { - LDKWatchedOutput orig_conv; +uint64_t __attribute__((export_name("TS_TrackedSpendableOutput_clone"))) TS_TrackedSpendableOutput_clone(uint64_t orig) { + LDKTrackedSpendableOutput 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; - LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_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_WatchedOutput_eq"))) TS_WatchedOutput_eq(uint64_t a, uint64_t b) { - LDKWatchedOutput a_conv; +jboolean __attribute__((export_name("TS_TrackedSpendableOutput_eq"))) TS_TrackedSpendableOutput_eq(uint64_t a, uint64_t b) { + LDKTrackedSpendableOutput a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKWatchedOutput b_conv; + LDKTrackedSpendableOutput b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); - return ret_conv; -} - -int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) { - LDKWatchedOutput o_conv; - o_conv.inner = untag_ptr(o); - 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 = WatchedOutput_hash(&o_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_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); - LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - BroadcasterInterface_free(this_ptr_conv); -} - -uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) { - LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig); - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv)); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ConfirmationTarget_on_chain_sweep"))) TS_ConfirmationTarget_on_chain_sweep() { - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_on_chain_sweep()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ConfirmationTarget_min_allowed_anchor_channel_remote_fee"))) TS_ConfirmationTarget_min_allowed_anchor_channel_remote_fee() { - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_min_allowed_anchor_channel_remote_fee()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee"))) TS_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee() { - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ConfirmationTarget_anchor_channel_fee"))) TS_ConfirmationTarget_anchor_channel_fee() { - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_anchor_channel_fee()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ConfirmationTarget_non_anchor_channel_fee"))) TS_ConfirmationTarget_non_anchor_channel_fee() { - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_non_anchor_channel_fee()); + jboolean ret_conv = TrackedSpendableOutput_eq(&a_conv, &b_conv); return ret_conv; } -uint32_t __attribute__((export_name("TS_ConfirmationTarget_channel_close_minimum"))) TS_ConfirmationTarget_channel_close_minimum() { - uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_channel_close_minimum()); +jboolean __attribute__((export_name("TS_TrackedSpendableOutput_is_spent_in"))) TS_TrackedSpendableOutput_is_spent_in(uint64_t this_arg, int8_tArray tx) { + LDKTrackedSpendableOutput this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + jboolean ret_conv = TrackedSpendableOutput_is_spent_in(&this_arg_conv, tx_ref); return ret_conv; } -int64_t __attribute__((export_name("TS_ConfirmationTarget_hash"))) TS_ConfirmationTarget_hash(uint64_t o) { - LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); - int64_t ret_conv = ConfirmationTarget_hash(o_conv); - return ret_conv; +int8_tArray __attribute__((export_name("TS_TrackedSpendableOutput_write"))) TS_TrackedSpendableOutput_write(uint64_t obj) { + LDKTrackedSpendableOutput 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 = TrackedSpendableOutput_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_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) { - LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a); - LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); - jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_TrackedSpendableOutput_read"))) TS_TrackedSpendableOutput_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_TrackedSpendableOutputDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TrackedSpendableOutputDecodeErrorZ), "LDKCResult_TrackedSpendableOutputDecodeErrorZ"); + *ret_conv = TrackedSpendableOutput_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint64_t this_ptr) { +void __attribute__((export_name("TS_OutputSpendStatus_free"))) TS_OutputSpendStatus_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); - LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); + LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - FeeEstimator_free(this_ptr_conv); + OutputSpendStatus_free(this_ptr_conv); } -void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) { - LDKMonitorUpdateId 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); - MonitorUpdateId_free(this_obj_conv); +static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_OutputSpendStatus_clone_ptr"))) TS_OutputSpendStatus_clone_ptr(uint64_t arg) { + LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); + int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); + return ret_conv; } -static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { - LDKMonitorUpdateId ret_var = MonitorUpdateId_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_OutputSpendStatus_clone"))) TS_OutputSpendStatus_clone(uint64_t orig) { + LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) { - LDKMonitorUpdateId 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 = MonitorUpdateId_clone_ptr(&arg_conv); - return ret_conv; + +uint64_t __attribute__((export_name("TS_OutputSpendStatus_pending_initial_broadcast"))) TS_OutputSpendStatus_pending_initial_broadcast(uint64_t delayed_until_height) { + void* delayed_until_height_ptr = untag_ptr(delayed_until_height); + CHECK_ACCESS(delayed_until_height_ptr); + LDKCOption_u32Z delayed_until_height_conv = *(LDKCOption_u32Z*)(delayed_until_height_ptr); + delayed_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delayed_until_height)); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_initial_broadcast(delayed_until_height_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) { - LDKMonitorUpdateId 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; - LDKMonitorUpdateId ret_var = MonitorUpdateId_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_OutputSpendStatus_pending_first_confirmation"))) TS_OutputSpendStatus_pending_first_confirmation(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_first_confirmation(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) { - LDKMonitorUpdateId 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 = MonitorUpdateId_hash(&o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_OutputSpendStatus_pending_threshold_confirmations"))) TS_OutputSpendStatus_pending_threshold_confirmations(int8_tArray first_broadcast_hash, int32_t latest_broadcast_height, int8_tArray latest_spending_tx, int32_t confirmation_height, int8_tArray confirmation_hash) { + LDKThirtyTwoBytes first_broadcast_hash_ref; + CHECK(first_broadcast_hash->arr_len == 32); + memcpy(first_broadcast_hash_ref.data, first_broadcast_hash->elems, 32); FREE(first_broadcast_hash); + LDKTransaction latest_spending_tx_ref; + latest_spending_tx_ref.datalen = latest_spending_tx->arr_len; + latest_spending_tx_ref.data = MALLOC(latest_spending_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(latest_spending_tx_ref.data, latest_spending_tx->elems, latest_spending_tx_ref.datalen); FREE(latest_spending_tx); + latest_spending_tx_ref.data_is_owned = true; + LDKThirtyTwoBytes confirmation_hash_ref; + CHECK(confirmation_hash->arr_len == 32); + memcpy(confirmation_hash_ref.data, confirmation_hash->elems, 32); FREE(confirmation_hash); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_pending_threshold_confirmations(first_broadcast_hash_ref, latest_broadcast_height, latest_spending_tx_ref, confirmation_height, confirmation_hash_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) { - LDKMonitorUpdateId 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; - LDKMonitorUpdateId 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 = MonitorUpdateId_eq(&a_conv, &b_conv); +jboolean __attribute__((export_name("TS_OutputSpendStatus_eq"))) TS_OutputSpendStatus_eq(uint64_t a, uint64_t b) { + LDKOutputSpendStatus* a_conv = (LDKOutputSpendStatus*)untag_ptr(a); + LDKOutputSpendStatus* b_conv = (LDKOutputSpendStatus*)untag_ptr(b); + jboolean ret_conv = OutputSpendStatus_eq(a_conv, b_conv); return ret_conv; } -void __attribute__((export_name("TS_Persist_free"))) TS_Persist_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); - LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Persist_free(this_ptr_conv); +int8_tArray __attribute__((export_name("TS_OutputSpendStatus_write"))) TS_OutputSpendStatus_write(uint64_t obj) { + LDKOutputSpendStatus* obj_conv = (LDKOutputSpendStatus*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutputSpendStatus_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_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) { - LDKLockedChannelMonitor 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); - LockedChannelMonitor_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_OutputSpendStatus_read"))) TS_OutputSpendStatus_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutputSpendStatusDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSpendStatusDecodeErrorZ), "LDKCResult_OutputSpendStatusDecodeErrorZ"); + *ret_conv = OutputSpendStatus_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) { - LDKChainMonitor this_obj_conv; +void __attribute__((export_name("TS_OutputSweeper_free"))) TS_OutputSweeper_free(uint64_t this_obj) { + LDKOutputSweeper 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); - ChainMonitor_free(this_obj_conv); + OutputSweeper_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_new(uint64_t chain_source, uint64_t broadcaster, uint64_t logger, uint64_t feeest, uint64_t persister) { - void* chain_source_ptr = untag_ptr(chain_source); - CHECK_ACCESS(chain_source_ptr); - LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); - // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ - if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { - // Manually implement clone for Java trait instances - if (chain_source_conv.some.free == LDKFilter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFilter_JCalls_cloned(&chain_source_conv.some); - } - } +uint64_t __attribute__((export_name("TS_OutputSweeper_new"))) TS_OutputSweeper_new(uint64_t best_block, uint64_t broadcaster, uint64_t fee_estimator, uint64_t chain_data_source, uint64_t output_spender, uint64_t change_destination_source, uint64_t kv_store, uint64_t logger) { + LDKBestBlock best_block_conv; + best_block_conv.inner = untag_ptr(best_block); + best_block_conv.is_owned = ptr_is_owned(best_block); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_conv); + best_block_conv = BestBlock_clone(&best_block_conv); void* broadcaster_ptr = untag_ptr(broadcaster); CHECK_ACCESS(broadcaster_ptr); LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr); @@ -34557,6 +36523,45 @@ uint64_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_ne // 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* chain_data_source_ptr = untag_ptr(chain_data_source); + CHECK_ACCESS(chain_data_source_ptr); + LDKCOption_FilterZ chain_data_source_conv = *(LDKCOption_FilterZ*)(chain_data_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_data_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_data_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_data_source_conv.some); + } + } + void* output_spender_ptr = untag_ptr(output_spender); + CHECK_ACCESS(output_spender_ptr); + LDKOutputSpender output_spender_conv = *(LDKOutputSpender*)(output_spender_ptr); + if (output_spender_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&output_spender_conv); + } + void* change_destination_source_ptr = untag_ptr(change_destination_source); + CHECK_ACCESS(change_destination_source_ptr); + LDKChangeDestinationSource change_destination_source_conv = *(LDKChangeDestinationSource*)(change_destination_source_ptr); + if (change_destination_source_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&change_destination_source_conv); + } + void* kv_store_ptr = untag_ptr(kv_store); + CHECK_ACCESS(kv_store_ptr); + LDKKVStore kv_store_conv = *(LDKKVStore*)(kv_store_ptr); + if (kv_store_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&kv_store_conv); + } void* logger_ptr = untag_ptr(logger); CHECK_ACCESS(logger_ptr); LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); @@ -34564,5226 +36569,8012 @@ uint64_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_ne // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } - void* feeest_ptr = untag_ptr(feeest); - CHECK_ACCESS(feeest_ptr); - LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); - if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&feeest_conv); - } - void* persister_ptr = untag_ptr(persister); - CHECK_ACCESS(persister_ptr); - LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); - if (persister_conv.free == LDKPersist_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKPersist_JCalls_cloned(&persister_conv); - } - LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); + LDKOutputSweeper ret_var = OutputSweeper_new(best_block_conv, broadcaster_conv, fee_estimator_conv, chain_data_source_conv, output_spender_conv, change_destination_source_conv, kv_store_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_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) { - LDKChainMonitor this_arg_conv; +uint64_t __attribute__((export_name("TS_OutputSweeper_track_spendable_outputs"))) TS_OutputSweeper_track_spendable_outputs(uint64_t this_arg, uint64_tArray output_descriptors, uint64_t channel_id, jboolean exclude_static_outputs, uint64_t delay_until_height) { + LDKOutputSweeper this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_ChannelDetailsZ ignored_channels_constr; - ignored_channels_constr.datalen = ignored_channels->arr_len; - if (ignored_channels_constr.datalen > 0) - ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + LDKCVec_SpendableOutputDescriptorZ output_descriptors_constr; + output_descriptors_constr.datalen = output_descriptors->arr_len; + if (output_descriptors_constr.datalen > 0) + output_descriptors_constr.data = MALLOC(output_descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); else - ignored_channels_constr.data = NULL; - uint64_t* ignored_channels_vals = ignored_channels->elems; - for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { - uint64_t ignored_channels_conv_16 = ignored_channels_vals[q]; - LDKChannelDetails ignored_channels_conv_16_conv; - ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16); - ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); - ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); - ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; - } - FREE(ignored_channels); - LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); - 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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); - ret_arr_ptr[j] = ret_conv_9_ref; - } - - FREE(ret_var.data); - return ret_arr; -} - -uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) { - 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; - 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); - LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); - *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); + output_descriptors_constr.data = NULL; + uint64_t* output_descriptors_vals = output_descriptors->elems; + for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { + uint64_t output_descriptors_conv_27 = output_descriptors_vals[b]; + void* output_descriptors_conv_27_ptr = untag_ptr(output_descriptors_conv_27); + CHECK_ACCESS(output_descriptors_conv_27_ptr); + LDKSpendableOutputDescriptor output_descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(output_descriptors_conv_27_ptr); + output_descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(output_descriptors_conv_27)); + output_descriptors_constr.data[b] = output_descriptors_conv_27_conv; + } + FREE(output_descriptors); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + void* delay_until_height_ptr = untag_ptr(delay_until_height); + CHECK_ACCESS(delay_until_height_ptr); + LDKCOption_u32Z delay_until_height_conv = *(LDKCOption_u32Z*)(delay_until_height_ptr); + delay_until_height_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(delay_until_height)); + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = OutputSweeper_track_spendable_outputs(&this_arg_conv, output_descriptors_constr, channel_id_conv, exclude_static_outputs, delay_until_height_conv); return tag_ptr(ret_conv, true); } -uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) { - LDKChainMonitor this_arg_conv; +uint64_tArray __attribute__((export_name("TS_OutputSweeper_tracked_spendable_outputs"))) TS_OutputSweeper_tracked_spendable_outputs(uint64_t this_arg) { + LDKOutputSweeper this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); + LDKCVec_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&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 k = 0; k < ret_var.datalen; k++) { - LDKOutPoint 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; + for (size_t y = 0; y < ret_var.datalen; y++) { + LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; + uint64_t ret_conv_24_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_24_var); + ret_conv_24_ref = tag_ptr(ret_conv_24_var.inner, ret_conv_24_var.is_owned); + ret_arr_ptr[y] = ret_conv_24_ref; } FREE(ret_var.data); return ret_arr; } -uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_pending_monitor_updates"))) TS_ChainMonitor_list_pending_monitor_updates(uint64_t this_arg) { - LDKChainMonitor this_arg_conv; +uint64_t __attribute__((export_name("TS_OutputSweeper_current_best_block"))) TS_OutputSweeper_current_best_block(uint64_t this_arg) { + LDKOutputSweeper this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); - uint64_tArray ret_arr = NULL; - ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); - uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t p = 0; p < ret_var.datalen; p++) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); - *ret_conv_41_conv = ret_var.data[p]; - ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); - } - - FREE(ret_var.data); - return ret_arr; + LDKBestBlock ret_var = OutputSweeper_current_best_block(&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_ChainMonitor_channel_monitor_updated"))) TS_ChainMonitor_channel_monitor_updated(uint64_t this_arg, uint64_t funding_txo, uint64_t completed_update_id) { - LDKChainMonitor this_arg_conv; +uint64_t __attribute__((export_name("TS_OutputSweeper_as_Listen"))) TS_OutputSweeper_as_Listen(uint64_t this_arg) { + LDKOutputSweeper this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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_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); - LDKMonitorUpdateId completed_update_id_conv; - completed_update_id_conv.inner = untag_ptr(completed_update_id); - completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); - CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); - completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); - return tag_ptr(ret_conv, true); + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -uint64_t __attribute__((export_name("TS_ChainMonitor_get_update_future"))) TS_ChainMonitor_get_update_future(uint64_t this_arg) { - LDKChainMonitor this_arg_conv; +uint64_t __attribute__((export_name("TS_OutputSweeper_as_Confirm"))) TS_OutputSweeper_as_Confirm(uint64_t this_arg) { + LDKOutputSweeper this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); } -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); +void __attribute__((export_name("TS_SpendingDelay_free"))) TS_SpendingDelay_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); + LDKSpendingDelay this_ptr_conv = *(LDKSpendingDelay*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SpendingDelay_free(this_ptr_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); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_SpendingDelay_clone_ptr"))) TS_SpendingDelay_clone_ptr(uint64_t arg) { + LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); + int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(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; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +uint64_t __attribute__((export_name("TS_SpendingDelay_clone"))) TS_SpendingDelay_clone(uint64_t orig) { + LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(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; - LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); - *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); - return tag_ptr(ret_ret, true); +uint64_t __attribute__((export_name("TS_SpendingDelay_relative"))) TS_SpendingDelay_relative(int32_t num_blocks) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_relative(num_blocks); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint64_t this_arg) { - LDKChainMonitor this_arg_conv; +uint64_t __attribute__((export_name("TS_SpendingDelay_absolute"))) TS_SpendingDelay_absolute(int32_t height) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_absolute(height); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_OutputSweeper_read"))) TS_OutputSweeper_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b, uint64_t arg_c, uint64_t arg_d, uint64_t arg_e, uint64_t arg_f, uint64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_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_g_conv); + } + LDKCResult_OutputSweeperDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutputSweeperDecodeErrorZ), "LDKCResult_OutputSweeperDecodeErrorZ"); + *ret_conv = OutputSweeper_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_C2Tuple_BestBlockOutputSweeperZ_read"))) TS_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b, uint64_t arg_c, uint64_t arg_d, uint64_t arg_e, uint64_t arg_f, uint64_t arg_g) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + CHECK_ACCESS(arg_a_ptr); + LDKBroadcasterInterface arg_a_conv = *(LDKBroadcasterInterface*)(arg_a_ptr); + if (arg_a_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&arg_a_conv); + } + void* arg_b_ptr = untag_ptr(arg_b); + CHECK_ACCESS(arg_b_ptr); + LDKFeeEstimator arg_b_conv = *(LDKFeeEstimator*)(arg_b_ptr); + if (arg_b_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&arg_b_conv); + } + void* arg_c_ptr = untag_ptr(arg_c); + CHECK_ACCESS(arg_c_ptr); + LDKCOption_FilterZ arg_c_conv = *(LDKCOption_FilterZ*)(arg_c_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (arg_c_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (arg_c_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&arg_c_conv.some); + } + } + void* arg_d_ptr = untag_ptr(arg_d); + CHECK_ACCESS(arg_d_ptr); + LDKOutputSpender arg_d_conv = *(LDKOutputSpender*)(arg_d_ptr); + if (arg_d_conv.free == LDKOutputSpender_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOutputSpender_JCalls_cloned(&arg_d_conv); + } + void* arg_e_ptr = untag_ptr(arg_e); + CHECK_ACCESS(arg_e_ptr); + LDKChangeDestinationSource arg_e_conv = *(LDKChangeDestinationSource*)(arg_e_ptr); + if (arg_e_conv.free == LDKChangeDestinationSource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKChangeDestinationSource_JCalls_cloned(&arg_e_conv); + } + void* arg_f_ptr = untag_ptr(arg_f); + CHECK_ACCESS(arg_f_ptr); + LDKKVStore arg_f_conv = *(LDKKVStore*)(arg_f_ptr); + if (arg_f_conv.free == LDKKVStore_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKKVStore_JCalls_cloned(&arg_f_conv); + } + void* arg_g_ptr = untag_ptr(arg_g); + CHECK_ACCESS(arg_g_ptr); + LDKLogger arg_g_conv = *(LDKLogger*)(arg_g_ptr); + if (arg_g_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_g_conv); + } + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ), "LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ"); + *ret_conv = C2Tuple_BestBlockOutputSweeperZ_read(ser_ref, arg_a_conv, arg_b_conv, arg_c_conv, arg_d_conv, arg_e_conv, arg_f_conv, arg_g_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_FutureCallback_free"))) TS_FutureCallback_free(uint64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKFutureCallback this_ptr_conv = *(LDKFutureCallback*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FutureCallback_free(this_ptr_conv); +} + +void __attribute__((export_name("TS_Future_free"))) TS_Future_free(uint64_t this_obj) { + LDKFuture this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Future_free(this_obj_conv); +} + +void __attribute__((export_name("TS_Future_register_callback_fn"))) TS_Future_register_callback_fn(uint64_t this_arg, uint64_t callback) { + LDKFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); + 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); } -void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) { - LDKChannelMonitorUpdate this_obj_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; +} + +uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() { + uint32_t ret_conv = LDKLevel_to_js(Level_debug()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() { + uint32_t ret_conv = LDKLevel_to_js(Level_info()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() { + uint32_t ret_conv = LDKLevel_to_js(Level_warn()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() { + uint32_t ret_conv = LDKLevel_to_js(Level_error()); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) { + LDKLevel* a_conv = (LDKLevel*)untag_ptr(a); + LDKLevel* b_conv = (LDKLevel*)untag_ptr(b); + jboolean ret_conv = Level_eq(a_conv, b_conv); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) { + LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); + int64_t ret_conv = Level_hash(o_conv); + return ret_conv; +} + +jstring __attribute__((export_name("TS_Level_to_str"))) TS_Level_to_str(uint64_t o) { + LDKLevel* o_conv = (LDKLevel*)untag_ptr(o); + LDKStr ret_str = Level_to_str(o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() { + uint32_t ret_conv = LDKLevel_to_js(Level_max()); + return ret_conv; +} + +void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) { + LDKRecord 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); - ChannelMonitorUpdate_free(this_obj_conv); + Record_free(this_obj_conv); } -int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) { - LDKChannelMonitorUpdate this_ptr_conv; +uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); + uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv)); return ret_conv; } -void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) { - LDKChannelMonitorUpdate this_ptr_conv; +void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) { + LDKRecord this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); + LDKLevel val_conv = LDKLevel_from_js(val); + Record_set_level(&this_ptr_conv, val_conv); } -static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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_Record_get_peer_id"))) TS_Record_get_peer_id(uint64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, Record_get_peer_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) { - LDKChannelMonitorUpdate 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 = ChannelMonitorUpdate_clone_ptr(&arg_conv); - return ret_conv; + +void __attribute__((export_name("TS_Record_set_peer_id"))) TS_Record_set_peer_id(uint64_t this_ptr, int8_tArray val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + Record_set_peer_id(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) { - LDKChannelMonitorUpdate 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; - LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_Record_get_channel_id"))) TS_Record_get_channel_id(uint64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId ret_var = Record_get_channel_id(&this_ptr_conv); uint64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -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); - 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 = ChannelMonitorUpdate_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_Record_set_channel_id"))) TS_Record_set_channel_id(uint64_t this_ptr, uint64_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelId 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 = ChannelId_clone(&val_conv); + Record_set_channel_id(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); - *ret_conv = ChannelMonitorUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Record_get_args(&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_MonitorEvent_free"))) TS_MonitorEvent_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); - LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - MonitorEvent_free(this_ptr_conv); +void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + Record_set_args(&this_ptr_conv, val_conv); } -static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) { - LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg); - int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); +jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Record_get_module_path(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); return ret_conv; } -uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) { - LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) { - LDKHTLCUpdate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv = HTLCUpdate_clone(&a_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_htlcevent(a_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + Record_set_module_path(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_MonitorEvent_holder_force_closed"))) TS_MonitorEvent_holder_force_closed(uint64_t a) { - 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); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_holder_force_closed(a_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Record_get_file(&this_ptr_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; } -uint64_t __attribute__((export_name("TS_MonitorEvent_completed"))) TS_MonitorEvent_completed(uint64_t funding_txo, int64_t monitor_update_id) { - LDKOutPoint funding_txo_conv; - funding_txo_conv.inner = untag_ptr(funding_txo); - funding_txo_conv.is_owned = ptr_is_owned(funding_txo); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); - funding_txo_conv = OutPoint_clone(&funding_txo_conv); - LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); - *ret_copy = MonitorEvent_completed(funding_txo_conv, monitor_update_id); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + Record_set_file(&this_ptr_conv, val_conv); } -jboolean __attribute__((export_name("TS_MonitorEvent_eq"))) TS_MonitorEvent_eq(uint64_t a, uint64_t b) { - LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); - LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); - jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); +int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = Record_get_line(&this_ptr_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) { - LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); - LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); - 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_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); - *ret_conv = MonitorEvent_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) { + LDKRecord this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + Record_set_line(&this_ptr_conv, val); } -void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) { - LDKHTLCUpdate 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); - HTLCUpdate_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_Record_new"))) TS_Record_new(uint32_t level_arg, int8_tArray peer_id_arg, uint64_t channel_id_arg, jstring args_arg, jstring module_path_arg, jstring file_arg, int32_t line_arg) { + LDKLevel level_arg_conv = LDKLevel_from_js(level_arg); + LDKPublicKey peer_id_arg_ref; + CHECK(peer_id_arg->arr_len == 33); + memcpy(peer_id_arg_ref.compressed_form, peer_id_arg->elems, 33); FREE(peer_id_arg); + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr args_arg_conv = str_ref_to_owned_c(args_arg); + LDKStr module_path_arg_conv = str_ref_to_owned_c(module_path_arg); + LDKStr file_arg_conv = str_ref_to_owned_c(file_arg); + LDKRecord ret_var = Record_new(level_arg_conv, peer_id_arg_ref, channel_id_arg_conv, args_arg_conv, module_path_arg_conv, file_arg_conv, line_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 HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { - LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg); +static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) { + LDKRecord ret_var = Record_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_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) { - LDKHTLCUpdate arg_conv; +int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) { + LDKRecord 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 = HTLCUpdate_clone_ptr(&arg_conv); + int64_t ret_conv = Record_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) { - LDKHTLCUpdate orig_conv; +uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) { + LDKRecord 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; - LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv); + LDKRecord ret_var = Record_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_HTLCUpdate_eq"))) TS_HTLCUpdate_eq(uint64_t a, uint64_t b) { - LDKHTLCUpdate a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKHTLCUpdate b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); - return ret_conv; -} - -int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) { - LDKHTLCUpdate obj_conv; - obj_conv.inner = untag_ptr(obj); - 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 = HTLCUpdate_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_Logger_free"))) TS_Logger_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); + LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Logger_free(this_ptr_conv); } -uint64_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); - *ret_conv = HTLCUpdate_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) { + LDKChannelHandshakeConfig 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); + ChannelHandshakeConfig_free(this_obj_conv); } -void __attribute__((export_name("TS_Balance_free"))) TS_Balance_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); - LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - Balance_free(this_ptr_conv); +int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv); + return ret_conv; } -static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) { - LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg); - int64_t ret_conv = Balance_clone_ptr(arg_conv); + +int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(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_to_self_delay(&this_ptr_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) { - LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_to_self_delay"))) TS_ChannelHandshakeConfig_set_our_to_self_delay(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_to_self_delay(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(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; + int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_set_our_htlc_minimum_msat(uint64_t this_ptr, int64_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_htlc_minimum_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t amount_satoshis, int32_t timeout_height, int8_tArray payment_hash, int8_tArray payment_preimage) { - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_contentious_claimable(amount_satoshis, timeout_height, payment_hash_ref, payment_preimage_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int8_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel"))) TS_ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(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; + int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Balance_maybe_timeout_claimable_htlc"))) TS_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, 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); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel"))) TS_ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(uint64_t this_ptr, int8_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_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_Balance_maybe_preimage_claimable_htlc"))) TS_Balance_maybe_preimage_claimable_htlc(int64_t amount_satoshis, int32_t expiry_height, 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); - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, payment_hash_ref); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(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; + jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_Balance_counterparty_revoked_output_claimable"))) TS_Balance_counterparty_revoked_output_claimable(int64_t amount_satoshis) { - LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_copy = Balance_counterparty_revoked_output_claimable(amount_satoshis); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean 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_negotiate_scid_privacy(&this_ptr_conv, val); } -jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) { - LDKBalance* a_conv = (LDKBalance*)untag_ptr(a); - LDKBalance* b_conv = (LDKBalance*)untag_ptr(b); - jboolean ret_conv = Balance_eq(a_conv, b_conv); +jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(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; + jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv); return ret_conv; } -int64_t __attribute__((export_name("TS_Balance_claimable_amount_satoshis"))) TS_Balance_claimable_amount_satoshis(uint64_t this_arg) { - LDKBalance* this_arg_conv = (LDKBalance*)untag_ptr(this_arg); - int64_t ret_conv = Balance_claimable_amount_satoshis(this_arg_conv); +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean 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_announced_channel(&this_ptr_conv, val); +} + +jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(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; + jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) { - LDKChannelMonitor 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); - ChannelMonitor_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean 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_commit_upfront_shutdown_pubkey(&this_ptr_conv, val); } -static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { - LDKChannelMonitor ret_var = ChannelMonitor_clone(arg); +int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(uint64_t this_ptr) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int32_t ret_conv = ChannelHandshakeConfig_get_their_channel_reserve_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths"))) TS_ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(uint64_t this_ptr, int32_t val) { + LDKChannelHandshakeConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeConfig_set_their_channel_reserve_proportional_millionths(&this_ptr_conv, val); +} + +jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx"))) TS_ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(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; + jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx"))) TS_ChannelHandshakeConfig_set_negotiate_anchors_zero_fee_htlc_tx(uint64_t this_ptr, jboolean 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_negotiate_anchors_zero_fee_htlc_tx(&this_ptr_conv, val); +} + +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, jboolean negotiate_anchors_zero_fee_htlc_tx_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, negotiate_anchors_zero_fee_htlc_tx_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); return ret_ref; } -int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) { - LDKChannelMonitor arg_conv; + +static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) { + LDKChannelHandshakeConfig 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 = ChannelMonitor_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) { - LDKChannelMonitor orig_conv; +uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) { + LDKChannelHandshakeConfig 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; - LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv); + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) { - LDKChannelMonitor 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 = ChannelMonitor_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_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() { + LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_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; } -uint64_t __attribute__((export_name("TS_ChannelMonitor_update_monitor"))) TS_ChannelMonitor_update_monitor(uint64_t this_arg, uint64_t updates, 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; - LDKChannelMonitorUpdate 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.is_owned = false; - void* broadcaster_ptr = untag_ptr(broadcaster); - if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } - LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; - void* fee_estimator_ptr = untag_ptr(fee_estimator); - if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } - LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); - *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) { + LDKChannelHandshakeLimits 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); + ChannelHandshakeLimits_free(this_obj_conv); } -int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); +int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKC2Tuple_OutPointCVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u8ZZ), "LDKC2Tuple_OutPointCVec_u8ZZ"); - *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); - return tag_ptr(ret_conv, true); -} - -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&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 a = 0; a < ret_var.datalen; a++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ* ret_conv_52_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ"); - *ret_conv_52_conv = ret_var.data[a]; - ret_arr_ptr[a] = tag_ptr(ret_conv_52_conv, true); - } - - FREE(ret_var.data); - return ret_arr; +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val); } -void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter, 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* filter_ptr = untag_ptr(filter); - if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } - LDKFilter* filter_conv = (LDKFilter*)filter_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv, logger_conv); +int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv); + return ret_conv; } -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_monitor_events"))) TS_ChannelMonitor_get_and_clear_pending_monitor_events(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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++) { - 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; +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val); } -void __attribute__((export_name("TS_ChannelMonitor_process_pending_events"))) TS_ChannelMonitor_process_pending_events(uint64_t this_arg, uint64_t handler) { - 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* handler_ptr = untag_ptr(handler); - if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } - LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; - ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); +int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelMonitor_initial_counterparty_commitment_tx"))) TS_ChannelMonitor_initial_counterparty_commitment_tx(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCommitmentTransaction ret_var = ChannelMonitor_initial_counterparty_commitment_tx(&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_ChannelHandshakeLimits_set_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_set_max_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val); } -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_counterparty_commitment_txs_from_update"))) TS_ChannelMonitor_counterparty_commitment_txs_from_update(uint64_t this_arg, uint64_t update) { - 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; - LDKChannelMonitorUpdate update_conv; - update_conv.inner = untag_ptr(update); - update_conv.is_owned = ptr_is_owned(update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); - update_conv.is_owned = false; - LDKCVec_CommitmentTransactionZ ret_var = ChannelMonitor_counterparty_commitment_txs_from_update(&this_arg_conv, &update_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 x = 0; x < ret_var.datalen; x++) { - LDKCommitmentTransaction ret_conv_23_var = ret_var.data[x]; - uint64_t ret_conv_23_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_23_var); - ret_conv_23_ref = tag_ptr(ret_conv_23_var.inner, ret_conv_23_var.is_owned); - ret_arr_ptr[x] = ret_conv_23_ref; - } - - FREE(ret_var.data); - return ret_arr; +int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat"))) TS_ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelMonitor_sign_to_local_justice_tx"))) TS_ChannelMonitor_sign_to_local_justice_tx(uint64_t this_arg, int8_tArray justice_tx, uint32_t input_idx, int64_t value, int64_t commitment_number) { - 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; - LDKTransaction justice_tx_ref; - justice_tx_ref.datalen = justice_tx->arr_len; - justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); - justice_tx_ref.data_is_owned = true; - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = ChannelMonitor_sign_to_local_justice_tx(&this_arg_conv, justice_tx_ref, input_idx, value, commitment_number); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat"))) TS_ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -ptrArray __attribute__((export_name("TS_ChannelMonitor_get_latest_holder_commitment_txn"))) TS_ChannelMonitor_get_latest_holder_commitment_txn(uint64_t this_arg, 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* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_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++) { - LDKTransaction ret_conv_12_var = ret_var.data[m]; - int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__); - memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen); - Transaction_free(ret_conv_12_var); - ret_arr_ptr[m] = ret_conv_12_arr; - } - - FREE(ret_var.data); - return ret_arr; -} - -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) TS_ChannelMonitor_block_connected(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height, 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; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = txdata->arr_len; - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - uint64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - uint64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - FREE(txdata); - 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); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_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 x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - -void __attribute__((export_name("TS_ChannelMonitor_block_disconnected"))) TS_ChannelMonitor_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height, 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; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - 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); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confirmed"))) TS_ChannelMonitor_transactions_confirmed(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height, 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; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; - txdata_constr.datalen = txdata->arr_len; - if (txdata_constr.datalen > 0) - txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); - else - txdata_constr.data = NULL; - uint64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - uint64_t txdata_conv_28 = txdata_vals[c]; - void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); - CHECK_ACCESS(txdata_conv_28_ptr); - LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); - txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); - txdata_constr.data[c] = txdata_conv_28_conv; - } - FREE(txdata); - 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); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_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 x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; -} - -void __attribute__((export_name("TS_ChannelMonitor_transaction_unconfirmed"))) TS_ChannelMonitor_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid, 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; - uint8_t txid_arr[32]; - CHECK(txid->arr_len == 32); - memcpy(txid_arr, txid->elems, 32); FREE(txid); - uint8_t (*txid_ref)[32] = &txid_arr; - 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); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); -} - -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_best_block_updated"))) TS_ChannelMonitor_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height, 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; - uint8_t header_arr[80]; - CHECK(header->arr_len == 80); - memcpy(header_arr, header->elems, 80); FREE(header); - uint8_t (*header_ref)[80] = &header_arr; - 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); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_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 x = 0; x < ret_var.datalen; x++) { - LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); - *ret_conv_49_conv = ret_var.data[x]; - ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); - } - - FREE(ret_var.data); - return ret_arr; +int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; } -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); - uint64_tArray ret_arr = NULL; - ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); - uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t c = 0; c < ret_var.datalen; c++) { - LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv_54_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); - *ret_conv_54_conv = ret_var.data[c]; - ret_arr_ptr[c] = tag_ptr(ret_conv_54_conv, true); - } - - FREE(ret_var.data); - return ret_arr; +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_set_max_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) { - LDKChannelMonitor this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBestBlock ret_var = ChannelMonitor_current_best_block(&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; +int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; } -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); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_set_min_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val); } -uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_spendable_outputs"))) TS_ChannelMonitor_get_spendable_outputs(uint64_t this_arg, int8_tArray tx, int32_t confirmation_height) { - 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; - LDKTransaction tx_ref; - tx_ref.datalen = tx->arr_len; - tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); - memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); - tx_ref.data_is_owned = true; - LDKCVec_SpendableOutputDescriptorZ ret_var = ChannelMonitor_get_spendable_outputs(&this_arg_conv, tx_ref, confirmation_height); - 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 b = 0; b < ret_var.datalen; b++) { - LDKSpendableOutputDescriptor *ret_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); - *ret_conv_27_copy = ret_var.data[b]; - uint64_t ret_conv_27_ref = tag_ptr(ret_conv_27_copy, true); - ret_arr_ptr[b] = ret_conv_27_ref; - } - - FREE(ret_var.data); - return ret_arr; +int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv); + return ret_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); - this_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_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { - LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); - *ret_conv_9_copy = ret_var.data[j]; - uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); - ret_arr_ptr[j] = ret_conv_9_ref; - } - - FREE(ret_var.data); - return ret_arr; +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesChannelMonitorZ_read"))) TS_C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - void* arg_a_ptr = untag_ptr(arg_a); - if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); } - LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr; - void* arg_b_ptr = untag_ptr(arg_b); - if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } - LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr; - LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv); - FREE(ser); - return tag_ptr(ret_conv, true); +jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) { - LDKOutPoint 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); - OutPoint_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) { - LDKOutPoint this_ptr_conv; +jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *OutPoint_get_txid(&this_ptr_conv), 32); - return ret_arr; + jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) { - LDKOutPoint this_ptr_conv; +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OutPoint_set_txid(&this_ptr_conv, val_ref); + ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val); } -int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) { - LDKOutPoint this_ptr_conv; +int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OutPoint_get_index(&this_ptr_conv); + int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) { - LDKOutPoint this_ptr_conv; +void __attribute__((export_name("TS_ChannelHandshakeLimits_set_their_to_self_delay"))) TS_ChannelHandshakeLimits_set_their_to_self_delay(uint64_t this_ptr, int16_t val) { + LDKChannelHandshakeLimits this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OutPoint_set_index(&this_ptr_conv, val); + ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { - LDKThirtyTwoBytes txid_arg_ref; - CHECK(txid_arg->arr_len == 32); - memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); - LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg); +uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_new"))) TS_ChannelHandshakeLimits_new(int64_t min_funding_satoshis_arg, int64_t max_funding_satoshis_arg, int64_t max_htlc_minimum_msat_arg, int64_t min_max_htlc_value_in_flight_msat_arg, int64_t max_channel_reserve_satoshis_arg, int16_t min_max_accepted_htlcs_arg, int32_t max_minimum_depth_arg, jboolean trust_own_funding_0conf_arg, jboolean force_announced_channel_preference_arg, int16_t their_to_self_delay_arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_new(min_funding_satoshis_arg, max_funding_satoshis_arg, max_htlc_minimum_msat_arg, min_max_htlc_value_in_flight_msat_arg, max_channel_reserve_satoshis_arg, min_max_accepted_htlcs_arg, max_minimum_depth_arg, trust_own_funding_0conf_arg, force_announced_channel_preference_arg, their_to_self_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; } -static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { - LDKOutPoint ret_var = OutPoint_clone(arg); +static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) { - LDKOutPoint arg_conv; +int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) { + LDKChannelHandshakeLimits 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 = OutPoint_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) { - LDKOutPoint orig_conv; +uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) { + LDKChannelHandshakeLimits 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; - LDKOutPoint ret_var = OutPoint_clone(&orig_conv); + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) { - LDKOutPoint a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKOutPoint 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 = OutPoint_eq(&a_conv, &b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() { + LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_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; } -int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) { - LDKOutPoint 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 = OutPoint_hash(&o_conv); - return ret_conv; +void __attribute__((export_name("TS_MaxDustHTLCExposure_free"))) TS_MaxDustHTLCExposure_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); + LDKMaxDustHTLCExposure this_ptr_conv = *(LDKMaxDustHTLCExposure*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + MaxDustHTLCExposure_free(this_ptr_conv); } -int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoint_to_channel_id(uint64_t this_arg) { - LDKOutPoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, OutPoint_to_channel_id(&this_arg_conv).data, 32); - return ret_arr; -} +static inline uint64_t MaxDustHTLCExposure_clone_ptr(LDKMaxDustHTLCExposure *NONNULL_PTR arg) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_MaxDustHTLCExposure_clone_ptr"))) TS_MaxDustHTLCExposure_clone_ptr(uint64_t arg) { + LDKMaxDustHTLCExposure* arg_conv = (LDKMaxDustHTLCExposure*)untag_ptr(arg); + int64_t ret_conv = MaxDustHTLCExposure_clone_ptr(arg_conv); + return ret_conv; +} -int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) { - LDKOutPoint 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 = OutPoint_write(&obj_conv); +uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_clone"))) TS_MaxDustHTLCExposure_clone(uint64_t orig) { + LDKMaxDustHTLCExposure* orig_conv = (LDKMaxDustHTLCExposure*)untag_ptr(orig); + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_fixed_limit_msat"))) TS_MaxDustHTLCExposure_fixed_limit_msat(int64_t a) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_fixed_limit_msat(a); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_fee_rate_multiplier"))) TS_MaxDustHTLCExposure_fee_rate_multiplier(int64_t a) { + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = MaxDustHTLCExposure_fee_rate_multiplier(a); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean __attribute__((export_name("TS_MaxDustHTLCExposure_eq"))) TS_MaxDustHTLCExposure_eq(uint64_t a, uint64_t b) { + LDKMaxDustHTLCExposure* a_conv = (LDKMaxDustHTLCExposure*)untag_ptr(a); + LDKMaxDustHTLCExposure* b_conv = (LDKMaxDustHTLCExposure*)untag_ptr(b); + jboolean ret_conv = MaxDustHTLCExposure_eq(a_conv, b_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_MaxDustHTLCExposure_write"))) TS_MaxDustHTLCExposure_write(uint64_t obj) { + LDKMaxDustHTLCExposure* obj_conv = (LDKMaxDustHTLCExposure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MaxDustHTLCExposure_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_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_MaxDustHTLCExposure_read"))) TS_MaxDustHTLCExposure_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); - *ret_conv = OutPoint_read(ser_ref); + LDKCResult_MaxDustHTLCExposureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_MaxDustHTLCExposureDecodeErrorZ), "LDKCResult_MaxDustHTLCExposureDecodeErrorZ"); + *ret_conv = MaxDustHTLCExposure_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_InboundHTLCErr_free"))) TS_InboundHTLCErr_free(uint64_t this_obj) { - LDKInboundHTLCErr this_obj_conv; +void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) { + LDKChannelConfig 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); - InboundHTLCErr_free(this_obj_conv); + ChannelConfig_free(this_obj_conv); } -int16_t __attribute__((export_name("TS_InboundHTLCErr_get_err_code"))) TS_InboundHTLCErr_get_err_code(uint64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; +int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = InboundHTLCErr_get_err_code(&this_ptr_conv); + int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_InboundHTLCErr_set_err_code"))) TS_InboundHTLCErr_set_err_code(uint64_t this_ptr, int16_t val) { - LDKInboundHTLCErr this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfig_set_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_set_forwarding_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - InboundHTLCErr_set_err_code(&this_ptr_conv, val); + ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_InboundHTLCErr_get_err_data"))) TS_InboundHTLCErr_get_err_data(uint64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; +int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = InboundHTLCErr_get_err_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; + int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_InboundHTLCErr_set_err_data"))) TS_InboundHTLCErr_set_err_data(uint64_t this_ptr, int8_tArray val) { - LDKInboundHTLCErr this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfig_set_forwarding_fee_base_msat"))) TS_ChannelConfig_set_forwarding_fee_base_msat(uint64_t this_ptr, int32_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - InboundHTLCErr_set_err_data(&this_ptr_conv, val_ref); + ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val); } -jstring __attribute__((export_name("TS_InboundHTLCErr_get_msg"))) TS_InboundHTLCErr_get_msg(uint64_t this_ptr) { - LDKInboundHTLCErr this_ptr_conv; +int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = InboundHTLCErr_get_msg(&this_ptr_conv); - jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); - Str_free(ret_str); + int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_InboundHTLCErr_set_msg"))) TS_InboundHTLCErr_set_msg(uint64_t this_ptr, jstring val) { - LDKInboundHTLCErr this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - InboundHTLCErr_set_msg(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_InboundHTLCErr_new"))) TS_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_arg, jstring msg_arg) { - LDKCVec_u8Z err_data_arg_ref; - err_data_arg_ref.datalen = err_data_arg->arr_len; - err_data_arg_ref.data = MALLOC(err_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(err_data_arg_ref.data, err_data_arg->elems, err_data_arg_ref.datalen); FREE(err_data_arg); - LDKStr msg_arg_conv = str_ref_to_owned_c(msg_arg); - LDKInboundHTLCErr ret_var = InboundHTLCErr_new(err_code_arg, err_data_arg_ref, msg_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_peel_payment_onion"))) TS_peel_payment_onion(uint64_t msg, uint64_t node_signer, uint64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { - LDKUpdateAddHTLC 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* node_signer_ptr = untag_ptr(node_signer); - if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } - LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; - void* logger_ptr = untag_ptr(logger); - if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } - LDKLogger* logger_conv = (LDKLogger*)logger_ptr; - LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); - *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_PendingHTLCRouting_free"))) TS_PendingHTLCRouting_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); - LDKPendingHTLCRouting this_ptr_conv = *(LDKPendingHTLCRouting*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - PendingHTLCRouting_free(this_ptr_conv); -} - -static inline uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg) { - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_PendingHTLCRouting_clone_ptr"))) TS_PendingHTLCRouting_clone_ptr(uint64_t arg) { - LDKPendingHTLCRouting* arg_conv = (LDKPendingHTLCRouting*)untag_ptr(arg); - int64_t ret_conv = PendingHTLCRouting_clone_ptr(arg_conv); - return ret_conv; -} - -uint64_t __attribute__((export_name("TS_PendingHTLCRouting_clone"))) TS_PendingHTLCRouting_clone(uint64_t orig) { - LDKPendingHTLCRouting* orig_conv = (LDKPendingHTLCRouting*)untag_ptr(orig); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_PendingHTLCRouting_forward"))) TS_PendingHTLCRouting_forward(uint64_t onion_packet, int64_t short_channel_id, uint64_t blinded) { - LDKOnionPacket onion_packet_conv; - onion_packet_conv.inner = untag_ptr(onion_packet); - onion_packet_conv.is_owned = ptr_is_owned(onion_packet); - CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_conv); - onion_packet_conv = OnionPacket_clone(&onion_packet_conv); - LDKBlindedForward blinded_conv; - blinded_conv.inner = untag_ptr(blinded); - blinded_conv.is_owned = ptr_is_owned(blinded); - CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv); - blinded_conv = BlindedForward_clone(&blinded_conv); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_PendingHTLCRouting_receive"))) TS_PendingHTLCRouting_receive(uint64_t payment_data, uint64_t payment_metadata, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, uint64_tArray custom_tlvs, jboolean requires_blinded_error) { - LDKFinalOnionHopData payment_data_conv; - payment_data_conv.inner = untag_ptr(payment_data); - payment_data_conv.is_owned = ptr_is_owned(payment_data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); - payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); - void* payment_metadata_ptr = untag_ptr(payment_metadata); - CHECK_ACCESS(payment_metadata_ptr); - LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); - payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); - LDKThirtyTwoBytes phantom_shared_secret_ref; - CHECK(phantom_shared_secret->arr_len == 32); - memcpy(phantom_shared_secret_ref.data, phantom_shared_secret->elems, 32); FREE(phantom_shared_secret); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - uint64_t* custom_tlvs_vals = custom_tlvs->elems; - for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { - uint64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; - void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); - CHECK_ACCESS(custom_tlvs_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); - custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); - custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; - } - FREE(custom_tlvs); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive(payment_data_conv, payment_metadata_conv, incoming_cltv_expiry, phantom_shared_secret_ref, custom_tlvs_constr, requires_blinded_error); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_PendingHTLCRouting_receive_keysend"))) TS_PendingHTLCRouting_receive_keysend(uint64_t payment_data, int8_tArray payment_preimage, uint64_t payment_metadata, int32_t incoming_cltv_expiry, uint64_tArray custom_tlvs) { - LDKFinalOnionHopData payment_data_conv; - payment_data_conv.inner = untag_ptr(payment_data); - payment_data_conv.is_owned = ptr_is_owned(payment_data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); - payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - void* payment_metadata_ptr = untag_ptr(payment_metadata); - CHECK_ACCESS(payment_metadata_ptr); - LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); - payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); - LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; - custom_tlvs_constr.datalen = custom_tlvs->arr_len; - if (custom_tlvs_constr.datalen > 0) - custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); - else - custom_tlvs_constr.data = NULL; - uint64_t* custom_tlvs_vals = custom_tlvs->elems; - for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { - uint64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; - void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); - CHECK_ACCESS(custom_tlvs_conv_23_ptr); - LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); - custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); - custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; - } - FREE(custom_tlvs); - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr); +uint64_t __attribute__((export_name("TS_ChannelConfig_get_max_dust_htlc_exposure"))) TS_ChannelConfig_get_max_dust_htlc_exposure(uint64_t this_ptr) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKMaxDustHTLCExposure *ret_copy = MALLOC(sizeof(LDKMaxDustHTLCExposure), "LDKMaxDustHTLCExposure"); + *ret_copy = ChannelConfig_get_max_dust_htlc_exposure(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_BlindedForward_free"))) TS_BlindedForward_free(uint64_t this_obj) { - LDKBlindedForward 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); - BlindedForward_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelConfig_set_max_dust_htlc_exposure"))) TS_ChannelConfig_set_max_dust_htlc_exposure(uint64_t this_ptr, uint64_t val) { + LDKChannelConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKMaxDustHTLCExposure val_conv = *(LDKMaxDustHTLCExposure*)(val_ptr); + val_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(val)); + ChannelConfig_set_max_dust_htlc_exposure(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_BlindedForward_get_inbound_blinding_point"))) TS_BlindedForward_get_inbound_blinding_point(uint64_t this_ptr) { - LDKBlindedForward this_ptr_conv; +int64_t __attribute__((export_name("TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfig_get_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, BlindedForward_get_inbound_blinding_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_BlindedForward_set_inbound_blinding_point"))) TS_BlindedForward_set_inbound_blinding_point(uint64_t this_ptr, int8_tArray val) { - LDKBlindedForward this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfig_set_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr, int64_t val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - BlindedForward_set_inbound_blinding_point(&this_ptr_conv, val_ref); + ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val); } -uint32_t __attribute__((export_name("TS_BlindedForward_get_failure"))) TS_BlindedForward_get_failure(uint64_t this_ptr) { - LDKBlindedForward this_ptr_conv; +jboolean __attribute__((export_name("TS_ChannelConfig_get_accept_underpaying_htlcs"))) TS_ChannelConfig_get_accept_underpaying_htlcs(uint64_t this_ptr) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = LDKBlindedFailure_to_js(BlindedForward_get_failure(&this_ptr_conv)); + jboolean ret_conv = ChannelConfig_get_accept_underpaying_htlcs(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_BlindedForward_set_failure"))) TS_BlindedForward_set_failure(uint64_t this_ptr, uint32_t val) { - LDKBlindedForward this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfig_set_accept_underpaying_htlcs"))) TS_ChannelConfig_set_accept_underpaying_htlcs(uint64_t this_ptr, jboolean val) { + LDKChannelConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBlindedFailure val_conv = LDKBlindedFailure_from_js(val); - BlindedForward_set_failure(&this_ptr_conv, val_conv); + ChannelConfig_set_accept_underpaying_htlcs(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_BlindedForward_new"))) TS_BlindedForward_new(int8_tArray inbound_blinding_point_arg, uint32_t failure_arg) { - LDKPublicKey inbound_blinding_point_arg_ref; - CHECK(inbound_blinding_point_arg->arr_len == 33); - memcpy(inbound_blinding_point_arg_ref.compressed_form, inbound_blinding_point_arg->elems, 33); FREE(inbound_blinding_point_arg); - LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_js(failure_arg); - LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_arg_conv); +uint64_t __attribute__((export_name("TS_ChannelConfig_new"))) TS_ChannelConfig_new(int32_t forwarding_fee_proportional_millionths_arg, int32_t forwarding_fee_base_msat_arg, int16_t cltv_expiry_delta_arg, uint64_t max_dust_htlc_exposure_arg, int64_t force_close_avoidance_max_fee_satoshis_arg, jboolean accept_underpaying_htlcs_arg) { + void* max_dust_htlc_exposure_arg_ptr = untag_ptr(max_dust_htlc_exposure_arg); + CHECK_ACCESS(max_dust_htlc_exposure_arg_ptr); + LDKMaxDustHTLCExposure max_dust_htlc_exposure_arg_conv = *(LDKMaxDustHTLCExposure*)(max_dust_htlc_exposure_arg_ptr); + max_dust_htlc_exposure_arg_conv = MaxDustHTLCExposure_clone((LDKMaxDustHTLCExposure*)untag_ptr(max_dust_htlc_exposure_arg)); + LDKChannelConfig ret_var = ChannelConfig_new(forwarding_fee_proportional_millionths_arg, forwarding_fee_base_msat_arg, cltv_expiry_delta_arg, max_dust_htlc_exposure_arg_conv, force_close_avoidance_max_fee_satoshis_arg, accept_underpaying_htlcs_arg); uint64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg) { - LDKBlindedForward ret_var = BlindedForward_clone(arg); +static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) { + LDKChannelConfig ret_var = ChannelConfig_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_BlindedForward_clone_ptr"))) TS_BlindedForward_clone_ptr(uint64_t arg) { - LDKBlindedForward arg_conv; +int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) { + LDKChannelConfig 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 = BlindedForward_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_BlindedForward_clone"))) TS_BlindedForward_clone(uint64_t orig) { - LDKBlindedForward orig_conv; +uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) { + LDKChannelConfig 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; - LDKBlindedForward ret_var = BlindedForward_clone(&orig_conv); + LDKChannelConfig ret_var = ChannelConfig_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_BlindedForward_hash"))) TS_BlindedForward_hash(uint64_t o) { - LDKBlindedForward 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 = BlindedForward_hash(&o_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_BlindedForward_eq"))) TS_BlindedForward_eq(uint64_t a, uint64_t b) { - LDKBlindedForward a_conv; +jboolean __attribute__((export_name("TS_ChannelConfig_eq"))) TS_ChannelConfig_eq(uint64_t a, uint64_t b) { + LDKChannelConfig a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKBlindedForward b_conv; + LDKChannelConfig b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = BlindedForward_eq(&a_conv, &b_conv); + jboolean ret_conv = ChannelConfig_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_PendingHTLCInfo_free"))) TS_PendingHTLCInfo_free(uint64_t this_obj) { - LDKPendingHTLCInfo this_obj_conv; +void __attribute__((export_name("TS_ChannelConfig_apply"))) TS_ChannelConfig_apply(uint64_t this_arg, uint64_t update) { + LDKChannelConfig this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelConfigUpdate update_conv; + update_conv.inner = untag_ptr(update); + update_conv.is_owned = ptr_is_owned(update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv.is_owned = false; + ChannelConfig_apply(&this_arg_conv, &update_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() { + LDKChannelConfig ret_var = ChannelConfig_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; +} + +int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) { + LDKChannelConfig 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 = ChannelConfig_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_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ"); + *ret_conv = ChannelConfig_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_ChannelConfigUpdate_free"))) TS_ChannelConfigUpdate_free(uint64_t this_obj) { + LDKChannelConfigUpdate 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); - PendingHTLCInfo_free(this_obj_conv); + ChannelConfigUpdate_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_PendingHTLCInfo_get_routing"))) TS_PendingHTLCInfo_get_routing(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); - *ret_copy = PendingHTLCInfo_get_routing(&this_ptr_conv); + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelConfigUpdate_get_forwarding_fee_proportional_millionths(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_PendingHTLCInfo_set_routing"))) TS_PendingHTLCInfo_set_routing(uint64_t this_ptr, uint64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths"))) TS_ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(uint64_t this_ptr, uint64_t val) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKPendingHTLCRouting val_conv = *(LDKPendingHTLCRouting*)(val_ptr); - val_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(val)); - PendingHTLCInfo_set_routing(&this_ptr_conv, val_conv); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelConfigUpdate_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_PendingHTLCInfo_get_incoming_shared_secret"))) TS_PendingHTLCInfo_get_incoming_shared_secret(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_forwarding_fee_base_msat"))) TS_ChannelConfigUpdate_get_forwarding_fee_base_msat(uint64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *PendingHTLCInfo_get_incoming_shared_secret(&this_ptr_conv), 32); - return ret_arr; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelConfigUpdate_get_forwarding_fee_base_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_PendingHTLCInfo_set_incoming_shared_secret"))) TS_PendingHTLCInfo_set_incoming_shared_secret(uint64_t this_ptr, int8_tArray val) { - LDKPendingHTLCInfo this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfigUpdate_set_forwarding_fee_base_msat"))) TS_ChannelConfigUpdate_set_forwarding_fee_base_msat(uint64_t this_ptr, uint64_t val) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - PendingHTLCInfo_set_incoming_shared_secret(&this_ptr_conv, val_ref); + 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)); + ChannelConfigUpdate_set_forwarding_fee_base_msat(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_PendingHTLCInfo_get_payment_hash"))) TS_PendingHTLCInfo_get_payment_hash(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_cltv_expiry_delta"))) TS_ChannelConfigUpdate_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *PendingHTLCInfo_get_payment_hash(&this_ptr_conv), 32); - return ret_arr; + LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelConfigUpdate_get_cltv_expiry_delta(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_PendingHTLCInfo_set_payment_hash"))) TS_PendingHTLCInfo_set_payment_hash(uint64_t this_ptr, int8_tArray val) { - LDKPendingHTLCInfo this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfigUpdate_set_cltv_expiry_delta"))) TS_ChannelConfigUpdate_set_cltv_expiry_delta(uint64_t this_ptr, uint64_t val) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - PendingHTLCInfo_set_payment_hash(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + ChannelConfigUpdate_set_cltv_expiry_delta(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_PendingHTLCInfo_get_incoming_amt_msat"))) TS_PendingHTLCInfo_get_incoming_amt_msat(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat"))) TS_ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(uint64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = PendingHTLCInfo_get_incoming_amt_msat(&this_ptr_conv); + LDKCOption_MaxDustHTLCExposureZ *ret_copy = MALLOC(sizeof(LDKCOption_MaxDustHTLCExposureZ), "LDKCOption_MaxDustHTLCExposureZ"); + *ret_copy = ChannelConfigUpdate_get_max_dust_htlc_exposure_msat(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_PendingHTLCInfo_set_incoming_amt_msat"))) TS_PendingHTLCInfo_set_incoming_amt_msat(uint64_t this_ptr, uint64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat"))) TS_ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(uint64_t this_ptr, uint64_t val) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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)); - PendingHTLCInfo_set_incoming_amt_msat(&this_ptr_conv, val_conv); + LDKCOption_MaxDustHTLCExposureZ val_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(val_ptr); + val_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(val)); + ChannelConfigUpdate_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val_conv); } -int64_t __attribute__((export_name("TS_PendingHTLCInfo_get_outgoing_amt_msat"))) TS_PendingHTLCInfo_get_outgoing_amt_msat(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); - return ret_conv; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelConfigUpdate_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_PendingHTLCInfo_set_outgoing_amt_msat"))) TS_PendingHTLCInfo_set_outgoing_amt_msat(uint64_t this_ptr, int64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +void __attribute__((export_name("TS_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis"))) TS_ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(uint64_t this_ptr, uint64_t val) { + LDKChannelConfigUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); + 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)); + ChannelConfigUpdate_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val_conv); } -int32_t __attribute__((export_name("TS_PendingHTLCInfo_get_outgoing_cltv_value"))) TS_PendingHTLCInfo_get_outgoing_cltv_value(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PendingHTLCInfo_get_outgoing_cltv_value(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_new"))) TS_ChannelConfigUpdate_new(uint64_t forwarding_fee_proportional_millionths_arg, uint64_t forwarding_fee_base_msat_arg, uint64_t cltv_expiry_delta_arg, uint64_t max_dust_htlc_exposure_msat_arg, uint64_t force_close_avoidance_max_fee_satoshis_arg) { + void* forwarding_fee_proportional_millionths_arg_ptr = untag_ptr(forwarding_fee_proportional_millionths_arg); + CHECK_ACCESS(forwarding_fee_proportional_millionths_arg_ptr); + LDKCOption_u32Z forwarding_fee_proportional_millionths_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_proportional_millionths_arg_ptr); + forwarding_fee_proportional_millionths_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_proportional_millionths_arg)); + void* forwarding_fee_base_msat_arg_ptr = untag_ptr(forwarding_fee_base_msat_arg); + CHECK_ACCESS(forwarding_fee_base_msat_arg_ptr); + LDKCOption_u32Z forwarding_fee_base_msat_arg_conv = *(LDKCOption_u32Z*)(forwarding_fee_base_msat_arg_ptr); + forwarding_fee_base_msat_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(forwarding_fee_base_msat_arg)); + void* cltv_expiry_delta_arg_ptr = untag_ptr(cltv_expiry_delta_arg); + CHECK_ACCESS(cltv_expiry_delta_arg_ptr); + LDKCOption_u16Z cltv_expiry_delta_arg_conv = *(LDKCOption_u16Z*)(cltv_expiry_delta_arg_ptr); + cltv_expiry_delta_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(cltv_expiry_delta_arg)); + void* max_dust_htlc_exposure_msat_arg_ptr = untag_ptr(max_dust_htlc_exposure_msat_arg); + CHECK_ACCESS(max_dust_htlc_exposure_msat_arg_ptr); + LDKCOption_MaxDustHTLCExposureZ max_dust_htlc_exposure_msat_arg_conv = *(LDKCOption_MaxDustHTLCExposureZ*)(max_dust_htlc_exposure_msat_arg_ptr); + max_dust_htlc_exposure_msat_arg_conv = COption_MaxDustHTLCExposureZ_clone((LDKCOption_MaxDustHTLCExposureZ*)untag_ptr(max_dust_htlc_exposure_msat_arg)); + void* force_close_avoidance_max_fee_satoshis_arg_ptr = untag_ptr(force_close_avoidance_max_fee_satoshis_arg); + CHECK_ACCESS(force_close_avoidance_max_fee_satoshis_arg_ptr); + LDKCOption_u64Z force_close_avoidance_max_fee_satoshis_arg_conv = *(LDKCOption_u64Z*)(force_close_avoidance_max_fee_satoshis_arg_ptr); + force_close_avoidance_max_fee_satoshis_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(force_close_avoidance_max_fee_satoshis_arg)); + LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_new(forwarding_fee_proportional_millionths_arg_conv, forwarding_fee_base_msat_arg_conv, cltv_expiry_delta_arg_conv, max_dust_htlc_exposure_msat_arg_conv, force_close_avoidance_max_fee_satoshis_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_PendingHTLCInfo_set_outgoing_cltv_value"))) TS_PendingHTLCInfo_set_outgoing_cltv_value(uint64_t this_ptr, int32_t val) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelConfigUpdate_default"))) TS_ChannelConfigUpdate_default() { + LDKChannelConfigUpdate ret_var = ChannelConfigUpdate_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; +} + +void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) { + LDKUserConfig 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); + UserConfig_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - PendingHTLCInfo_set_outgoing_cltv_value(&this_ptr_conv, val); + LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&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_PendingHTLCInfo_get_skimmed_fee_msat"))) TS_PendingHTLCInfo_get_skimmed_fee_msat(uint64_t this_ptr) { - LDKPendingHTLCInfo this_ptr_conv; +void __attribute__((export_name("TS_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = PendingHTLCInfo_get_skimmed_fee_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + LDKChannelHandshakeConfig 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 = ChannelHandshakeConfig_clone(&val_conv); + UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_PendingHTLCInfo_set_skimmed_fee_msat"))) TS_PendingHTLCInfo_set_skimmed_fee_msat(uint64_t this_ptr, uint64_t val) { - LDKPendingHTLCInfo this_ptr_conv; +uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - 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)); - PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_PendingHTLCInfo_new"))) TS_PendingHTLCInfo_new(uint64_t routing_arg, int8_tArray incoming_shared_secret_arg, int8_tArray payment_hash_arg, uint64_t incoming_amt_msat_arg, int64_t outgoing_amt_msat_arg, int32_t outgoing_cltv_value_arg, uint64_t skimmed_fee_msat_arg) { - void* routing_arg_ptr = untag_ptr(routing_arg); - CHECK_ACCESS(routing_arg_ptr); - LDKPendingHTLCRouting routing_arg_conv = *(LDKPendingHTLCRouting*)(routing_arg_ptr); - routing_arg_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(routing_arg)); - LDKThirtyTwoBytes incoming_shared_secret_arg_ref; - CHECK(incoming_shared_secret_arg->arr_len == 32); - memcpy(incoming_shared_secret_arg_ref.data, incoming_shared_secret_arg->elems, 32); FREE(incoming_shared_secret_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* incoming_amt_msat_arg_ptr = untag_ptr(incoming_amt_msat_arg); - CHECK_ACCESS(incoming_amt_msat_arg_ptr); - LDKCOption_u64Z incoming_amt_msat_arg_conv = *(LDKCOption_u64Z*)(incoming_amt_msat_arg_ptr); - incoming_amt_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(incoming_amt_msat_arg)); - void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); - CHECK_ACCESS(skimmed_fee_msat_arg_ptr); - LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); - skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_new(routing_arg_conv, incoming_shared_secret_arg_ref, payment_hash_arg_ref, incoming_amt_msat_arg_conv, outgoing_amt_msat_arg, outgoing_cltv_value_arg, skimmed_fee_msat_arg_conv); + LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&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; } -static inline uint64_t PendingHTLCInfo_clone_ptr(LDKPendingHTLCInfo *NONNULL_PTR arg) { - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_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_PendingHTLCInfo_clone_ptr"))) TS_PendingHTLCInfo_clone_ptr(uint64_t arg) { - LDKPendingHTLCInfo 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 = PendingHTLCInfo_clone_ptr(&arg_conv); - return ret_conv; +void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelHandshakeLimits 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 = ChannelHandshakeLimits_clone(&val_conv); + UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_PendingHTLCInfo_clone"))) TS_PendingHTLCInfo_clone(uint64_t orig) { - LDKPendingHTLCInfo 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; - LDKPendingHTLCInfo ret_var = PendingHTLCInfo_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelConfig ret_var = UserConfig_get_channel_config(&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; } -uint32_t __attribute__((export_name("TS_BlindedFailure_clone"))) TS_BlindedFailure_clone(uint64_t orig) { - LDKBlindedFailure* orig_conv = (LDKBlindedFailure*)untag_ptr(orig); - uint32_t ret_conv = LDKBlindedFailure_to_js(BlindedFailure_clone(orig_conv)); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_BlindedFailure_from_introduction_node"))) TS_BlindedFailure_from_introduction_node() { - uint32_t ret_conv = LDKBlindedFailure_to_js(BlindedFailure_from_introduction_node()); - return ret_conv; +void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelConfig 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 = ChannelConfig_clone(&val_conv); + UserConfig_set_channel_config(&this_ptr_conv, val_conv); } -uint32_t __attribute__((export_name("TS_BlindedFailure_from_blinded_node"))) TS_BlindedFailure_from_blinded_node() { - uint32_t ret_conv = LDKBlindedFailure_to_js(BlindedFailure_from_blinded_node()); +jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv); return ret_conv; } -int64_t __attribute__((export_name("TS_BlindedFailure_hash"))) TS_BlindedFailure_hash(uint64_t o) { - LDKBlindedFailure* o_conv = (LDKBlindedFailure*)untag_ptr(o); - int64_t ret_conv = BlindedFailure_hash(o_conv); - return ret_conv; +void __attribute__((export_name("TS_UserConfig_set_accept_forwards_to_priv_channels"))) TS_UserConfig_set_accept_forwards_to_priv_channels(uint64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val); } -jboolean __attribute__((export_name("TS_BlindedFailure_eq"))) TS_BlindedFailure_eq(uint64_t a, uint64_t b) { - LDKBlindedFailure* a_conv = (LDKBlindedFailure*)untag_ptr(a); - LDKBlindedFailure* b_conv = (LDKBlindedFailure*)untag_ptr(b); - jboolean ret_conv = BlindedFailure_eq(a_conv, b_conv); +jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_FailureCode_free"))) TS_FailureCode_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); - LDKFailureCode this_ptr_conv = *(LDKFailureCode*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - FailureCode_free(this_ptr_conv); +void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_accept_inbound_channels(&this_ptr_conv, val); } -static inline uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg) { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_clone(arg); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} -int64_t __attribute__((export_name("TS_FailureCode_clone_ptr"))) TS_FailureCode_clone_ptr(uint64_t arg) { - LDKFailureCode* arg_conv = (LDKFailureCode*)untag_ptr(arg); - int64_t ret_conv = FailureCode_clone_ptr(arg_conv); +jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_FailureCode_clone"))) TS_FailureCode_clone(uint64_t orig) { - LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig); - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_FailureCode_temporary_node_failure"))) TS_FailureCode_temporary_node_failure() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_temporary_node_failure(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_FailureCode_required_node_feature_missing"))) TS_FailureCode_required_node_feature_missing() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_required_node_feature_missing(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_FailureCode_incorrect_or_unknown_payment_details"))) TS_FailureCode_incorrect_or_unknown_payment_details() { - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_incorrect_or_unknown_payment_details(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_FailureCode_invalid_onion_payload"))) TS_FailureCode_invalid_onion_payload(uint64_t a) { - void* a_ptr = untag_ptr(a); - CHECK_ACCESS(a_ptr); - LDKCOption_C2Tuple_u64u16ZZ a_conv = *(LDKCOption_C2Tuple_u64u16ZZ*)(a_ptr); - a_conv = COption_C2Tuple_u64u16ZZ_clone((LDKCOption_C2Tuple_u64u16ZZ*)untag_ptr(a)); - LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); - *ret_copy = FailureCode_invalid_onion_payload(a_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) { - LDKChannelManager this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ChannelManager_free(this_obj_conv); -} - -void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) { - LDKChainParameters 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); - ChainParameters_free(this_obj_conv); +void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val); } -uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) { - LDKChainParameters this_ptr_conv; +jboolean __attribute__((export_name("TS_UserConfig_get_accept_intercept_htlcs"))) TS_UserConfig_get_accept_intercept_htlcs(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv)); + jboolean ret_conv = UserConfig_get_accept_intercept_htlcs(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) { - LDKChainParameters this_ptr_conv; +void __attribute__((export_name("TS_UserConfig_set_accept_intercept_htlcs"))) TS_UserConfig_set_accept_intercept_htlcs(uint64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKNetwork val_conv = LDKNetwork_from_js(val); - ChainParameters_set_network(&this_ptr_conv, val_conv); + UserConfig_set_accept_intercept_htlcs(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) { - LDKChainParameters this_ptr_conv; +jboolean __attribute__((export_name("TS_UserConfig_get_accept_mpp_keysend"))) TS_UserConfig_get_accept_mpp_keysend(uint64_t this_ptr) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBestBlock ret_var = ChainParameters_get_best_block(&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 ret_conv = UserConfig_get_accept_mpp_keysend(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) { - LDKChainParameters this_ptr_conv; +void __attribute__((export_name("TS_UserConfig_set_accept_mpp_keysend"))) TS_UserConfig_set_accept_mpp_keysend(uint64_t this_ptr, jboolean val) { + LDKUserConfig this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKBestBlock 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 = BestBlock_clone(&val_conv); - ChainParameters_set_best_block(&this_ptr_conv, val_conv); + UserConfig_set_accept_mpp_keysend(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) { - LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg); - LDKBestBlock best_block_arg_conv; - best_block_arg_conv.inner = untag_ptr(best_block_arg); - best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); - best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); - LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv); +uint64_t __attribute__((export_name("TS_UserConfig_new"))) TS_UserConfig_new(uint64_t channel_handshake_config_arg, uint64_t channel_handshake_limits_arg, uint64_t channel_config_arg, jboolean accept_forwards_to_priv_channels_arg, jboolean accept_inbound_channels_arg, jboolean manually_accept_inbound_channels_arg, jboolean accept_intercept_htlcs_arg, jboolean accept_mpp_keysend_arg) { + LDKChannelHandshakeConfig channel_handshake_config_arg_conv; + channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg); + channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv); + channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv); + LDKChannelHandshakeLimits channel_handshake_limits_arg_conv; + channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg); + channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv); + channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv); + LDKChannelConfig channel_config_arg_conv; + channel_config_arg_conv.inner = untag_ptr(channel_config_arg); + channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv); + channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv); + LDKUserConfig ret_var = UserConfig_new(channel_handshake_config_arg_conv, channel_handshake_limits_arg_conv, channel_config_arg_conv, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_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 ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { - LDKChainParameters ret_var = ChainParameters_clone(arg); +static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) { + LDKUserConfig ret_var = UserConfig_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_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) { - LDKChainParameters arg_conv; +int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) { + LDKUserConfig 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 = ChainParameters_clone_ptr(&arg_conv); + int64_t ret_conv = UserConfig_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) { - LDKChainParameters orig_conv; +uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) { + LDKUserConfig 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; - LDKChainParameters ret_var = ChainParameters_clone(&orig_conv); + LDKUserConfig ret_var = UserConfig_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_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) { - LDKCounterpartyForwardingInfo this_obj_conv; +uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() { + LDKUserConfig ret_var = UserConfig_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; +} + +void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) { + LDKBestBlock 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); - CounterpartyForwardingInfo_free(this_obj_conv); -} - -int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); + BestBlock_free(this_obj_conv); } -int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; +int8_tArray __attribute__((export_name("TS_BestBlock_get_block_hash"))) TS_BestBlock_get_block_hash(uint64_t this_ptr) { + LDKBestBlock this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *BestBlock_get_block_hash(&this_ptr_conv), 32); + return ret_arr; } -void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; +void __attribute__((export_name("TS_BestBlock_set_block_hash"))) TS_BestBlock_set_block_hash(uint64_t this_ptr, int8_tArray val) { + LDKBestBlock this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + BestBlock_set_block_hash(&this_ptr_conv, val_ref); } -int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) { - LDKCounterpartyForwardingInfo this_ptr_conv; +int32_t __attribute__((export_name("TS_BestBlock_get_height"))) TS_BestBlock_get_height(uint64_t this_ptr) { + LDKBestBlock this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + int32_t ret_conv = BestBlock_get_height(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { - LDKCounterpartyForwardingInfo this_ptr_conv; +void __attribute__((export_name("TS_BestBlock_set_height"))) TS_BestBlock_set_height(uint64_t this_ptr, int32_t val) { + LDKBestBlock this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); + BestBlock_set_height(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_new"))) TS_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg); +uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash_arg, int32_t height_arg) { + LDKThirtyTwoBytes block_hash_arg_ref; + CHECK(block_hash_arg->arr_len == 32); + memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg); + LDKBestBlock ret_var = BestBlock_new(block_hash_arg_ref, height_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 CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg); +static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { + LDKBestBlock ret_var = BestBlock_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_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) { - LDKCounterpartyForwardingInfo arg_conv; +int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) { + LDKBestBlock 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 = CounterpartyForwardingInfo_clone_ptr(&arg_conv); + int64_t ret_conv = BestBlock_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) { - LDKCounterpartyForwardingInfo orig_conv; +uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) { + LDKBestBlock 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; - LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv); + LDKBestBlock ret_var = BestBlock_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_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) { - LDKChannelCounterparty 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); - ChannelCounterparty_free(this_obj_conv); -} - -int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t __attribute__((export_name("TS_BestBlock_hash"))) TS_BestBlock_hash(uint64_t o) { + LDKBestBlock 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 = BestBlock_hash(&o_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); +jboolean __attribute__((export_name("TS_BestBlock_eq"))) TS_BestBlock_eq(uint64_t a, uint64_t b) { + LDKBestBlock a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKBestBlock b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = BestBlock_eq(&a_conv, &b_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_BestBlock_from_network"))) TS_BestBlock_from_network(uint32_t network) { + LDKNetwork network_conv = LDKNetwork_from_js(network); + LDKBestBlock ret_var = BestBlock_from_network(network_conv); uint64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKInitFeatures 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 = InitFeatures_clone(&val_conv); - ChannelCounterparty_set_features(&this_ptr_conv, val_conv); +int8_tArray __attribute__((export_name("TS_BestBlock_write"))) TS_BestBlock_write(uint64_t obj) { + LDKBestBlock 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 = BestBlock_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_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_BestBlock_read"))) TS_BestBlock_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BestBlockDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BestBlockDecodeErrorZ), "LDKCResult_BestBlockDecodeErrorZ"); + *ret_conv = BestBlock_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_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_Listen_free"))) TS_Listen_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); + LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Listen_free(this_ptr_conv); } -void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCounterpartyForwardingInfo 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 = CounterpartyForwardingInfo_clone(&val_conv); - ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); +void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_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); + LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Confirm_free(this_ptr_conv); } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_clone"))) TS_ChannelMonitorUpdateStatus_clone(uint64_t orig) { + LDKChannelMonitorUpdateStatus* orig_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(orig); + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_clone(orig_conv)); + return ret_conv; } -void __attribute__((export_name("TS_ChannelCounterparty_set_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_set_outbound_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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)); - ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_completed"))) TS_ChannelMonitorUpdateStatus_completed() { + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_completed()); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_in_progress"))) TS_ChannelMonitorUpdateStatus_in_progress() { + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_in_progress()); + return ret_conv; } -void __attribute__((export_name("TS_ChannelCounterparty_set_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_set_outbound_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) { - LDKChannelCounterparty this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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)); - ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); +uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateStatus_unrecoverable_error"))) TS_ChannelMonitorUpdateStatus_unrecoverable_error() { + uint32_t ret_conv = LDKChannelMonitorUpdateStatus_to_js(ChannelMonitorUpdateStatus_unrecoverable_error()); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelCounterparty_new(int8_tArray node_id_arg, uint64_t features_arg, int64_t unspendable_punishment_reserve_arg, uint64_t forwarding_info_arg, uint64_t outbound_htlc_minimum_msat_arg, uint64_t outbound_htlc_maximum_msat_arg) { - LDKPublicKey node_id_arg_ref; - CHECK(node_id_arg->arr_len == 33); - memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); - LDKInitFeatures 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 = InitFeatures_clone(&features_arg_conv); - LDKCounterpartyForwardingInfo forwarding_info_arg_conv; - forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg); - forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); - forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); - void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg); - CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); - outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg)); - void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg); - CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); - outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg)); - LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_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; +jboolean __attribute__((export_name("TS_ChannelMonitorUpdateStatus_eq"))) TS_ChannelMonitorUpdateStatus_eq(uint64_t a, uint64_t b) { + LDKChannelMonitorUpdateStatus* a_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(a); + LDKChannelMonitorUpdateStatus* b_conv = (LDKChannelMonitorUpdateStatus*)untag_ptr(b); + jboolean ret_conv = ChannelMonitorUpdateStatus_eq(a_conv, b_conv); + return ret_conv; } -static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { - LDKChannelCounterparty ret_var = ChannelCounterparty_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_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) { - LDKChannelCounterparty 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 = ChannelCounterparty_clone_ptr(&arg_conv); - return ret_conv; +void __attribute__((export_name("TS_Watch_free"))) TS_Watch_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); + LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Watch_free(this_ptr_conv); } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) { - LDKChannelCounterparty 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; - LDKChannelCounterparty ret_var = ChannelCounterparty_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_Filter_free"))) TS_Filter_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); + LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Filter_free(this_ptr_conv); } -void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) { - LDKChannelDetails this_obj_conv; +void __attribute__((export_name("TS_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) { + LDKWatchedOutput 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); - ChannelDetails_free(this_obj_conv); + WatchedOutput_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +uint64_t __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *ChannelDetails_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKCOption_ThirtyTwoBytesZ *ret_copy = MALLOC(sizeof(LDKCOption_ThirtyTwoBytesZ), "LDKCOption_ThirtyTwoBytesZ"); + *ret_copy = WatchedOutput_get_block_hash(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKChannelDetails this_ptr_conv; +void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, uint64_t val) { + LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ChannelDetails_set_channel_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_ThirtyTwoBytesZ val_conv = *(LDKCOption_ThirtyTwoBytesZ*)(val_ptr); + val_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(val)); + WatchedOutput_set_block_hash(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv); + LDKOutPoint ret_var = WatchedOutput_get_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_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(uint64_t this_ptr, uint64_t val) { - LDKChannelDetails this_ptr_conv; +void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) { + LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelCounterparty val_conv; + 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 = ChannelCounterparty_clone(&val_conv); - ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); + val_conv = OutPoint_clone(&val_conv); + WatchedOutput_set_outpoint(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) { + LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelDetails_get_funding_txo(&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_u8Z ret_var = WatchedOutput_get_script_pubkey(&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_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(uint64_t this_ptr, uint64_t val) { - LDKChannelDetails this_ptr_conv; +void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) { + LDKWatchedOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); + 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); + WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(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; - LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_WatchedOutput_new"))) TS_WatchedOutput_new(uint64_t block_hash_arg, uint64_t outpoint_arg, int8_tArray script_pubkey_arg) { + void* block_hash_arg_ptr = untag_ptr(block_hash_arg); + CHECK_ACCESS(block_hash_arg_ptr); + LDKCOption_ThirtyTwoBytesZ block_hash_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(block_hash_arg_ptr); + block_hash_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(block_hash_arg)); + LDKOutPoint outpoint_arg_conv; + outpoint_arg_conv.inner = untag_ptr(outpoint_arg); + outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv); + outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv); + LDKCVec_u8Z script_pubkey_arg_ref; + script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len; + script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg); + LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_conv, outpoint_arg_conv, script_pubkey_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; } -void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(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; - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone(&val_conv); - ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) { + LDKWatchedOutput ret_var = WatchedOutput_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_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) { + LDKWatchedOutput 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 = WatchedOutput_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) { + LDKWatchedOutput 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; + LDKWatchedOutput ret_var = WatchedOutput_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_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); +jboolean __attribute__((export_name("TS_WatchedOutput_eq"))) TS_WatchedOutput_eq(uint64_t a, uint64_t b) { + LDKWatchedOutput a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWatchedOutput b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WatchedOutput_eq(&a_conv, &b_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) { + LDKWatchedOutput 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 = WatchedOutput_hash(&o_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); +void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_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); + LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + BroadcasterInterface_free(this_ptr_conv); } -int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); +uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) { + LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig); + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv)); return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_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; - ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); +uint32_t __attribute__((export_name("TS_ConfirmationTarget_on_chain_sweep"))) TS_ConfirmationTarget_on_chain_sweep() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_on_chain_sweep()); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint32_t __attribute__((export_name("TS_ConfirmationTarget_min_allowed_anchor_channel_remote_fee"))) TS_ConfirmationTarget_min_allowed_anchor_channel_remote_fee() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_min_allowed_anchor_channel_remote_fee()); + return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); +uint32_t __attribute__((export_name("TS_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee"))) TS_ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_min_allowed_non_anchor_channel_remote_fee()); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(16, __LINE__); - memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); - return ret_arr; +uint32_t __attribute__((export_name("TS_ConfirmationTarget_anchor_channel_fee"))) TS_ConfirmationTarget_anchor_channel_fee() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_anchor_channel_fee()); + return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKU128 val_ref; - CHECK(val->arr_len == 16); - memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); - ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); +uint32_t __attribute__((export_name("TS_ConfirmationTarget_non_anchor_channel_fee"))) TS_ConfirmationTarget_non_anchor_channel_fee() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_non_anchor_channel_fee()); + return ret_conv; } -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; +uint32_t __attribute__((export_name("TS_ConfirmationTarget_channel_close_minimum"))) TS_ConfirmationTarget_channel_close_minimum() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_channel_close_minimum()); + return ret_conv; } -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); +uint32_t __attribute__((export_name("TS_ConfirmationTarget_output_spending_fee"))) TS_ConfirmationTarget_output_spending_fee() { + uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_output_spending_fee()); + return ret_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); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); +int64_t __attribute__((export_name("TS_ConfirmationTarget_hash"))) TS_ConfirmationTarget_hash(uint64_t o) { + LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); + int64_t ret_conv = ConfirmationTarget_hash(o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_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; - ChannelDetails_set_balance_msat(&this_ptr_conv, val); -} - -int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); +jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) { + LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a); + LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b); + jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_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; - ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); +void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_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); + LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FeeEstimator_free(this_ptr_conv); } -int64_t __attribute__((export_name("TS_ChannelDetails_get_next_outbound_htlc_limit_msat"))) TS_ChannelDetails_get_next_outbound_htlc_limit_msat(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); +void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) { + LDKMonitorUpdateId 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); + MonitorUpdateId_free(this_obj_conv); +} + +static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) { + LDKMonitorUpdateId ret_var = MonitorUpdateId_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_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) { + LDKMonitorUpdateId 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 = MonitorUpdateId_clone_ptr(&arg_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_next_outbound_htlc_limit_msat"))) TS_ChannelDetails_set_next_outbound_htlc_limit_msat(uint64_t this_ptr, int64_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; - ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) { + LDKMonitorUpdateId 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; + LDKMonitorUpdateId ret_var = MonitorUpdateId_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_ChannelDetails_get_next_outbound_htlc_minimum_msat"))) TS_ChannelDetails_get_next_outbound_htlc_minimum_msat(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_minimum_msat(&this_ptr_conv); +int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) { + LDKMonitorUpdateId 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 = MonitorUpdateId_hash(&o_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_next_outbound_htlc_minimum_msat"))) TS_ChannelDetails_set_next_outbound_htlc_minimum_msat(uint64_t this_ptr, int64_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; - ChannelDetails_set_next_outbound_htlc_minimum_msat(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) { + LDKMonitorUpdateId 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; + LDKMonitorUpdateId 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 = MonitorUpdateId_eq(&a_conv, &b_conv); + return ret_conv; } -int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); - return ret_conv; +void __attribute__((export_name("TS_Persist_free"))) TS_Persist_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); + LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Persist_free(this_ptr_conv); } -void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_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; - ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); +void __attribute__((export_name("TS_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) { + LDKLockedChannelMonitor 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); + LockedChannelMonitor_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); +void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) { + LDKChainMonitor 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); + ChainMonitor_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_ChainMonitor_new"))) TS_ChainMonitor_new(uint64_t chain_source, uint64_t broadcaster, uint64_t logger, uint64_t feeest, uint64_t persister) { + void* chain_source_ptr = untag_ptr(chain_source); + CHECK_ACCESS(chain_source_ptr); + LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr); + // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ + if (chain_source_conv.tag == LDKCOption_FilterZ_Some) { + // Manually implement clone for Java trait instances + if (chain_source_conv.some.free == LDKFilter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFilter_JCalls_cloned(&chain_source_conv.some); + } + } + 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* 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* feeest_ptr = untag_ptr(feeest); + CHECK_ACCESS(feeest_ptr); + LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr); + if (feeest_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&feeest_conv); + } + void* persister_ptr = untag_ptr(persister); + CHECK_ACCESS(persister_ptr); + LDKPersist persister_conv = *(LDKPersist*)(persister_ptr); + if (persister_conv.free == LDKPersist_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKPersist_JCalls_cloned(&persister_conv); + } + LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv); + uint64_t ret_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_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); +uint64_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_ChannelDetailsZ ignored_channels_constr; + ignored_channels_constr.datalen = ignored_channels->arr_len; + if (ignored_channels_constr.datalen > 0) + ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + ignored_channels_constr.data = NULL; + uint64_t* ignored_channels_vals = ignored_channels->elems; + for (size_t q = 0; q < ignored_channels_constr.datalen; q++) { + uint64_t ignored_channels_conv_16 = ignored_channels_vals[q]; + LDKChannelDetails ignored_channels_conv_16_conv; + ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16); + ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv); + ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv); + ignored_channels_constr.data[q] = ignored_channels_conv_16_conv; + } + FREE(ignored_channels); + LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr); + 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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); + ret_arr_ptr[j] = ret_conv_9_ref; + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations"))) TS_ChannelDetails_get_confirmations(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); - *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) { + 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; + 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); + LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ"); + *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelDetails_set_confirmations"))) TS_ChannelDetails_set_confirmations(uint64_t this_ptr, uint64_t val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); - val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); - ChannelDetails_set_confirmations(&this_ptr_conv, val_conv); +uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&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 d = 0; d < ret_var.datalen; d++) { + LDKC2Tuple_OutPointChannelIdZ* ret_conv_29_conv = MALLOC(sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKC2Tuple_OutPointChannelIdZ"); + *ret_conv_29_conv = ret_var.data[d]; + ret_arr_ptr[d] = tag_ptr(ret_conv_29_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); - *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_pending_monitor_updates"))) TS_ChainMonitor_list_pending_monitor_updates(uint64_t this_arg) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret_var = ChainMonitor_list_pending_monitor_updates(&this_arg_conv); + uint64_tArray ret_arr = NULL; + ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); + uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t p = 0; p < ret_var.datalen; p++) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* ret_conv_41_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ), "LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ"); + *ret_conv_41_conv = ret_var.data[p]; + ret_arr_ptr[p] = tag_ptr(ret_conv_41_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_ChannelDetails_set_force_close_spend_delay"))) TS_ChannelDetails_set_force_close_spend_delay(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_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); - val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); - ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_ChainMonitor_channel_monitor_updated"))) TS_ChainMonitor_channel_monitor_updated(uint64_t this_arg, uint64_t funding_txo, uint64_t completed_update_id) { + LDKChainMonitor this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_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); + LDKMonitorUpdateId completed_update_id_conv; + completed_update_id_conv.inner = untag_ptr(completed_update_id); + completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv); + completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv); + return tag_ptr(ret_conv, true); } -jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(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; - jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); - return ret_conv; +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_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_is_outbound(&this_ptr_conv, val); +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); } -jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(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; - jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv); - return ret_conv; +void __attribute__((export_name("TS_ChainMonitor_signer_unblocked"))) TS_ChainMonitor_signer_unblocked(uint64_t this_arg, uint64_t monitor_opt) { + 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; + LDKOutPoint monitor_opt_conv; + monitor_opt_conv.inner = untag_ptr(monitor_opt); + monitor_opt_conv.is_owned = ptr_is_owned(monitor_opt); + CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_opt_conv); + monitor_opt_conv = OutPoint_clone(&monitor_opt_conv); + ChainMonitor_signer_unblocked(&this_arg_conv, monitor_opt_conv); } -void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_is_channel_ready(&this_ptr_conv, val); +void __attribute__((export_name("TS_ChainMonitor_archive_fully_resolved_channel_monitors"))) TS_ChainMonitor_archive_fully_resolved_channel_monitors(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_archive_fully_resolved_channel_monitors(&this_arg_conv); } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_shutdown_state"))) TS_ChannelDetails_get_channel_shutdown_state(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_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); - *ret_copy = ChannelDetails_get_channel_shutdown_state(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +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); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChainMonitor_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_ChannelDetails_set_channel_shutdown_state"))) TS_ChannelDetails_set_channel_shutdown_state(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_ChannelShutdownStateZ val_conv = *(LDKCOption_ChannelShutdownStateZ*)(val_ptr); - val_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(val)); - ChannelDetails_set_channel_shutdown_state(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); } -jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(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; - jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(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; + LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch"); + *ret_ret = ChainMonitor_as_Watch(&this_arg_conv); + return tag_ptr(ret_ret, true); } -void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - ChannelDetails_set_is_usable(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(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; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); } -jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) { + LDKChannelMonitorUpdate 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); + ChannelMonitorUpdate_free(this_obj_conv); +} + +int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelDetails_get_is_public(&this_ptr_conv); + int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean val) { - LDKChannelDetails this_ptr_conv; +void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - ChannelDetails_set_is_public(&this_ptr_conv, val); + ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(uint64_t this_ptr) { - LDKChannelDetails this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_channel_id"))) TS_ChannelMonitorUpdate_get_channel_id(uint64_t this_ptr) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); + LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -void __attribute__((export_name("TS_ChannelDetails_set_inbound_htlc_minimum_msat"))) TS_ChannelDetails_set_inbound_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) { - LDKChannelDetails this_ptr_conv; +void __attribute__((export_name("TS_ChannelMonitorUpdate_set_channel_id"))) TS_ChannelMonitorUpdate_set_channel_id(uint64_t this_ptr, uint64_t val) { + LDKChannelMonitorUpdate this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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)); - ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_ChannelDetails_set_inbound_htlc_maximum_msat"))) TS_ChannelDetails_set_inbound_htlc_maximum_msat(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); - val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); - ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(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; - LDKChannelConfig ret_var = ChannelDetails_get_config(&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_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(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; - LDKChannelConfig val_conv; + LDKChannelId 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 = ChannelConfig_clone(&val_conv); - 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, 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 next_outbound_htlc_minimum_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, uint64_t channel_shutdown_state_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); - LDKChannelCounterparty counterparty_arg_conv; - counterparty_arg_conv.inner = untag_ptr(counterparty_arg); - counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); - counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); - LDKOutPoint funding_txo_arg_conv; - funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg); - funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); - funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); - CHECK_ACCESS(short_channel_id_arg_ptr); - LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); - short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); - void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg); - CHECK_ACCESS(outbound_scid_alias_arg_ptr); - LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); - outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg)); - void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg); - CHECK_ACCESS(inbound_scid_alias_arg_ptr); - LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); - inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg)); - void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); - CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); - LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); - LDKU128 user_channel_id_arg_ref; - CHECK(user_channel_id_arg->arr_len == 16); - memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg); - void* 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); - confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg)); - void* confirmations_arg_ptr = untag_ptr(confirmations_arg); - CHECK_ACCESS(confirmations_arg_ptr); - LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); - confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); - void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); - CHECK_ACCESS(force_close_spend_delay_arg_ptr); - LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); - force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg)); - void* channel_shutdown_state_arg_ptr = untag_ptr(channel_shutdown_state_arg); - CHECK_ACCESS(channel_shutdown_state_arg_ptr); - LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg_conv = *(LDKCOption_ChannelShutdownStateZ*)(channel_shutdown_state_arg_ptr); - channel_shutdown_state_arg_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(channel_shutdown_state_arg)); - void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg); - CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); - LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); - inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg)); - void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg); - CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); - LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); - inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg)); - LDKChannelConfig config_arg_conv; - config_arg_conv.inner = untag_ptr(config_arg); - 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, feerate_sat_per_1000_weight_arg_conv, balance_msat_arg, outbound_capacity_msat_arg, next_outbound_htlc_limit_msat_arg, next_outbound_htlc_minimum_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, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; + val_conv = ChannelId_clone(&val_conv); + ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); } -static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { - LDKChannelDetails ret_var = ChannelDetails_clone(arg); +static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) { - LDKChannelDetails arg_conv; +int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) { + LDKChannelMonitorUpdate 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 = ChannelDetails_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) { - LDKChannelDetails orig_conv; +uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) { + LDKChannelMonitorUpdate 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; - LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv); + LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_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_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) { - LDKChannelDetails this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) { - LDKChannelDetails this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); - *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -uint32_t __attribute__((export_name("TS_ChannelShutdownState_clone"))) TS_ChannelShutdownState_clone(uint64_t orig) { - LDKChannelShutdownState* orig_conv = (LDKChannelShutdownState*)untag_ptr(orig); - uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_clone(orig_conv)); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ChannelShutdownState_not_shutting_down"))) TS_ChannelShutdownState_not_shutting_down() { - uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_not_shutting_down()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ChannelShutdownState_shutdown_initiated"))) TS_ChannelShutdownState_shutdown_initiated() { - uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_shutdown_initiated()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ChannelShutdownState_resolving_htlcs"))) TS_ChannelShutdownState_resolving_htlcs() { - uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_resolving_htlcs()); - return ret_conv; -} - -uint32_t __attribute__((export_name("TS_ChannelShutdownState_negotiating_closing_fee"))) TS_ChannelShutdownState_negotiating_closing_fee() { - uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_negotiating_closing_fee()); +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; } -uint32_t __attribute__((export_name("TS_ChannelShutdownState_shutdown_complete"))) TS_ChannelShutdownState_shutdown_complete() { - uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_shutdown_complete()); - 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); + 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 = ChannelMonitorUpdate_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_ChannelShutdownState_eq"))) TS_ChannelShutdownState_eq(uint64_t a, uint64_t b) { - LDKChannelShutdownState* a_conv = (LDKChannelShutdownState*)untag_ptr(a); - LDKChannelShutdownState* b_conv = (LDKChannelShutdownState*)untag_ptr(b); - jboolean ret_conv = ChannelShutdownState_eq(a_conv, b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ"); + *ret_conv = ChannelMonitorUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_RecentPaymentDetails_free"))) TS_RecentPaymentDetails_free(uint64_t this_ptr) { +void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_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); - LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr); + LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr); FREE(untag_ptr(this_ptr)); - RecentPaymentDetails_free(this_ptr_conv); + MonitorEvent_free(this_ptr_conv); } -static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) { - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_clone(arg); +static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) { + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(arg); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_RecentPaymentDetails_clone_ptr"))) TS_RecentPaymentDetails_clone_ptr(uint64_t arg) { - LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg); - int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv); +int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) { + LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg); + int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_RecentPaymentDetails_clone"))) TS_RecentPaymentDetails_clone(uint64_t orig) { - LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_clone(orig_conv); +uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) { + LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_clone(orig_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_RecentPaymentDetails_awaiting_invoice"))) TS_RecentPaymentDetails_awaiting_invoice(int8_tArray payment_id) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_awaiting_invoice(payment_id_ref); +uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) { + LDKHTLCUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv = HTLCUpdate_clone(&a_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_htlcevent(a_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_RecentPaymentDetails_pending"))) TS_RecentPaymentDetails_pending(int8_tArray payment_id, int8_tArray payment_hash, int64_t total_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_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_pending(payment_id_ref, payment_hash_ref, total_msat); +uint64_t __attribute__((export_name("TS_MonitorEvent_holder_force_closed_with_info"))) TS_MonitorEvent_holder_force_closed_with_info(uint64_t reason, uint64_t outpoint, uint64_t 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)); + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed_with_info(reason_conv, outpoint_conv, channel_id_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_RecentPaymentDetails_fulfilled"))) TS_RecentPaymentDetails_fulfilled(int8_tArray payment_id, uint64_t payment_hash) { - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* payment_hash_ptr = untag_ptr(payment_hash); - CHECK_ACCESS(payment_hash_ptr); - LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); - payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_fulfilled(payment_id_ref, payment_hash_conv); +uint64_t __attribute__((export_name("TS_MonitorEvent_holder_force_closed"))) TS_MonitorEvent_holder_force_closed(uint64_t a) { + 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); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_holder_force_closed(a_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_RecentPaymentDetails_abandoned"))) TS_RecentPaymentDetails_abandoned(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); - LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_copy = RecentPaymentDetails_abandoned(payment_id_ref, payment_hash_ref); +uint64_t __attribute__((export_name("TS_MonitorEvent_completed"))) TS_MonitorEvent_completed(uint64_t funding_txo, uint64_t channel_id, int64_t monitor_update_id) { + LDKOutPoint funding_txo_conv; + funding_txo_conv.inner = untag_ptr(funding_txo); + funding_txo_conv.is_owned = ptr_is_owned(funding_txo); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv); + funding_txo_conv = OutPoint_clone(&funding_txo_conv); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent"); + *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) { - LDKPhantomRouteHints 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); - PhantomRouteHints_free(this_obj_conv); -} - -uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&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++) { - 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; -} - -void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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_ChannelDetailsZ val_constr; - val_constr.datalen = val->arr_len; - if (val_constr.datalen > 0) - val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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]; - LDKChannelDetails 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 = ChannelDetails_clone(&val_conv_16_conv); - val_constr.data[q] = val_conv_16_conv; - } - FREE(val); - PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); -} - -int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); +jboolean __attribute__((export_name("TS_MonitorEvent_eq"))) TS_MonitorEvent_eq(uint64_t a, uint64_t b) { + LDKMonitorEvent* a_conv = (LDKMonitorEvent*)untag_ptr(a); + LDKMonitorEvent* b_conv = (LDKMonitorEvent*)untag_ptr(b); + jboolean ret_conv = MonitorEvent_eq(a_conv, b_conv); return ret_conv; } -void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); -} - -int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); +int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) { + LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj); + LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv); + 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_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKPhantomRouteHints this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ"); + *ret_conv = MonitorEvent_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_PhantomRouteHints_new"))) TS_PhantomRouteHints_new(uint64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { - LDKCVec_ChannelDetailsZ 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(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); - else - channels_arg_constr.data = NULL; - uint64_t* channels_arg_vals = channels_arg->elems; - for (size_t q = 0; q < channels_arg_constr.datalen; q++) { - uint64_t channels_arg_conv_16 = channels_arg_vals[q]; - LDKChannelDetails channels_arg_conv_16_conv; - channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16); - channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); - channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); - channels_arg_constr.data[q] = channels_arg_conv_16_conv; - } - FREE(channels_arg); - LDKPublicKey real_node_pubkey_arg_ref; - CHECK(real_node_pubkey_arg->arr_len == 33); - memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg); - LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_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; +void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) { + LDKHTLCUpdate 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); + HTLCUpdate_free(this_obj_conv); } -static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg); +static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) { + LDKHTLCUpdate ret_var = HTLCUpdate_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_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) { - LDKPhantomRouteHints arg_conv; +int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) { + LDKHTLCUpdate 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 = PhantomRouteHints_clone_ptr(&arg_conv); + int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) { - LDKPhantomRouteHints orig_conv; +uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) { + LDKHTLCUpdate 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; - LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv); + LDKHTLCUpdate ret_var = HTLCUpdate_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_ChannelManager_new"))) TS_ChannelManager_new(uint64_t fee_est, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t router, uint64_t logger, uint64_t entropy_source, uint64_t node_signer, uint64_t signer_provider, uint64_t config, uint64_t params, int32_t current_timestamp) { - void* fee_est_ptr = untag_ptr(fee_est); - CHECK_ACCESS(fee_est_ptr); - LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); - if (fee_est_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_est_conv); - } - void* chain_monitor_ptr = untag_ptr(chain_monitor); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_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(&tx_broadcaster_conv); - } - void* router_ptr = untag_ptr(router); - CHECK_ACCESS(router_ptr); - LDKRouter router_conv = *(LDKRouter*)(router_ptr); - if (router_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&router_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (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* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_conv); - } - LDKUserConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv = UserConfig_clone(&config_conv); - LDKChainParameters 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 = ChainParameters_clone(¶ms_conv); - LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); +jboolean __attribute__((export_name("TS_HTLCUpdate_eq"))) TS_HTLCUpdate_eq(uint64_t a, uint64_t b) { + LDKHTLCUpdate a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKHTLCUpdate b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = HTLCUpdate_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) { + LDKHTLCUpdate obj_conv; + obj_conv.inner = untag_ptr(obj); + 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 = HTLCUpdate_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_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ"); + *ret_conv = HTLCUpdate_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_Balance_free"))) TS_Balance_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); + LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Balance_free(this_ptr_conv); +} + +static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) { + LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg); + int64_t ret_conv = Balance_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) { + LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_on_channel_close(amount_satoshis); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t amount_satoshis, int32_t confirmation_height) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_claimable_awaiting_confirmations(amount_satoshis, confirmation_height); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t amount_satoshis, int32_t timeout_height, int8_tArray payment_hash, int8_tArray payment_preimage) { + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_contentious_claimable(amount_satoshis, timeout_height, payment_hash_ref, payment_preimage_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Balance_maybe_timeout_claimable_htlc"))) TS_Balance_maybe_timeout_claimable_htlc(int64_t amount_satoshis, int32_t claimable_height, 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); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_timeout_claimable_htlc(amount_satoshis, claimable_height, payment_hash_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Balance_maybe_preimage_claimable_htlc"))) TS_Balance_maybe_preimage_claimable_htlc(int64_t amount_satoshis, int32_t expiry_height, 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); + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_maybe_preimage_claimable_htlc(amount_satoshis, expiry_height, payment_hash_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Balance_counterparty_revoked_output_claimable"))) TS_Balance_counterparty_revoked_output_claimable(int64_t amount_satoshis) { + LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_copy = Balance_counterparty_revoked_output_claimable(amount_satoshis); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) { + LDKBalance* a_conv = (LDKBalance*)untag_ptr(a); + LDKBalance* b_conv = (LDKBalance*)untag_ptr(b); + jboolean ret_conv = Balance_eq(a_conv, b_conv); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_Balance_claimable_amount_satoshis"))) TS_Balance_claimable_amount_satoshis(uint64_t this_arg) { + LDKBalance* this_arg_conv = (LDKBalance*)untag_ptr(this_arg); + int64_t ret_conv = Balance_claimable_amount_satoshis(this_arg_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) { + LDKChannelMonitor 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); + ChannelMonitor_free(this_obj_conv); +} + +static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) { + LDKChannelMonitor ret_var = ChannelMonitor_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_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) { + LDKChannelMonitor 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 = ChannelMonitor_clone_ptr(&arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(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; - LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); +uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) { + LDKChannelMonitor 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; + LDKChannelMonitor ret_var = ChannelMonitor_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_ChannelManager_create_channel"))) TS_ChannelManager_create_channel(uint64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, uint64_t temporary_channel_id, uint64_t override_config) { - LDKChannelManager this_arg_conv; +int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) { + LDKChannelMonitor 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 = ChannelMonitor_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_ChannelMonitor_update_monitor"))) TS_ChannelMonitor_update_monitor(uint64_t this_arg, uint64_t updates, 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; - LDKPublicKey their_network_key_ref; - CHECK(their_network_key->arr_len == 33); - memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - void* temporary_channel_id_ptr = untag_ptr(temporary_channel_id); - CHECK_ACCESS(temporary_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ temporary_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(temporary_channel_id_ptr); - temporary_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(temporary_channel_id)); - LDKUserConfig override_config_conv; - override_config_conv.inner = untag_ptr(override_config); - override_config_conv.is_owned = ptr_is_owned(override_config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); - override_config_conv = UserConfig_clone(&override_config_conv); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, temporary_channel_id_conv, override_config_conv); + LDKChannelMonitorUpdate 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.is_owned = false; + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ"); + *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv); return tag_ptr(ret_conv, true); } -uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&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 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; + int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv); + return ret_conv; } -uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&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 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; + LDKC2Tuple_OutPointCVec_u8ZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_u8ZZ), "LDKC2Tuple_OutPointCVec_u8ZZ"); + *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv); + return tag_ptr(ret_conv, true); } -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; +uint64_t __attribute__((export_name("TS_ChannelMonitor_channel_id"))) TS_ChannelMonitor_channel_id(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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; + LDKChannelId ret_var = ChannelMonitor_channel_id(&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_tArray __attribute__((export_name("TS_ChannelManager_list_recent_payments"))) TS_ChannelManager_list_recent_payments(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&this_arg_conv); + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv); uint64_tArray ret_arr = NULL; ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t w = 0; w < ret_var.datalen; w++) { - LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); - *ret_conv_22_copy = ret_var.data[w]; - uint64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true); - ret_arr_ptr[w] = ret_conv_22_ref; + for (size_t a = 0; a < ret_var.datalen; a++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ* ret_conv_52_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ"); + *ret_conv_52_conv = ret_var.data[a]; + ret_arr_ptr[a] = tag_ptr(ret_conv_52_conv, true); } FREE(ret_var.data); return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_close_channel"))) TS_ChannelManager_close_channel(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); -} - -uint64_t __attribute__((export_name("TS_ChannelManager_close_channel_with_feerate_and_script"))) TS_ChannelManager_close_channel_with_feerate_and_script(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, uint64_t target_feerate_sats_per_1000_weight, uint64_t shutdown_script) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter, 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; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - void* target_feerate_sats_per_1000_weight_ptr = untag_ptr(target_feerate_sats_per_1000_weight); - CHECK_ACCESS(target_feerate_sats_per_1000_weight_ptr); - LDKCOption_u32Z target_feerate_sats_per_1000_weight_conv = *(LDKCOption_u32Z*)(target_feerate_sats_per_1000_weight_ptr); - target_feerate_sats_per_1000_weight_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(target_feerate_sats_per_1000_weight)); - LDKShutdownScript shutdown_script_conv; - shutdown_script_conv.inner = untag_ptr(shutdown_script); - shutdown_script_conv.is_owned = ptr_is_owned(shutdown_script); - CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); - shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); - return tag_ptr(ret_conv, true); + void* filter_ptr = untag_ptr(filter); + if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); } + LDKFilter* filter_conv = (LDKFilter*)filter_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv, logger_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_force_close_broadcasting_latest_txn"))) TS_ChannelManager_force_close_broadcasting_latest_txn(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_monitor_events"))) TS_ChannelMonitor_get_and_clear_pending_monitor_events(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); + LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&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++) { + 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_ChannelManager_force_close_without_broadcasting_txn"))) TS_ChannelManager_force_close_without_broadcasting_txn(uint64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_ChannelMonitor_process_pending_events"))) TS_ChannelMonitor_process_pending_events(uint64_t this_arg, uint64_t handler) { + 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; - uint8_t channel_id_arr[32]; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id); - uint8_t (*channel_id_ref)[32] = &channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref); - return tag_ptr(ret_conv, true); + void* handler_ptr = untag_ptr(handler); + if (ptr_is_owned(handler)) { CHECK_ACCESS(handler_ptr); } + LDKEventHandler* handler_conv = (LDKEventHandler*)handler_ptr; + ChannelMonitor_process_pending_events(&this_arg_conv, handler_conv); } -void __attribute__((export_name("TS_ChannelManager_force_close_all_channels_broadcasting_latest_txn"))) TS_ChannelManager_force_close_all_channels_broadcasting_latest_txn(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +uint64_t __attribute__((export_name("TS_ChannelMonitor_initial_counterparty_commitment_tx"))) TS_ChannelMonitor_initial_counterparty_commitment_tx(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); + LDKCommitmentTransaction ret_var = ChannelMonitor_initial_counterparty_commitment_tx(&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_ChannelManager_force_close_all_channels_without_broadcasting_txn"))) TS_ChannelManager_force_close_all_channels_without_broadcasting_txn(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_counterparty_commitment_txs_from_update"))) TS_ChannelMonitor_counterparty_commitment_txs_from_update(uint64_t this_arg, uint64_t update) { + 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; - ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); + LDKChannelMonitorUpdate update_conv; + update_conv.inner = untag_ptr(update); + update_conv.is_owned = ptr_is_owned(update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv.is_owned = false; + LDKCVec_CommitmentTransactionZ ret_var = ChannelMonitor_counterparty_commitment_txs_from_update(&this_arg_conv, &update_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 x = 0; x < ret_var.datalen; x++) { + LDKCommitmentTransaction ret_conv_23_var = ret_var.data[x]; + uint64_t ret_conv_23_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_23_var); + ret_conv_23_ref = tag_ptr(ret_conv_23_var.inner, ret_conv_23_var.is_owned); + ret_arr_ptr[x] = ret_conv_23_ref; + } + + FREE(ret_var.data); + return ret_arr; } -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; +uint64_t __attribute__((export_name("TS_ChannelMonitor_sign_to_local_justice_tx"))) TS_ChannelMonitor_sign_to_local_justice_tx(uint64_t this_arg, int8_tArray justice_tx, uint32_t input_idx, int64_t value, int64_t commitment_number) { + 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; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - 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_with_route(&this_arg_conv, &route_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref); + LDKTransaction justice_tx_ref; + justice_tx_ref.datalen = justice_tx->arr_len; + justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx); + justice_tx_ref.data_is_owned = true; + LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); + *ret_conv = ChannelMonitor_sign_to_local_justice_tx(&this_arg_conv, justice_tx_ref, input_idx, value, commitment_number); return tag_ptr(ret_conv, true); } -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; +int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - 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); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33); + return ret_arr; } -void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_ChannelMonitor_broadcast_latest_holder_commitment_txn"))) TS_ChannelMonitor_broadcast_latest_holder_commitment_txn(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; - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref); + void* broadcaster_ptr = untag_ptr(broadcaster); + if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); } + LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr; + void* fee_estimator_ptr = untag_ptr(fee_estimator); + if (ptr_is_owned(fee_estimator)) { CHECK_ACCESS(fee_estimator_ptr); } + LDKFeeEstimator* fee_estimator_conv = (LDKFeeEstimator*)fee_estimator_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment"))) TS_ChannelManager_send_spontaneous_payment(uint64_t this_arg, uint64_t route, uint64_t payment_preimage, uint64_t recipient_onion, int8_tArray payment_id) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_block_connected"))) TS_ChannelMonitor_block_connected(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height, 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; - LDKRoute route_conv; - route_conv.inner = untag_ptr(route); - route_conv.is_owned = ptr_is_owned(route); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); - route_conv.is_owned = false; - void* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(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_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref); - return tag_ptr(ret_conv, true); + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = txdata->arr_len; + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + uint64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + uint64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + FREE(txdata); + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_block_connected(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_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 x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_payment_with_retry"))) TS_ChannelManager_send_spontaneous_payment_with_retry(uint64_t this_arg, uint64_t payment_preimage, uint64_t recipient_onion, int8_tArray payment_id, uint64_t route_params, uint64_t retry_strategy) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_ChannelMonitor_block_disconnected"))) TS_ChannelMonitor_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height, 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* payment_preimage_ptr = untag_ptr(payment_preimage); - CHECK_ACCESS(payment_preimage_ptr); - LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); - payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(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); - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); - return tag_ptr(ret_conv, true); + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_t path) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_transactions_confirmed"))) TS_ChannelMonitor_transactions_confirmed(uint64_t this_arg, int8_tArray header, uint64_tArray txdata, int32_t height, 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; - 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_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); - *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); - return tag_ptr(ret_conv, true); + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr; + txdata_constr.datalen = txdata->arr_len; + if (txdata_constr.datalen > 0) + txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements"); + else + txdata_constr.data = NULL; + uint64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + uint64_t txdata_conv_28 = txdata_vals[c]; + void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28); + CHECK_ACCESS(txdata_conv_28_ptr); + LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr); + txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28)); + txdata_constr.data[c] = txdata_conv_28_conv; + } + FREE(txdata); + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_transactions_confirmed(&this_arg_conv, header_ref, txdata_constr, height, broadcaster_conv, fee_estimator_conv, logger_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 x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_preflight_probes"))) TS_ChannelManager_send_spontaneous_preflight_probes(uint64_t this_arg, int8_tArray node_id, int64_t amount_msat, int32_t final_cltv_expiry_delta, uint64_t liquidity_limit_multiplier) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_ChannelMonitor_transaction_unconfirmed"))) TS_ChannelMonitor_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid, 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; - LDKPublicKey node_id_ref; - CHECK(node_id->arr_len == 33); - memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); - void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); - CHECK_ACCESS(liquidity_limit_multiplier_ptr); - LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); - liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); - *ret_conv = ChannelManager_send_spontaneous_preflight_probes(&this_arg_conv, node_id_ref, amount_msat, final_cltv_expiry_delta, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); + uint8_t txid_arr[32]; + CHECK(txid->arr_len == 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); + uint8_t (*txid_ref)[32] = &txid_arr; + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_send_preflight_probes"))) TS_ChannelManager_send_preflight_probes(uint64_t this_arg, uint64_t route_params, uint64_t liquidity_limit_multiplier) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_best_block_updated"))) TS_ChannelMonitor_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height, 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; - LDKRouteParameters route_params_conv; - route_params_conv.inner = untag_ptr(route_params); - route_params_conv.is_owned = ptr_is_owned(route_params); - CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); - route_params_conv = RouteParameters_clone(&route_params_conv); - void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); - CHECK_ACCESS(liquidity_limit_multiplier_ptr); - LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); - liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); - LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); - *ret_conv = ChannelManager_send_preflight_probes(&this_arg_conv, route_params_conv, liquidity_limit_multiplier_conv); - return tag_ptr(ret_conv, true); + uint8_t header_arr[80]; + CHECK(header->arr_len == 80); + memcpy(header_arr, header->elems, 80); FREE(header); + uint8_t (*header_ref)[80] = &header_arr; + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_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 x = 0; x < ret_var.datalen; x++) { + LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ* ret_conv_49_conv = MALLOC(sizeof(LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ"); + *ret_conv_49_conv = ret_var.data[x]; + ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_funding_transaction_generated"))) TS_ChannelManager_funding_transaction_generated(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - uint8_t temporary_channel_id_arr[32]; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); - uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = funding_transaction->arr_len; - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref); - return tag_ptr(ret_conv, true); + LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv); + uint64_tArray ret_arr = NULL; + ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); + uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t c = 0; c < ret_var.datalen; c++) { + LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ* ret_conv_54_conv = MALLOC(sizeof(LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ), "LDKC3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ"); + *ret_conv_54_conv = ret_var.data[c]; + ret_arr_ptr[c] = tag_ptr(ret_conv_54_conv, true); + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_batch_funding_transaction_generated"))) TS_ChannelManager_batch_funding_transaction_generated(uint64_t this_arg, uint64_tArray temporary_channels, int8_tArray funding_transaction) { - LDKChannelManager this_arg_conv; +uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) { + LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels_constr; - temporary_channels_constr.datalen = temporary_channels->arr_len; - if (temporary_channels_constr.datalen > 0) - temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ), "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ Elements"); - else - temporary_channels_constr.data = NULL; - uint64_t* temporary_channels_vals = temporary_channels->elems; - for (size_t j = 0; j < temporary_channels_constr.datalen; j++) { - uint64_t temporary_channels_conv_35 = temporary_channels_vals[j]; - void* temporary_channels_conv_35_ptr = untag_ptr(temporary_channels_conv_35); - CHECK_ACCESS(temporary_channels_conv_35_ptr); - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ temporary_channels_conv_35_conv = *(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)(temporary_channels_conv_35_ptr); - temporary_channels_conv_35_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone((LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(temporary_channels_conv_35)); - temporary_channels_constr.data[j] = temporary_channels_conv_35_conv; - } - FREE(temporary_channels); - LDKTransaction funding_transaction_ref; - funding_transaction_ref.datalen = funding_transaction->arr_len; - funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); - memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); - funding_transaction_ref.data_is_owned = true; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_batch_funding_transaction_generated(&this_arg_conv, temporary_channels_constr, funding_transaction_ref); - return tag_ptr(ret_conv, true); + LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -uint64_t __attribute__((export_name("TS_ChannelManager_update_partial_channel_config"))) TS_ChannelManager_update_partial_channel_config(uint64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, uint64_t config_update) { - LDKChannelManager this_arg_conv; +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; - 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_ThirtyTwoBytesZ channel_ids_constr; - channel_ids_constr.datalen = channel_ids->arr_len; - if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); - else - channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t m = 0; m < channel_ids_constr.datalen; m++) { - int8_tArray channel_ids_conv_12 = channel_ids_vals[m]; - LDKThirtyTwoBytes channel_ids_conv_12_ref; - CHECK(channel_ids_conv_12->arr_len == 32); - memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12); - channel_ids_constr.data[m] = channel_ids_conv_12_ref; + 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); } - FREE(channel_ids); - LDKChannelConfigUpdate config_update_conv; - config_update_conv.inner = untag_ptr(config_update); - config_update_conv.is_owned = ptr_is_owned(config_update); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_update_conv); - config_update_conv.is_owned = false; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_update_partial_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_update_conv); - return tag_ptr(ret_conv, true); + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_update_channel_config"))) TS_ChannelManager_update_channel_config(uint64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, uint64_t config) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_ChannelMonitor_signer_unblocked"))) TS_ChannelMonitor_signer_unblocked(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; - 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_ThirtyTwoBytesZ channel_ids_constr; - channel_ids_constr.datalen = channel_ids->arr_len; - if (channel_ids_constr.datalen > 0) - channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); - else - channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t m = 0; m < channel_ids_constr.datalen; m++) { - int8_tArray channel_ids_conv_12 = channel_ids_vals[m]; - LDKThirtyTwoBytes channel_ids_conv_12_ref; - CHECK(channel_ids_conv_12->arr_len == 32); - memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12); - channel_ids_constr.data[m] = channel_ids_conv_12_ref; + 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); } - FREE(channel_ids); - LDKChannelConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv.is_owned = false; - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv); - return tag_ptr(ret_conv, true); + 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); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + ChannelMonitor_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_forward_intercepted_htlc"))) TS_ChannelManager_forward_intercepted_htlc(uint64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { - LDKChannelManager this_arg_conv; +uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_spendable_outputs"))) TS_ChannelMonitor_get_spendable_outputs(uint64_t this_arg, int8_tArray tx, int32_t confirmation_height) { + 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; - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - uint8_t next_hop_channel_id_arr[32]; - CHECK(next_hop_channel_id->arr_len == 32); - memcpy(next_hop_channel_id_arr, next_hop_channel_id->elems, 32); FREE(next_hop_channel_id); - uint8_t (*next_hop_channel_id_ref)[32] = &next_hop_channel_id_arr; - LDKPublicKey next_node_id_ref; - CHECK(next_node_id->arr_len == 33); - memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, next_hop_channel_id_ref, next_node_id_ref, amt_to_forward_msat); - return tag_ptr(ret_conv, true); + LDKTransaction tx_ref; + tx_ref.datalen = tx->arr_len; + tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes"); + memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx); + tx_ref.data_is_owned = true; + LDKCVec_SpendableOutputDescriptorZ ret_var = ChannelMonitor_get_spendable_outputs(&this_arg_conv, tx_ref, confirmation_height); + 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 b = 0; b < ret_var.datalen; b++) { + LDKSpendableOutputDescriptor *ret_conv_27_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_conv_27_copy = ret_var.data[b]; + uint64_t ret_conv_27_ref = tag_ptr(ret_conv_27_copy, true); + ret_arr_ptr[b] = ret_conv_27_ref; + } + + FREE(ret_var.data); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_fail_intercepted_htlc"))) TS_ChannelManager_fail_intercepted_htlc(uint64_t this_arg, int8_tArray intercept_id) { - LDKChannelManager this_arg_conv; +jboolean __attribute__((export_name("TS_ChannelMonitor_is_fully_resolved"))) TS_ChannelMonitor_is_fully_resolved(uint64_t this_arg, 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; - LDKThirtyTwoBytes intercept_id_ref; - CHECK(intercept_id->arr_len == 32); - memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); - return tag_ptr(ret_conv, true); + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) { - LDKChannelManager this_arg_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); this_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_process_pending_htlc_forwards(&this_arg_conv); + LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&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 j = 0; j < ret_var.datalen; j++) { + LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance"); + *ret_conv_9_copy = ret_var.data[j]; + uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true); + ret_arr_ptr[j] = ret_conv_9_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(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_timer_tick_occurred(&this_arg_conv); +uint64_t __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesChannelMonitorZ_read"))) TS_C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(int8_tArray ser, uint64_t arg_a, uint64_t arg_b) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + void* arg_a_ptr = untag_ptr(arg_a); + if (ptr_is_owned(arg_a)) { CHECK_ACCESS(arg_a_ptr); } + LDKEntropySource* arg_a_conv = (LDKEntropySource*)arg_a_ptr; + void* arg_b_ptr = untag_ptr(arg_b); + if (ptr_is_owned(arg_b)) { CHECK_ACCESS(arg_b_ptr); } + LDKSignerProvider* arg_b_conv = (LDKSignerProvider*)arg_b_ptr; + LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ"); + *ret_conv = C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(ser_ref, arg_a_conv, arg_b_conv); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t payment_hash_arr[32]; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); - uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; - ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); +void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) { + LDKOutPoint 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); + OutPoint_free(this_obj_conv); } -void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards_with_reason"))) TS_ChannelManager_fail_htlc_backwards_with_reason(uint64_t this_arg, int8_tArray payment_hash, uint64_t failure_code) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t payment_hash_arr[32]; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); - uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; - void* failure_code_ptr = untag_ptr(failure_code); - CHECK_ACCESS(failure_code_ptr); - LDKFailureCode failure_code_conv = *(LDKFailureCode*)(failure_code_ptr); - failure_code_conv = FailureCode_clone((LDKFailureCode*)untag_ptr(failure_code)); - ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv); +int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *OutPoint_get_txid(&this_ptr_conv), 32); + return ret_arr; } -void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_preimage_ref; - CHECK(payment_preimage->arr_len == 32); - memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + OutPoint_set_txid(&this_ptr_conv, val_ref); } -void __attribute__((export_name("TS_ChannelManager_claim_funds_with_known_custom_tlvs"))) TS_ChannelManager_claim_funds_with_known_custom_tlvs(uint64_t this_arg, int8_tArray payment_preimage) { - 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; +int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = OutPoint_get_index(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) { + LDKOutPoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OutPoint_set_index(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) { + LDKThirtyTwoBytes txid_arg_ref; + CHECK(txid_arg->arr_len == 32); + memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg); + LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_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 OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) { + LDKOutPoint ret_var = OutPoint_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_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) { + LDKOutPoint 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 = OutPoint_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) { + LDKOutPoint 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; + LDKOutPoint ret_var = OutPoint_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_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) { + LDKOutPoint a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOutPoint 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 = OutPoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) { + LDKOutPoint 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 = OutPoint_hash(&o_conv); + return ret_conv; +} + +jstring __attribute__((export_name("TS_OutPoint_to_str"))) TS_OutPoint_to_str(uint64_t o) { + LDKOutPoint 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; + LDKStr ret_str = OutPoint_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) { + LDKOutPoint 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 = OutPoint_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_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ"); + *ret_conv = OutPoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_InboundHTLCErr_free"))) TS_InboundHTLCErr_free(uint64_t this_obj) { + LDKInboundHTLCErr 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); + InboundHTLCErr_free(this_obj_conv); +} + +int16_t __attribute__((export_name("TS_InboundHTLCErr_get_err_code"))) TS_InboundHTLCErr_get_err_code(uint64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCErr_get_err_code(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_InboundHTLCErr_set_err_code"))) TS_InboundHTLCErr_set_err_code(uint64_t this_ptr, int16_t val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCErr_set_err_code(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_InboundHTLCErr_get_err_data"))) TS_InboundHTLCErr_get_err_data(uint64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCErr_get_err_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_InboundHTLCErr_set_err_data"))) TS_InboundHTLCErr_set_err_data(uint64_t this_ptr, int8_tArray val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + InboundHTLCErr_set_err_data(&this_ptr_conv, val_ref); +} + +jstring __attribute__((export_name("TS_InboundHTLCErr_get_msg"))) TS_InboundHTLCErr_get_msg(uint64_t this_ptr) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCErr_get_msg(&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_InboundHTLCErr_set_msg"))) TS_InboundHTLCErr_set_msg(uint64_t this_ptr, jstring val) { + LDKInboundHTLCErr this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + InboundHTLCErr_set_msg(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_InboundHTLCErr_new"))) TS_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_arg, jstring msg_arg) { + LDKCVec_u8Z err_data_arg_ref; + err_data_arg_ref.datalen = err_data_arg->arr_len; + err_data_arg_ref.data = MALLOC(err_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(err_data_arg_ref.data, err_data_arg->elems, err_data_arg_ref.datalen); FREE(err_data_arg); + LDKStr msg_arg_conv = str_ref_to_owned_c(msg_arg); + LDKInboundHTLCErr ret_var = InboundHTLCErr_new(err_code_arg, err_data_arg_ref, msg_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 InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { + LDKInboundHTLCErr ret_var = InboundHTLCErr_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_InboundHTLCErr_clone_ptr"))) TS_InboundHTLCErr_clone_ptr(uint64_t arg) { + LDKInboundHTLCErr 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 = InboundHTLCErr_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_InboundHTLCErr_clone"))) TS_InboundHTLCErr_clone(uint64_t orig) { + LDKInboundHTLCErr 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; + LDKInboundHTLCErr ret_var = InboundHTLCErr_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_InboundHTLCErr_hash"))) TS_InboundHTLCErr_hash(uint64_t o) { + LDKInboundHTLCErr 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 = InboundHTLCErr_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InboundHTLCErr_eq"))) TS_InboundHTLCErr_eq(uint64_t a, uint64_t b) { + LDKInboundHTLCErr 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; + LDKInboundHTLCErr 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 = InboundHTLCErr_eq(&a_conv, &b_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_peel_payment_onion"))) TS_peel_payment_onion(uint64_t msg, uint64_t node_signer, uint64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { + LDKUpdateAddHTLC 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* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* logger_ptr = untag_ptr(logger); + if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); } + LDKLogger* logger_conv = (LDKLogger*)logger_ptr; + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoInboundHTLCErrZ), "LDKCResult_PendingHTLCInfoInboundHTLCErrZ"); + *ret_conv = peel_payment_onion(&msg_conv, node_signer_conv, logger_conv, cur_height, accept_mpp_keysend, allow_skimmed_fees); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_PendingHTLCRouting_free"))) TS_PendingHTLCRouting_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); + LDKPendingHTLCRouting this_ptr_conv = *(LDKPendingHTLCRouting*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PendingHTLCRouting_free(this_ptr_conv); +} + +static inline uint64_t PendingHTLCRouting_clone_ptr(LDKPendingHTLCRouting *NONNULL_PTR arg) { + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_PendingHTLCRouting_clone_ptr"))) TS_PendingHTLCRouting_clone_ptr(uint64_t arg) { + LDKPendingHTLCRouting* arg_conv = (LDKPendingHTLCRouting*)untag_ptr(arg); + int64_t ret_conv = PendingHTLCRouting_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_PendingHTLCRouting_clone"))) TS_PendingHTLCRouting_clone(uint64_t orig) { + LDKPendingHTLCRouting* orig_conv = (LDKPendingHTLCRouting*)untag_ptr(orig); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PendingHTLCRouting_forward"))) TS_PendingHTLCRouting_forward(uint64_t onion_packet, int64_t short_channel_id, uint64_t blinded) { + LDKOnionPacket onion_packet_conv; + onion_packet_conv.inner = untag_ptr(onion_packet); + onion_packet_conv.is_owned = ptr_is_owned(onion_packet); + CHECK_INNER_FIELD_ACCESS_OR_NULL(onion_packet_conv); + onion_packet_conv = OnionPacket_clone(&onion_packet_conv); + LDKBlindedForward blinded_conv; + blinded_conv.inner = untag_ptr(blinded); + blinded_conv.is_owned = ptr_is_owned(blinded); + CHECK_INNER_FIELD_ACCESS_OR_NULL(blinded_conv); + blinded_conv = BlindedForward_clone(&blinded_conv); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_forward(onion_packet_conv, short_channel_id, blinded_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PendingHTLCRouting_receive"))) TS_PendingHTLCRouting_receive(uint64_t payment_data, uint64_t payment_metadata, uint64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, uint64_tArray custom_tlvs, jboolean requires_blinded_error) { + LDKFinalOnionHopData payment_data_conv; + payment_data_conv.inner = untag_ptr(payment_data); + payment_data_conv.is_owned = ptr_is_owned(payment_data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); + payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); + void* payment_metadata_ptr = untag_ptr(payment_metadata); + CHECK_ACCESS(payment_metadata_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); + payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); + void* payment_context_ptr = untag_ptr(payment_context); + CHECK_ACCESS(payment_context_ptr); + LDKCOption_PaymentContextZ payment_context_conv = *(LDKCOption_PaymentContextZ*)(payment_context_ptr); + payment_context_conv = COption_PaymentContextZ_clone((LDKCOption_PaymentContextZ*)untag_ptr(payment_context)); + LDKThirtyTwoBytes phantom_shared_secret_ref; + CHECK(phantom_shared_secret->arr_len == 32); + memcpy(phantom_shared_secret_ref.data, phantom_shared_secret->elems, 32); FREE(phantom_shared_secret); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + uint64_t* custom_tlvs_vals = custom_tlvs->elems; + for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { + uint64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; + void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); + CHECK_ACCESS(custom_tlvs_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); + custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); + custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; + } + FREE(custom_tlvs); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_receive(payment_data_conv, payment_metadata_conv, payment_context_conv, incoming_cltv_expiry, phantom_shared_secret_ref, custom_tlvs_constr, requires_blinded_error); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PendingHTLCRouting_receive_keysend"))) TS_PendingHTLCRouting_receive_keysend(uint64_t payment_data, int8_tArray payment_preimage, uint64_t payment_metadata, int32_t incoming_cltv_expiry, uint64_tArray custom_tlvs, jboolean requires_blinded_error) { + LDKFinalOnionHopData payment_data_conv; + payment_data_conv.inner = untag_ptr(payment_data); + payment_data_conv.is_owned = ptr_is_owned(payment_data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_data_conv); + payment_data_conv = FinalOnionHopData_clone(&payment_data_conv); LDKThirtyTwoBytes payment_preimage_ref; CHECK(payment_preimage->arr_len == 32); memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); - ChannelManager_claim_funds_with_known_custom_tlvs(&this_arg_conv, payment_preimage_ref); + void* payment_metadata_ptr = untag_ptr(payment_metadata); + CHECK_ACCESS(payment_metadata_ptr); + LDKCOption_CVec_u8ZZ payment_metadata_conv = *(LDKCOption_CVec_u8ZZ*)(payment_metadata_ptr); + payment_metadata_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(payment_metadata)); + LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs_constr; + custom_tlvs_constr.datalen = custom_tlvs->arr_len; + if (custom_tlvs_constr.datalen > 0) + custom_tlvs_constr.data = MALLOC(custom_tlvs_constr.datalen * sizeof(LDKC2Tuple_u64CVec_u8ZZ), "LDKCVec_C2Tuple_u64CVec_u8ZZZ Elements"); + else + custom_tlvs_constr.data = NULL; + uint64_t* custom_tlvs_vals = custom_tlvs->elems; + for (size_t x = 0; x < custom_tlvs_constr.datalen; x++) { + uint64_t custom_tlvs_conv_23 = custom_tlvs_vals[x]; + void* custom_tlvs_conv_23_ptr = untag_ptr(custom_tlvs_conv_23); + CHECK_ACCESS(custom_tlvs_conv_23_ptr); + LDKC2Tuple_u64CVec_u8ZZ custom_tlvs_conv_23_conv = *(LDKC2Tuple_u64CVec_u8ZZ*)(custom_tlvs_conv_23_ptr); + custom_tlvs_conv_23_conv = C2Tuple_u64CVec_u8ZZ_clone((LDKC2Tuple_u64CVec_u8ZZ*)untag_ptr(custom_tlvs_conv_23)); + custom_tlvs_constr.data[x] = custom_tlvs_conv_23_conv; + } + FREE(custom_tlvs); + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(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; +void __attribute__((export_name("TS_BlindedForward_free"))) TS_BlindedForward_free(uint64_t this_obj) { + LDKBlindedForward 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); + BlindedForward_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_BlindedForward_get_inbound_blinding_point"))) TS_BlindedForward_get_inbound_blinding_point(uint64_t this_ptr) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); + memcpy(ret_arr->elems, BlindedForward_get_inbound_blinding_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel"))) TS_ChannelManager_accept_inbound_channel(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - uint8_t temporary_channel_id_arr[32]; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); - uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_BlindedForward_set_inbound_blinding_point"))) TS_BlindedForward_set_inbound_blinding_point(uint64_t this_ptr, int8_tArray val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + BlindedForward_set_inbound_blinding_point(&this_ptr_conv, val_ref); +} + +uint32_t __attribute__((export_name("TS_BlindedForward_get_failure"))) TS_BlindedForward_get_failure(uint64_t this_ptr) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = LDKBlindedFailure_to_js(BlindedForward_get_failure(&this_ptr_conv)); + return ret_conv; +} + +void __attribute__((export_name("TS_BlindedForward_set_failure"))) TS_BlindedForward_set_failure(uint64_t this_ptr, uint32_t val) { + LDKBlindedForward this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBlindedFailure val_conv = LDKBlindedFailure_from_js(val); + BlindedForward_set_failure(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_BlindedForward_new"))) TS_BlindedForward_new(int8_tArray inbound_blinding_point_arg, uint32_t failure_arg) { + LDKPublicKey inbound_blinding_point_arg_ref; + CHECK(inbound_blinding_point_arg->arr_len == 33); + memcpy(inbound_blinding_point_arg_ref.compressed_form, inbound_blinding_point_arg->elems, 33); FREE(inbound_blinding_point_arg); + LDKBlindedFailure failure_arg_conv = LDKBlindedFailure_from_js(failure_arg); + LDKBlindedForward ret_var = BlindedForward_new(inbound_blinding_point_arg_ref, failure_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 BlindedForward_clone_ptr(LDKBlindedForward *NONNULL_PTR arg) { + LDKBlindedForward ret_var = BlindedForward_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_BlindedForward_clone_ptr"))) TS_BlindedForward_clone_ptr(uint64_t arg) { + LDKBlindedForward 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 = BlindedForward_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_BlindedForward_clone"))) TS_BlindedForward_clone(uint64_t orig) { + LDKBlindedForward 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; + LDKBlindedForward ret_var = BlindedForward_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_BlindedForward_hash"))) TS_BlindedForward_hash(uint64_t o) { + LDKBlindedForward 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 = BlindedForward_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_BlindedForward_eq"))) TS_BlindedForward_eq(uint64_t a, uint64_t b) { + LDKBlindedForward 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; + LDKBlindedForward 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 = BlindedForward_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_free"))) TS_PendingHTLCInfo_free(uint64_t this_obj) { + LDKPendingHTLCInfo 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); + PendingHTLCInfo_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_PendingHTLCInfo_get_routing"))) TS_PendingHTLCInfo_get_routing(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPendingHTLCRouting *ret_copy = MALLOC(sizeof(LDKPendingHTLCRouting), "LDKPendingHTLCRouting"); + *ret_copy = PendingHTLCInfo_get_routing(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_routing"))) TS_PendingHTLCInfo_set_routing(uint64_t this_ptr, uint64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKPendingHTLCRouting val_conv = *(LDKPendingHTLCRouting*)(val_ptr); + val_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(val)); + PendingHTLCInfo_set_routing(&this_ptr_conv, val_conv); +} + +int8_tArray __attribute__((export_name("TS_PendingHTLCInfo_get_incoming_shared_secret"))) TS_PendingHTLCInfo_get_incoming_shared_secret(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *PendingHTLCInfo_get_incoming_shared_secret(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_incoming_shared_secret"))) TS_PendingHTLCInfo_set_incoming_shared_secret(uint64_t this_ptr, int8_tArray val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + PendingHTLCInfo_set_incoming_shared_secret(&this_ptr_conv, val_ref); +} + +int8_tArray __attribute__((export_name("TS_PendingHTLCInfo_get_payment_hash"))) TS_PendingHTLCInfo_get_payment_hash(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *PendingHTLCInfo_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_payment_hash"))) TS_PendingHTLCInfo_set_payment_hash(uint64_t this_ptr, int8_tArray val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + PendingHTLCInfo_set_payment_hash(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_PendingHTLCInfo_get_incoming_amt_msat"))) TS_PendingHTLCInfo_get_incoming_amt_msat(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PendingHTLCInfo_get_incoming_amt_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_incoming_amt_msat"))) TS_PendingHTLCInfo_set_incoming_amt_msat(uint64_t this_ptr, uint64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + PendingHTLCInfo_set_incoming_amt_msat(&this_ptr_conv, val_conv); +} + +int64_t __attribute__((export_name("TS_PendingHTLCInfo_get_outgoing_amt_msat"))) TS_PendingHTLCInfo_get_outgoing_amt_msat(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PendingHTLCInfo_get_outgoing_amt_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_outgoing_amt_msat"))) TS_PendingHTLCInfo_set_outgoing_amt_msat(uint64_t this_ptr, int64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PendingHTLCInfo_set_outgoing_amt_msat(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_PendingHTLCInfo_get_outgoing_cltv_value"))) TS_PendingHTLCInfo_get_outgoing_cltv_value(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PendingHTLCInfo_get_outgoing_cltv_value(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_outgoing_cltv_value"))) TS_PendingHTLCInfo_set_outgoing_cltv_value(uint64_t this_ptr, int32_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PendingHTLCInfo_set_outgoing_cltv_value(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_PendingHTLCInfo_get_skimmed_fee_msat"))) TS_PendingHTLCInfo_get_skimmed_fee_msat(uint64_t this_ptr) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PendingHTLCInfo_get_skimmed_fee_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PendingHTLCInfo_set_skimmed_fee_msat"))) TS_PendingHTLCInfo_set_skimmed_fee_msat(uint64_t this_ptr, uint64_t val) { + LDKPendingHTLCInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + PendingHTLCInfo_set_skimmed_fee_msat(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_PendingHTLCInfo_new"))) TS_PendingHTLCInfo_new(uint64_t routing_arg, int8_tArray incoming_shared_secret_arg, int8_tArray payment_hash_arg, uint64_t incoming_amt_msat_arg, int64_t outgoing_amt_msat_arg, int32_t outgoing_cltv_value_arg, uint64_t skimmed_fee_msat_arg) { + void* routing_arg_ptr = untag_ptr(routing_arg); + CHECK_ACCESS(routing_arg_ptr); + LDKPendingHTLCRouting routing_arg_conv = *(LDKPendingHTLCRouting*)(routing_arg_ptr); + routing_arg_conv = PendingHTLCRouting_clone((LDKPendingHTLCRouting*)untag_ptr(routing_arg)); + LDKThirtyTwoBytes incoming_shared_secret_arg_ref; + CHECK(incoming_shared_secret_arg->arr_len == 32); + memcpy(incoming_shared_secret_arg_ref.data, incoming_shared_secret_arg->elems, 32); FREE(incoming_shared_secret_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* incoming_amt_msat_arg_ptr = untag_ptr(incoming_amt_msat_arg); + CHECK_ACCESS(incoming_amt_msat_arg_ptr); + LDKCOption_u64Z incoming_amt_msat_arg_conv = *(LDKCOption_u64Z*)(incoming_amt_msat_arg_ptr); + incoming_amt_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(incoming_amt_msat_arg)); + void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); + CHECK_ACCESS(skimmed_fee_msat_arg_ptr); + LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); + skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_new(routing_arg_conv, incoming_shared_secret_arg_ref, payment_hash_arg_ref, incoming_amt_msat_arg_conv, outgoing_amt_msat_arg, outgoing_cltv_value_arg, skimmed_fee_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; +} + +static inline uint64_t PendingHTLCInfo_clone_ptr(LDKPendingHTLCInfo *NONNULL_PTR arg) { + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_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_PendingHTLCInfo_clone_ptr"))) TS_PendingHTLCInfo_clone_ptr(uint64_t arg) { + LDKPendingHTLCInfo 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 = PendingHTLCInfo_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_PendingHTLCInfo_clone"))) TS_PendingHTLCInfo_clone(uint64_t orig) { + LDKPendingHTLCInfo 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; + LDKPendingHTLCInfo ret_var = PendingHTLCInfo_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_BlindedFailure_clone"))) TS_BlindedFailure_clone(uint64_t orig) { + LDKBlindedFailure* orig_conv = (LDKBlindedFailure*)untag_ptr(orig); + uint32_t ret_conv = LDKBlindedFailure_to_js(BlindedFailure_clone(orig_conv)); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_BlindedFailure_from_introduction_node"))) TS_BlindedFailure_from_introduction_node() { + uint32_t ret_conv = LDKBlindedFailure_to_js(BlindedFailure_from_introduction_node()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_BlindedFailure_from_blinded_node"))) TS_BlindedFailure_from_blinded_node() { + uint32_t ret_conv = LDKBlindedFailure_to_js(BlindedFailure_from_blinded_node()); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_BlindedFailure_hash"))) TS_BlindedFailure_hash(uint64_t o) { + LDKBlindedFailure* o_conv = (LDKBlindedFailure*)untag_ptr(o); + int64_t ret_conv = BlindedFailure_hash(o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_BlindedFailure_eq"))) TS_BlindedFailure_eq(uint64_t a, uint64_t b) { + LDKBlindedFailure* a_conv = (LDKBlindedFailure*)untag_ptr(a); + LDKBlindedFailure* b_conv = (LDKBlindedFailure*)untag_ptr(b); + jboolean ret_conv = BlindedFailure_eq(a_conv, b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_FailureCode_free"))) TS_FailureCode_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); + LDKFailureCode this_ptr_conv = *(LDKFailureCode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + FailureCode_free(this_ptr_conv); +} + +static inline uint64_t FailureCode_clone_ptr(LDKFailureCode *NONNULL_PTR arg) { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_FailureCode_clone_ptr"))) TS_FailureCode_clone_ptr(uint64_t arg) { + LDKFailureCode* arg_conv = (LDKFailureCode*)untag_ptr(arg); + int64_t ret_conv = FailureCode_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_FailureCode_clone"))) TS_FailureCode_clone(uint64_t orig) { + LDKFailureCode* orig_conv = (LDKFailureCode*)untag_ptr(orig); + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_FailureCode_temporary_node_failure"))) TS_FailureCode_temporary_node_failure() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_temporary_node_failure(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_FailureCode_required_node_feature_missing"))) TS_FailureCode_required_node_feature_missing() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_required_node_feature_missing(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_FailureCode_incorrect_or_unknown_payment_details"))) TS_FailureCode_incorrect_or_unknown_payment_details() { + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_incorrect_or_unknown_payment_details(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_FailureCode_invalid_onion_payload"))) TS_FailureCode_invalid_onion_payload(uint64_t a) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKCOption_C2Tuple_u64u16ZZ a_conv = *(LDKCOption_C2Tuple_u64u16ZZ*)(a_ptr); + a_conv = COption_C2Tuple_u64u16ZZ_clone((LDKCOption_C2Tuple_u64u16ZZ*)untag_ptr(a)); + LDKFailureCode *ret_copy = MALLOC(sizeof(LDKFailureCode), "LDKFailureCode"); + *ret_copy = FailureCode_invalid_onion_payload(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) { + LDKChannelManager this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ChannelManager_free(this_obj_conv); +} + +void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) { + LDKChainParameters 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); + ChainParameters_free(this_obj_conv); +} + +uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv)); + return ret_conv; +} + +void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKNetwork val_conv = LDKNetwork_from_js(val); + ChainParameters_set_network(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBestBlock ret_var = ChainParameters_get_best_block(&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_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) { + LDKChainParameters this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKBestBlock 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 = BestBlock_clone(&val_conv); + ChainParameters_set_best_block(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) { + LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg); + LDKBestBlock best_block_arg_conv; + best_block_arg_conv.inner = untag_ptr(best_block_arg); + best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv); + best_block_arg_conv = BestBlock_clone(&best_block_arg_conv); + LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_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 ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) { + LDKChainParameters ret_var = ChainParameters_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_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) { + LDKChainParameters 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 = ChainParameters_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) { + LDKChainParameters 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; + LDKChainParameters ret_var = ChainParameters_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_RecentPaymentDetails_free"))) TS_RecentPaymentDetails_free(uint64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKRecentPaymentDetails this_ptr_conv = *(LDKRecentPaymentDetails*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + RecentPaymentDetails_free(this_ptr_conv); +} + +static inline uint64_t RecentPaymentDetails_clone_ptr(LDKRecentPaymentDetails *NONNULL_PTR arg) { + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_RecentPaymentDetails_clone_ptr"))) TS_RecentPaymentDetails_clone_ptr(uint64_t arg) { + LDKRecentPaymentDetails* arg_conv = (LDKRecentPaymentDetails*)untag_ptr(arg); + int64_t ret_conv = RecentPaymentDetails_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_RecentPaymentDetails_clone"))) TS_RecentPaymentDetails_clone(uint64_t orig) { + LDKRecentPaymentDetails* orig_conv = (LDKRecentPaymentDetails*)untag_ptr(orig); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_RecentPaymentDetails_awaiting_invoice"))) TS_RecentPaymentDetails_awaiting_invoice(int8_tArray payment_id) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_awaiting_invoice(payment_id_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_RecentPaymentDetails_pending"))) TS_RecentPaymentDetails_pending(int8_tArray payment_id, int8_tArray payment_hash, int64_t total_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_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_pending(payment_id_ref, payment_hash_ref, total_msat); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_RecentPaymentDetails_fulfilled"))) TS_RecentPaymentDetails_fulfilled(int8_tArray payment_id, uint64_t payment_hash) { + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* payment_hash_ptr = untag_ptr(payment_hash); + CHECK_ACCESS(payment_hash_ptr); + LDKCOption_ThirtyTwoBytesZ payment_hash_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_hash_ptr); + payment_hash_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_hash)); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_fulfilled(payment_id_ref, payment_hash_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_RecentPaymentDetails_abandoned"))) TS_RecentPaymentDetails_abandoned(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); + LDKRecentPaymentDetails *ret_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_copy = RecentPaymentDetails_abandoned(payment_id_ref, payment_hash_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) { + LDKPhantomRouteHints 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); + PhantomRouteHints_free(this_obj_conv); +} + +uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&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++) { + 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; +} + +void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) { + LDKPhantomRouteHints this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_ChannelDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ 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]; + LDKChannelDetails 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 = ChannelDetails_clone(&val_conv_16_conv); + val_constr.data[q] = val_conv_16_conv; + } + FREE(val); + PhantomRouteHints_set_channels(&this_ptr_conv, val_constr); +} + +int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PhantomRouteHints_get_phantom_scid(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) { + LDKPhantomRouteHints this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) { + LDKPhantomRouteHints this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) { + LDKPhantomRouteHints this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_PhantomRouteHints_new"))) TS_PhantomRouteHints_new(uint64_tArray channels_arg, int64_t phantom_scid_arg, int8_tArray real_node_pubkey_arg) { + LDKCVec_ChannelDetailsZ 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(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements"); + else + channels_arg_constr.data = NULL; + uint64_t* channels_arg_vals = channels_arg->elems; + for (size_t q = 0; q < channels_arg_constr.datalen; q++) { + uint64_t channels_arg_conv_16 = channels_arg_vals[q]; + LDKChannelDetails channels_arg_conv_16_conv; + channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16); + channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv); + channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv); + channels_arg_constr.data[q] = channels_arg_conv_16_conv; + } + FREE(channels_arg); + LDKPublicKey real_node_pubkey_arg_ref; + CHECK(real_node_pubkey_arg->arr_len == 33); + memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg); + LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_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 PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) { + LDKPhantomRouteHints ret_var = PhantomRouteHints_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_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) { + LDKPhantomRouteHints 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 = PhantomRouteHints_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) { + LDKPhantomRouteHints 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; + LDKPhantomRouteHints ret_var = PhantomRouteHints_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_ChannelManager_new"))) TS_ChannelManager_new(uint64_t fee_est, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t router, uint64_t logger, uint64_t entropy_source, uint64_t node_signer, uint64_t signer_provider, uint64_t config, uint64_t params, int32_t current_timestamp) { + void* fee_est_ptr = untag_ptr(fee_est); + CHECK_ACCESS(fee_est_ptr); + LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr); + if (fee_est_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_est_conv); + } + void* chain_monitor_ptr = untag_ptr(chain_monitor); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_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(&tx_broadcaster_conv); + } + void* router_ptr = untag_ptr(router); + CHECK_ACCESS(router_ptr); + LDKRouter router_conv = *(LDKRouter*)(router_ptr); + if (router_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&router_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (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* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_conv); + } + LDKUserConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv = UserConfig_clone(&config_conv); + LDKChainParameters 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 = ChainParameters_clone(¶ms_conv); + LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, entropy_source_conv, node_signer_conv, signer_provider_conv, config_conv, params_conv, current_timestamp); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(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; + LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_create_channel"))) TS_ChannelManager_create_channel(uint64_t this_arg, int8_tArray their_network_key, int64_t channel_value_satoshis, int64_t push_msat, int8_tArray user_channel_id, uint64_t temporary_channel_id, uint64_t override_config) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKPublicKey their_network_key_ref; + CHECK(their_network_key->arr_len == 33); + memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); + LDKUserConfig override_config_conv; + override_config_conv.inner = untag_ptr(override_config); + override_config_conv.is_owned = ptr_is_owned(override_config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv); + override_config_conv = UserConfig_clone(&override_config_conv); + LDKCResult_ChannelIdAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdAPIErrorZ), "LDKCResult_ChannelIdAPIErrorZ"); + *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id_ref, temporary_channel_id_conv, override_config_conv); + return tag_ptr(ret_conv, true); +} + +uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&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 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_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&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 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_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); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKCVec_RecentPaymentDetailsZ ret_var = ChannelManager_list_recent_payments(&this_arg_conv); + uint64_tArray ret_arr = NULL; + ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__); + uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t w = 0; w < ret_var.datalen; w++) { + LDKRecentPaymentDetails *ret_conv_22_copy = MALLOC(sizeof(LDKRecentPaymentDetails), "LDKRecentPaymentDetails"); + *ret_conv_22_copy = ret_var.data[w]; + uint64_t ret_conv_22_ref = tag_ptr(ret_conv_22_copy, true); + ret_arr_ptr[w] = ret_conv_22_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_close_channel"))) TS_ChannelManager_close_channel(uint64_t this_arg, uint64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_close_channel_with_feerate_and_script"))) TS_ChannelManager_close_channel_with_feerate_and_script(uint64_t this_arg, uint64_t channel_id, int8_tArray counterparty_node_id, uint64_t target_feerate_sats_per_1000_weight, uint64_t shutdown_script) { + 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; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_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); + void* target_feerate_sats_per_1000_weight_ptr = untag_ptr(target_feerate_sats_per_1000_weight); + CHECK_ACCESS(target_feerate_sats_per_1000_weight_ptr); + LDKCOption_u32Z target_feerate_sats_per_1000_weight_conv = *(LDKCOption_u32Z*)(target_feerate_sats_per_1000_weight_ptr); + target_feerate_sats_per_1000_weight_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(target_feerate_sats_per_1000_weight)); + LDKShutdownScript shutdown_script_conv; + shutdown_script_conv.inner = untag_ptr(shutdown_script); + shutdown_script_conv.is_owned = ptr_is_owned(shutdown_script); + CHECK_INNER_FIELD_ACCESS_OR_NULL(shutdown_script_conv); + shutdown_script_conv = ShutdownScript_clone(&shutdown_script_conv); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_close_channel_with_feerate_and_script(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref, target_feerate_sats_per_1000_weight_conv, shutdown_script_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_force_close_broadcasting_latest_txn"))) TS_ChannelManager_force_close_broadcasting_latest_txn(uint64_t this_arg, uint64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_force_close_without_broadcasting_txn"))) TS_ChannelManager_force_close_without_broadcasting_txn(uint64_t this_arg, uint64_t channel_id, int8_tArray counterparty_node_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_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); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_ChannelManager_force_close_all_channels_broadcasting_latest_txn"))) TS_ChannelManager_force_close_all_channels_broadcasting_latest_txn(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_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv); +} + +void __attribute__((export_name("TS_ChannelManager_force_close_all_channels_without_broadcasting_txn"))) TS_ChannelManager_force_close_all_channels_without_broadcasting_txn(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_force_close_all_channels_without_broadcasting_txn(&this_arg_conv); +} + +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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + 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_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"))) 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + 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); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + LDKCResult_NoneRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneRetryableSendFailureZ), "LDKCResult_NoneRetryableSendFailureZ"); + *ret_conv = ChannelManager_send_payment(&this_arg_conv, payment_hash_ref, recipient_onion_conv, payment_id_ref, route_params_conv, retry_strategy_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + 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, uint64_t 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKRoute route_conv; + route_conv.inner = untag_ptr(route); + route_conv.is_owned = ptr_is_owned(route); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv); + route_conv.is_owned = false; + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(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_ThirtyTwoBytesPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesPaymentSendFailureZ), "LDKCResult_ThirtyTwoBytesPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_conv, 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, uint64_t 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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(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); + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + LDKCResult_ThirtyTwoBytesRetryableSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesRetryableSendFailureZ), "LDKCResult_ThirtyTwoBytesRetryableSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_payment_with_retry(&this_arg_conv, payment_preimage_conv, 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_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; + 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_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ"); + *ret_conv = ChannelManager_send_probe(&this_arg_conv, path_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_send_spontaneous_preflight_probes"))) TS_ChannelManager_send_spontaneous_preflight_probes(uint64_t this_arg, int8_tArray node_id, int64_t amount_msat, int32_t final_cltv_expiry_delta, uint64_t liquidity_limit_multiplier) { + 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 node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); + CHECK_ACCESS(liquidity_limit_multiplier_ptr); + LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); + liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); + *ret_conv = ChannelManager_send_spontaneous_preflight_probes(&this_arg_conv, node_id_ref, amount_msat, final_cltv_expiry_delta, liquidity_limit_multiplier_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_send_preflight_probes"))) TS_ChannelManager_send_preflight_probes(uint64_t this_arg, uint64_t route_params, uint64_t liquidity_limit_multiplier) { + 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; + LDKRouteParameters route_params_conv; + route_params_conv.inner = untag_ptr(route_params); + route_params_conv.is_owned = ptr_is_owned(route_params); + CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv); + route_params_conv = RouteParameters_clone(&route_params_conv); + void* liquidity_limit_multiplier_ptr = untag_ptr(liquidity_limit_multiplier); + CHECK_ACCESS(liquidity_limit_multiplier_ptr); + LDKCOption_u64Z liquidity_limit_multiplier_conv = *(LDKCOption_u64Z*)(liquidity_limit_multiplier_ptr); + liquidity_limit_multiplier_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(liquidity_limit_multiplier)); + LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ), "LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ"); + *ret_conv = ChannelManager_send_preflight_probes(&this_arg_conv, route_params_conv, liquidity_limit_multiplier_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_funding_transaction_generated"))) TS_ChannelManager_funding_transaction_generated(uint64_t this_arg, uint64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { + 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; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_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); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = funding_transaction->arr_len; + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, funding_transaction_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_batch_funding_transaction_generated"))) TS_ChannelManager_batch_funding_transaction_generated(uint64_t this_arg, uint64_tArray temporary_channels, int8_tArray funding_transaction) { + 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_C2Tuple_ChannelIdPublicKeyZZ temporary_channels_constr; + temporary_channels_constr.datalen = temporary_channels->arr_len; + if (temporary_channels_constr.datalen > 0) + temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); + else + temporary_channels_constr.data = NULL; + uint64_t* temporary_channels_vals = temporary_channels->elems; + for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { + uint64_t temporary_channels_conv_30 = temporary_channels_vals[e]; + void* temporary_channels_conv_30_ptr = untag_ptr(temporary_channels_conv_30); + CHECK_ACCESS(temporary_channels_conv_30_ptr); + LDKC2Tuple_ChannelIdPublicKeyZ temporary_channels_conv_30_conv = *(LDKC2Tuple_ChannelIdPublicKeyZ*)(temporary_channels_conv_30_ptr); + temporary_channels_conv_30_conv = C2Tuple_ChannelIdPublicKeyZ_clone((LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(temporary_channels_conv_30)); + temporary_channels_constr.data[e] = temporary_channels_conv_30_conv; + } + FREE(temporary_channels); + LDKTransaction funding_transaction_ref; + funding_transaction_ref.datalen = funding_transaction->arr_len; + funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes"); + memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction); + funding_transaction_ref.data_is_owned = true; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_batch_funding_transaction_generated(&this_arg_conv, temporary_channels_constr, funding_transaction_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_update_partial_channel_config"))) TS_ChannelManager_update_partial_channel_config(uint64_t this_arg, int8_tArray counterparty_node_id, uint64_tArray channel_ids, uint64_t config_update) { + 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_ChannelIdZ channel_ids_constr; + channel_ids_constr.datalen = channel_ids->arr_len; + if (channel_ids_constr.datalen > 0) + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + channel_ids_constr.data = NULL; + uint64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + uint64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; + } + FREE(channel_ids); + LDKChannelConfigUpdate config_update_conv; + config_update_conv.inner = untag_ptr(config_update); + config_update_conv.is_owned = ptr_is_owned(config_update); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_update_conv); + config_update_conv.is_owned = false; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_update_partial_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_update_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_update_channel_config"))) TS_ChannelManager_update_channel_config(uint64_t this_arg, int8_tArray counterparty_node_id, uint64_tArray channel_ids, uint64_t config) { + 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_ChannelIdZ channel_ids_constr; + channel_ids_constr.datalen = channel_ids->arr_len; + if (channel_ids_constr.datalen > 0) + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); + else + channel_ids_constr.data = NULL; + uint64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + uint64_t channel_ids_conv_11 = channel_ids_vals[l]; + LDKChannelId channel_ids_conv_11_conv; + channel_ids_conv_11_conv.inner = untag_ptr(channel_ids_conv_11); + channel_ids_conv_11_conv.is_owned = ptr_is_owned(channel_ids_conv_11); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_ids_conv_11_conv); + channel_ids_conv_11_conv = ChannelId_clone(&channel_ids_conv_11_conv); + channel_ids_constr.data[l] = channel_ids_conv_11_conv; + } + FREE(channel_ids); + LDKChannelConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv.is_owned = false; + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_forward_intercepted_htlc"))) TS_ChannelManager_forward_intercepted_htlc(uint64_t this_arg, int8_tArray intercept_id, uint64_t next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKChannelId next_hop_channel_id_conv; + next_hop_channel_id_conv.inner = untag_ptr(next_hop_channel_id); + next_hop_channel_id_conv.is_owned = ptr_is_owned(next_hop_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_hop_channel_id_conv); + next_hop_channel_id_conv.is_owned = false; + LDKPublicKey next_node_id_ref; + CHECK(next_node_id->arr_len == 33); + memcpy(next_node_id_ref.compressed_form, next_node_id->elems, 33); FREE(next_node_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_forward_intercepted_htlc(&this_arg_conv, intercept_id_ref, &next_hop_channel_id_conv, next_node_id_ref, amt_to_forward_msat); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_fail_intercepted_htlc"))) TS_ChannelManager_fail_intercepted_htlc(uint64_t this_arg, int8_tArray intercept_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes intercept_id_ref; + CHECK(intercept_id->arr_len == 32); + memcpy(intercept_id_ref.data, intercept_id->elems, 32); FREE(intercept_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_fail_intercepted_htlc(&this_arg_conv, intercept_id_ref); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + ChannelManager_process_pending_htlc_forwards(&this_arg_conv); +} + +void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(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_timer_tick_occurred(&this_arg_conv); +} + +void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t payment_hash_arr[32]; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); + uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; + ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref); +} + +void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards_with_reason"))) TS_ChannelManager_fail_htlc_backwards_with_reason(uint64_t this_arg, int8_tArray payment_hash, uint64_t failure_code) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + uint8_t payment_hash_arr[32]; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash); + uint8_t (*payment_hash_ref)[32] = &payment_hash_arr; + void* failure_code_ptr = untag_ptr(failure_code); + CHECK_ACCESS(failure_code_ptr); + LDKFailureCode failure_code_conv = *(LDKFailureCode*)(failure_code_ptr); + failure_code_conv = FailureCode_clone((LDKFailureCode*)untag_ptr(failure_code)); + ChannelManager_fail_htlc_backwards_with_reason(&this_arg_conv, payment_hash_ref, failure_code_conv); +} + +void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref); +} + +void __attribute__((export_name("TS_ChannelManager_claim_funds_with_known_custom_tlvs"))) TS_ChannelManager_claim_funds_with_known_custom_tlvs(uint64_t this_arg, int8_tArray payment_preimage) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_preimage_ref; + CHECK(payment_preimage->arr_len == 32); + memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage); + ChannelManager_claim_funds_with_known_custom_tlvs(&this_arg_conv, payment_preimage_ref); +} + +int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(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; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel"))) TS_ChannelManager_accept_inbound_channel(uint64_t this_arg, uint64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_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); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf"))) TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(uint64_t this_arg, uint64_t temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_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); + LDKU128 user_channel_id_ref; + CHECK(user_channel_id->arr_len == 16); + memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); + LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); + *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, &temporary_channel_id_conv, counterparty_node_id_ref, user_channel_id_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_create_offer_builder"))) TS_ChannelManager_create_offer_builder(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; + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_offer_builder(&this_arg_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_create_refund_builder"))) TS_ChannelManager_create_refund_builder(uint64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, uint64_t retry_strategy, uint64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_create_refund_builder(&this_arg_conv, amount_msats, absolute_expiry, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_pay_for_offer"))) TS_ChannelManager_pay_for_offer(uint64_t this_arg, uint64_t offer, uint64_t quantity, uint64_t amount_msats, uint64_t payer_note, int8_tArray payment_id, uint64_t retry_strategy, uint64_t max_total_routing_fee_msat) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOffer offer_conv; + offer_conv.inner = untag_ptr(offer); + offer_conv.is_owned = ptr_is_owned(offer); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_conv); + offer_conv.is_owned = false; + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKCOption_u64Z quantity_conv = *(LDKCOption_u64Z*)(quantity_ptr); + quantity_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity)); + void* amount_msats_ptr = untag_ptr(amount_msats); + CHECK_ACCESS(amount_msats_ptr); + LDKCOption_u64Z amount_msats_conv = *(LDKCOption_u64Z*)(amount_msats_ptr); + amount_msats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats)); + void* payer_note_ptr = untag_ptr(payer_note); + CHECK_ACCESS(payer_note_ptr); + LDKCOption_StrZ payer_note_conv = *(LDKCOption_StrZ*)(payer_note_ptr); + payer_note_conv = COption_StrZ_clone((LDKCOption_StrZ*)untag_ptr(payer_note)); + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + void* retry_strategy_ptr = untag_ptr(retry_strategy); + CHECK_ACCESS(retry_strategy_ptr); + LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); + retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); + void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); + CHECK_ACCESS(max_total_routing_fee_msat_ptr); + LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); + max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_pay_for_offer(&this_arg_conv, &offer_conv, quantity_conv, amount_msats_conv, payer_note_conv, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_request_refund_payment"))) TS_ChannelManager_request_refund_payment(uint64_t this_arg, uint64_t refund) { + 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; + LDKRefund refund_conv; + refund_conv.inner = untag_ptr(refund); + refund_conv.is_owned = ptr_is_owned(refund); + CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); + refund_conv.is_owned = false; + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment"))) TS_ChannelManager_create_inbound_payment(uint64_t this_arg, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry_delta) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint64_t this_arg, int8_tArray payment_hash, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry); + CHECK_ACCESS(min_final_cltv_expiry_ptr); + LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr); + min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry)); + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) TS_ChannelManager_get_payment_preimage(uint64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); + return tag_ptr(ret_conv, true); +} + +int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(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; + LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&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_ChannelManager_get_intercept_scid"))) TS_ChannelManager_get_intercept_scid(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_compute_inflight_htlcs"))) TS_ChannelManager_compute_inflight_htlcs(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(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; + LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); + *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(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; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = ChannelManager_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_get_event_or_persistence_needed_future"))) TS_ChannelManager_get_event_or_persistence_needed_future(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKFuture ret_var = ChannelManager_get_event_or_persistence_needed_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; +} + +jboolean __attribute__((export_name("TS_ChannelManager_get_and_clear_needs_persistence"))) TS_ChannelManager_get_and_clear_needs_persistence(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; + jboolean ret_conv = ChannelManager_get_and_clear_needs_persistence(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_node_features"))) TS_ChannelManager_node_features(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_channel_features"))) TS_ChannelManager_channel_features(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_channel_type_features"))) TS_ChannelManager_channel_type_features(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_init_features"))) TS_ChannelManager_init_features(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) { + LDKChannelManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_OffersMessageHandler"))) TS_ChannelManager_as_OffersMessageHandler(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; + LDKOffersMessageHandler* ret_ret = MALLOC(sizeof(LDKOffersMessageHandler), "LDKOffersMessageHandler"); + *ret_ret = ChannelManager_as_OffersMessageHandler(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_ChannelManager_as_NodeIdLookUp"))) TS_ChannelManager_as_NodeIdLookUp(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; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = ChannelManager_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +uint64_t __attribute__((export_name("TS_provided_init_features"))) TS_provided_init_features(uint64_t config) { + LDKUserConfig config_conv; + config_conv.inner = untag_ptr(config); + config_conv.is_owned = ptr_is_owned(config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); + config_conv.is_owned = false; + LDKInitFeatures ret_var = provided_init_features(&config_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) { + LDKPhantomRouteHints 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 = PhantomRouteHints_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_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); + *ret_conv = PhantomRouteHints_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_BlindedForward_write"))) TS_BlindedForward_write(uint64_t obj) { + LDKBlindedForward 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 = BlindedForward_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_BlindedForward_read"))) TS_BlindedForward_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); + *ret_conv = BlindedForward_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_PendingHTLCRouting_write"))) TS_PendingHTLCRouting_write(uint64_t obj) { + LDKPendingHTLCRouting* obj_conv = (LDKPendingHTLCRouting*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PendingHTLCRouting_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_PendingHTLCRouting_read"))) TS_PendingHTLCRouting_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); + *ret_conv = PendingHTLCRouting_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_PendingHTLCInfo_write"))) TS_PendingHTLCInfo_write(uint64_t obj) { + LDKPendingHTLCInfo 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 = PendingHTLCInfo_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_PendingHTLCInfo_read"))) TS_PendingHTLCInfo_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); + *ret_conv = PendingHTLCInfo_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_BlindedFailure_write"))) TS_BlindedFailure_write(uint64_t obj) { + LDKBlindedFailure* obj_conv = (LDKBlindedFailure*)untag_ptr(obj); + LDKCVec_u8Z ret_var = BlindedFailure_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_BlindedFailure_read"))) TS_BlindedFailure_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); + *ret_conv = BlindedFailure_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) { + LDKChannelManager 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 = ChannelManager_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_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) { + LDKChannelManagerReadArgs 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); + ChannelManagerReadArgs_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_entropy_source"))) TS_ChannelManagerReadArgs_get_entropy_source(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_entropy_source"))) TS_ChannelManagerReadArgs_set_entropy_source(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + 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); + LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr); + if (val_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_node_signer"))) TS_ChannelManagerReadArgs_get_node_signer(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_node_signer"))) TS_ChannelManagerReadArgs_set_node_signer(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr); + if (val_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_signer_provider"))) TS_ChannelManagerReadArgs_get_signer_provider(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_signer_provider"))) TS_ChannelManagerReadArgs_set_signer_provider(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr); + if (val_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); + if (val_conv.free == LDKFeeEstimator_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKFeeEstimator_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKWatch val_conv = *(LDKWatch*)(val_ptr); + if (val_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); + if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKBroadcasterInterface_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_router"))) TS_ChannelManagerReadArgs_get_router(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_router"))) TS_ChannelManagerReadArgs_set_router(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKRouter val_conv = *(LDKRouter*)(val_ptr); + if (val_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + // WARNING: This object doesn't live past this scope, needs clone! + uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false); + return ret_ret; +} + +void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKLogger val_conv = *(LDKLogger*)(val_ptr); + if (val_conv.free == LDKLogger_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKLogger_JCalls_cloned(&val_conv); + } + ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&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_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) { + LDKChannelManagerReadArgs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUserConfig 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 = UserConfig_clone(&val_conv); + ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint64_t entropy_source, uint64_t node_signer, uint64_t signer_provider, uint64_t fee_estimator, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t router, uint64_t logger, uint64_t default_config, uint64_tArray channel_monitors) { + void* entropy_source_ptr = untag_ptr(entropy_source); + CHECK_ACCESS(entropy_source_ptr); + LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); + if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKEntropySource_JCalls_cloned(&entropy_source_conv); + } + void* node_signer_ptr = untag_ptr(node_signer); + CHECK_ACCESS(node_signer_ptr); + LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); + if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeSigner_JCalls_cloned(&node_signer_conv); + } + void* signer_provider_ptr = untag_ptr(signer_provider); + CHECK_ACCESS(signer_provider_ptr); + LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); + if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKSignerProvider_JCalls_cloned(&signer_provider_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* chain_monitor_ptr = untag_ptr(chain_monitor); + CHECK_ACCESS(chain_monitor_ptr); + LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); + if (chain_monitor_conv.free == LDKWatch_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKWatch_JCalls_cloned(&chain_monitor_conv); + } + void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); + CHECK_ACCESS(tx_broadcaster_ptr); + LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); + if (tx_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(&tx_broadcaster_conv); + } + void* router_ptr = untag_ptr(router); + CHECK_ACCESS(router_ptr); + LDKRouter router_conv = *(LDKRouter*)(router_ptr); + if (router_conv.free == LDKRouter_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKRouter_JCalls_cloned(&router_conv); + } + void* logger_ptr = untag_ptr(logger); + CHECK_ACCESS(logger_ptr); + LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); + if (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); + } + LDKUserConfig default_config_conv; + default_config_conv.inner = untag_ptr(default_config); + default_config_conv.is_owned = ptr_is_owned(default_config); + CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); + default_config_conv = UserConfig_clone(&default_config_conv); + LDKCVec_ChannelMonitorZ channel_monitors_constr; + channel_monitors_constr.datalen = channel_monitors->arr_len; + if (channel_monitors_constr.datalen > 0) + channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); + else + channel_monitors_constr.data = NULL; + uint64_t* channel_monitors_vals = channel_monitors->elems; + for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { + uint64_t channel_monitors_conv_16 = channel_monitors_vals[q]; + LDKChannelMonitor channel_monitors_conv_16_conv; + channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16); + channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); + channel_monitors_conv_16_conv.is_owned = false; + channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; + } + FREE(channel_monitors); + LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_C2Tuple_ThirtyTwoBytesChannelManagerZ_read"))) TS_C2Tuple_ThirtyTwoBytesChannelManagerZ_read(int8_tArray ser, uint64_t arg) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKChannelManagerReadArgs arg_conv; + arg_conv.inner = untag_ptr(arg); + arg_conv.is_owned = ptr_is_owned(arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); + // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs + + LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ"); + *ret_conv = C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser_ref, arg_conv); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_DelayedPaymentBasepoint_free"))) TS_DelayedPaymentBasepoint_free(uint64_t this_obj) { + LDKDelayedPaymentBasepoint 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); + DelayedPaymentBasepoint_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_get_a"))) TS_DelayedPaymentBasepoint_get_a(uint64_t this_ptr) { + LDKDelayedPaymentBasepoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_DelayedPaymentBasepoint_set_a"))) TS_DelayedPaymentBasepoint_set_a(uint64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentBasepoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + DelayedPaymentBasepoint_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_DelayedPaymentBasepoint_new"))) TS_DelayedPaymentBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_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; +} + +jboolean __attribute__((export_name("TS_DelayedPaymentBasepoint_eq"))) TS_DelayedPaymentBasepoint_eq(uint64_t a, uint64_t b) { + LDKDelayedPaymentBasepoint 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; + LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t DelayedPaymentBasepoint_clone_ptr(LDKDelayedPaymentBasepoint *NONNULL_PTR arg) { + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_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_DelayedPaymentBasepoint_clone_ptr"))) TS_DelayedPaymentBasepoint_clone_ptr(uint64_t arg) { + LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_DelayedPaymentBasepoint_clone"))) TS_DelayedPaymentBasepoint_clone(uint64_t orig) { + LDKDelayedPaymentBasepoint 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; + LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_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_DelayedPaymentBasepoint_hash"))) TS_DelayedPaymentBasepoint_hash(uint64_t o) { + LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_hash(&o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf"))) TS_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(uint64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { - LDKChannelManager this_arg_conv; +int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_to_public_key"))) TS_DelayedPaymentBasepoint_to_public_key(uint64_t this_arg) { + LDKDelayedPaymentBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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 temporary_channel_id_arr[32]; - CHECK(temporary_channel_id->arr_len == 32); - memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id); - uint8_t (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr; - LDKPublicKey counterparty_node_id_ref; - CHECK(counterparty_node_id->arr_len == 33); - memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id); - LDKU128 user_channel_id_ref; - CHECK(user_channel_id->arr_len == 16); - memcpy(user_channel_id_ref.le_bytes, user_channel_id->elems, 16); FREE(user_channel_id); - LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ"); - *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id_ref); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_pay_for_offer"))) TS_ChannelManager_pay_for_offer(uint64_t this_arg, uint64_t offer, uint64_t quantity, uint64_t amount_msats, uint64_t payer_note, int8_tArray payment_id, uint64_t retry_strategy, uint64_t max_total_routing_fee_msat) { - LDKChannelManager this_arg_conv; +int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_derive_add_tweak"))) TS_DelayedPaymentBasepoint_derive_add_tweak(uint64_t this_arg, int8_tArray per_commitment_point) { + LDKDelayedPaymentBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKOffer offer_conv; - offer_conv.inner = untag_ptr(offer); - offer_conv.is_owned = ptr_is_owned(offer); - CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_conv); - offer_conv.is_owned = false; - void* quantity_ptr = untag_ptr(quantity); - CHECK_ACCESS(quantity_ptr); - LDKCOption_u64Z quantity_conv = *(LDKCOption_u64Z*)(quantity_ptr); - quantity_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity)); - void* amount_msats_ptr = untag_ptr(amount_msats); - CHECK_ACCESS(amount_msats_ptr); - LDKCOption_u64Z amount_msats_conv = *(LDKCOption_u64Z*)(amount_msats_ptr); - amount_msats_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amount_msats)); - void* payer_note_ptr = untag_ptr(payer_note); - CHECK_ACCESS(payer_note_ptr); - LDKCOption_StrZ payer_note_conv = *(LDKCOption_StrZ*)(payer_note_ptr); - payer_note_conv = COption_StrZ_clone((LDKCOption_StrZ*)untag_ptr(payer_note)); - LDKThirtyTwoBytes payment_id_ref; - CHECK(payment_id->arr_len == 32); - memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); - void* retry_strategy_ptr = untag_ptr(retry_strategy); - CHECK_ACCESS(retry_strategy_ptr); - LDKRetry retry_strategy_conv = *(LDKRetry*)(retry_strategy_ptr); - retry_strategy_conv = Retry_clone((LDKRetry*)untag_ptr(retry_strategy)); - void* max_total_routing_fee_msat_ptr = untag_ptr(max_total_routing_fee_msat); - CHECK_ACCESS(max_total_routing_fee_msat_ptr); - LDKCOption_u64Z max_total_routing_fee_msat_conv = *(LDKCOption_u64Z*)(max_total_routing_fee_msat_ptr); - max_total_routing_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(max_total_routing_fee_msat)); - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_pay_for_offer(&this_arg_conv, &offer_conv, quantity_conv, amount_msats_conv, payer_note_conv, payment_id_ref, retry_strategy_conv, max_total_routing_fee_msat_conv); - return tag_ptr(ret_conv, true); + 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); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_request_refund_payment"))) TS_ChannelManager_request_refund_payment(uint64_t this_arg, uint64_t refund) { - 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; - LDKRefund refund_conv; - refund_conv.inner = untag_ptr(refund); - refund_conv.is_owned = ptr_is_owned(refund); - CHECK_INNER_FIELD_ACCESS_OR_NULL(refund_conv); - refund_conv.is_owned = false; - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = ChannelManager_request_refund_payment(&this_arg_conv, &refund_conv); +int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_write"))) TS_DelayedPaymentBasepoint_write(uint64_t obj) { + LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_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_DelayedPaymentBasepoint_read"))) TS_DelayedPaymentBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); + *ret_conv = DelayedPaymentBasepoint_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment"))) TS_ChannelManager_create_inbound_payment(uint64_t this_arg, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry_delta) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_DelayedPaymentKey_free"))) TS_DelayedPaymentKey_free(uint64_t this_obj) { + LDKDelayedPaymentKey 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); + DelayedPaymentKey_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_DelayedPaymentKey_get_a"))) TS_DelayedPaymentKey_get_a(uint64_t this_ptr) { + LDKDelayedPaymentKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, DelayedPaymentKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_DelayedPaymentKey_set_a"))) TS_DelayedPaymentKey_set_a(uint64_t this_ptr, int8_tArray val) { + LDKDelayedPaymentKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + DelayedPaymentKey_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_DelayedPaymentKey_new"))) TS_DelayedPaymentKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_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; +} + +jboolean __attribute__((export_name("TS_DelayedPaymentKey_eq"))) TS_DelayedPaymentKey_eq(uint64_t a, uint64_t b) { + LDKDelayedPaymentKey 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; + LDKDelayedPaymentKey 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 = DelayedPaymentKey_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t DelayedPaymentKey_clone_ptr(LDKDelayedPaymentKey *NONNULL_PTR arg) { + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_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_DelayedPaymentKey_clone_ptr"))) TS_DelayedPaymentKey_clone_ptr(uint64_t arg) { + LDKDelayedPaymentKey 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 = DelayedPaymentKey_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_DelayedPaymentKey_clone"))) TS_DelayedPaymentKey_clone(uint64_t orig) { + LDKDelayedPaymentKey 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; + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_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_DelayedPaymentKey_from_basepoint"))) TS_DelayedPaymentKey_from_basepoint(uint64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKDelayedPaymentBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + 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); + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_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_DelayedPaymentKey_from_secret_key"))) TS_DelayedPaymentKey_from_secret_key(int8_tArray sk) { + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_secret_key(sk_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_DelayedPaymentKey_to_public_key"))) TS_DelayedPaymentKey_to_public_key(uint64_t this_arg) { + LDKDelayedPaymentKey this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_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* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_delta_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, DelayedPaymentKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_DelayedPaymentKey_write"))) TS_DelayedPaymentKey_write(uint64_t obj) { + LDKDelayedPaymentKey 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 = DelayedPaymentKey_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_DelayedPaymentKey_read"))) TS_DelayedPaymentKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); + *ret_conv = DelayedPaymentKey_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelManager_create_inbound_payment_for_hash"))) TS_ChannelManager_create_inbound_payment_for_hash(uint64_t this_arg, int8_tArray payment_hash, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t min_final_cltv_expiry) { - LDKChannelManager this_arg_conv; +void __attribute__((export_name("TS_HtlcBasepoint_free"))) TS_HtlcBasepoint_free(uint64_t this_obj) { + LDKHtlcBasepoint 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); + HtlcBasepoint_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_HtlcBasepoint_get_a"))) TS_HtlcBasepoint_get_a(uint64_t this_ptr) { + LDKHtlcBasepoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, HtlcBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_HtlcBasepoint_set_a"))) TS_HtlcBasepoint_set_a(uint64_t this_ptr, int8_tArray val) { + LDKHtlcBasepoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + HtlcBasepoint_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_HtlcBasepoint_new"))) TS_HtlcBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKHtlcBasepoint ret_var = HtlcBasepoint_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; +} + +jboolean __attribute__((export_name("TS_HtlcBasepoint_eq"))) TS_HtlcBasepoint_eq(uint64_t a, uint64_t b) { + LDKHtlcBasepoint 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; + LDKHtlcBasepoint 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 = HtlcBasepoint_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t HtlcBasepoint_clone_ptr(LDKHtlcBasepoint *NONNULL_PTR arg) { + LDKHtlcBasepoint ret_var = HtlcBasepoint_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_HtlcBasepoint_clone_ptr"))) TS_HtlcBasepoint_clone_ptr(uint64_t arg) { + LDKHtlcBasepoint 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 = HtlcBasepoint_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_HtlcBasepoint_clone"))) TS_HtlcBasepoint_clone(uint64_t orig) { + LDKHtlcBasepoint 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; + LDKHtlcBasepoint ret_var = HtlcBasepoint_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_HtlcBasepoint_hash"))) TS_HtlcBasepoint_hash(uint64_t o) { + LDKHtlcBasepoint 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 = HtlcBasepoint_hash(&o_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_HtlcBasepoint_to_public_key"))) TS_HtlcBasepoint_to_public_key(uint64_t this_arg) { + LDKHtlcBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* min_final_cltv_expiry_ptr = untag_ptr(min_final_cltv_expiry); - CHECK_ACCESS(min_final_cltv_expiry_ptr); - LDKCOption_u16Z min_final_cltv_expiry_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_ptr); - min_final_cltv_expiry_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry)); - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs, min_final_cltv_expiry_conv); - return tag_ptr(ret_conv, true); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_get_payment_preimage"))) TS_ChannelManager_get_payment_preimage(uint64_t this_arg, int8_tArray payment_hash, int8_tArray payment_secret) { - LDKChannelManager this_arg_conv; +int8_tArray __attribute__((export_name("TS_HtlcBasepoint_derive_add_tweak"))) TS_HtlcBasepoint_derive_add_tweak(uint64_t this_arg, int8_tArray per_commitment_point) { + LDKHtlcBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - LDKThirtyTwoBytes payment_secret_ref; - CHECK(payment_secret->arr_len == 32); - memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); - LDKCResult_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); - *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref); + 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); + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, HtlcBasepoint_derive_add_tweak(&this_arg_conv, per_commitment_point_ref).data, 32); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_HtlcBasepoint_write"))) TS_HtlcBasepoint_write(uint64_t obj) { + LDKHtlcBasepoint 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 = HtlcBasepoint_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_HtlcBasepoint_read"))) TS_HtlcBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); + *ret_conv = HtlcBasepoint_read(ser_ref); + FREE(ser); return tag_ptr(ret_conv, true); } -int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv); +void __attribute__((export_name("TS_HtlcKey_free"))) TS_HtlcKey_free(uint64_t this_obj) { + LDKHtlcKey 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); + HtlcKey_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_HtlcKey_get_a"))) TS_HtlcKey_get_a(uint64_t this_ptr) { + LDKHtlcKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, HtlcKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_HtlcKey_set_a"))) TS_HtlcKey_set_a(uint64_t this_ptr, int8_tArray val) { + LDKHtlcKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + HtlcKey_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_HtlcKey_new"))) TS_HtlcKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKHtlcKey ret_var = HtlcKey_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; +} + +jboolean __attribute__((export_name("TS_HtlcKey_eq"))) TS_HtlcKey_eq(uint64_t a, uint64_t b) { + LDKHtlcKey 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; + LDKHtlcKey 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 = HtlcKey_eq(&a_conv, &b_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(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; - LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv); +static inline uint64_t HtlcKey_clone_ptr(LDKHtlcKey *NONNULL_PTR arg) { + LDKHtlcKey ret_var = HtlcKey_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_HtlcKey_clone_ptr"))) TS_HtlcKey_clone_ptr(uint64_t arg) { + LDKHtlcKey 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 = HtlcKey_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_HtlcKey_clone"))) TS_HtlcKey_clone(uint64_t orig) { + LDKHtlcKey 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; + LDKHtlcKey ret_var = HtlcKey_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_HtlcKey_from_basepoint"))) TS_HtlcKey_from_basepoint(uint64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKHtlcBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + 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); + LDKHtlcKey ret_var = HtlcKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_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_HtlcKey_from_secret_key"))) TS_HtlcKey_from_secret_key(int8_tArray sk) { + uint8_t sk_arr[32]; + CHECK(sk->arr_len == 32); + memcpy(sk_arr, sk->elems, 32); FREE(sk); + uint8_t (*sk_ref)[32] = &sk_arr; + LDKHtlcKey ret_var = HtlcKey_from_secret_key(sk_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_ChannelManager_get_intercept_scid"))) TS_ChannelManager_get_intercept_scid(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +int8_tArray __attribute__((export_name("TS_HtlcKey_to_public_key"))) TS_HtlcKey_to_public_key(uint64_t this_arg) { + LDKHtlcKey this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - int64_t ret_conv = ChannelManager_get_intercept_scid(&this_arg_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, HtlcKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_compute_inflight_htlcs"))) TS_ChannelManager_compute_inflight_htlcs(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInFlightHtlcs ret_var = ChannelManager_compute_inflight_htlcs(&this_arg_conv); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int8_tArray __attribute__((export_name("TS_HtlcKey_write"))) TS_HtlcKey_write(uint64_t obj) { + LDKHtlcKey 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 = HtlcKey_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_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(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; - LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider"); - *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +uint64_t __attribute__((export_name("TS_HtlcKey_read"))) TS_HtlcKey_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); + *ret_conv = HtlcKey_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(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; - LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider"); - *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray __attribute__((export_name("TS_add_public_key_tweak"))) TS_add_public_key_tweak(int8_tArray base_point, int8_tArray tweak) { + LDKPublicKey base_point_ref; + CHECK(base_point->arr_len == 33); + memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point); + uint8_t tweak_arr[32]; + CHECK(tweak->arr_len == 32); + memcpy(tweak_arr, tweak->elems, 32); FREE(tweak); + uint8_t (*tweak_ref)[32] = &tweak_arr; + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, add_public_key_tweak(base_point_ref, tweak_ref).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(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; - LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); - *ret_ret = ChannelManager_as_Listen(&this_arg_conv); - return tag_ptr(ret_ret, true); +void __attribute__((export_name("TS_RevocationBasepoint_free"))) TS_RevocationBasepoint_free(uint64_t this_obj) { + LDKRevocationBasepoint 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); + RevocationBasepoint_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(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; - LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); - *ret_ret = ChannelManager_as_Confirm(&this_arg_conv); - return tag_ptr(ret_ret, true); +int8_tArray __attribute__((export_name("TS_RevocationBasepoint_get_a"))) TS_RevocationBasepoint_get_a(uint64_t this_ptr) { + LDKRevocationBasepoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; } -uint64_t __attribute__((export_name("TS_ChannelManager_get_event_or_persistence_needed_future"))) TS_ChannelManager_get_event_or_persistence_needed_future(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKFuture ret_var = ChannelManager_get_event_or_persistence_needed_future(&this_arg_conv); +void __attribute__((export_name("TS_RevocationBasepoint_set_a"))) TS_RevocationBasepoint_set_a(uint64_t this_ptr, int8_tArray val) { + LDKRevocationBasepoint this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + RevocationBasepoint_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_RevocationBasepoint_new"))) TS_RevocationBasepoint_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKRevocationBasepoint ret_var = RevocationBasepoint_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; } -jboolean __attribute__((export_name("TS_ChannelManager_get_and_clear_needs_persistence"))) TS_ChannelManager_get_and_clear_needs_persistence(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; - jboolean ret_conv = ChannelManager_get_and_clear_needs_persistence(&this_arg_conv); +jboolean __attribute__((export_name("TS_RevocationBasepoint_eq"))) TS_RevocationBasepoint_eq(uint64_t a, uint64_t b) { + LDKRevocationBasepoint 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; + LDKRevocationBasepoint 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 = RevocationBasepoint_eq(&a_conv, &b_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv); +static inline uint64_t RevocationBasepoint_clone_ptr(LDKRevocationBasepoint *NONNULL_PTR arg) { + LDKRevocationBasepoint ret_var = RevocationBasepoint_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_RevocationBasepoint_clone_ptr"))) TS_RevocationBasepoint_clone_ptr(uint64_t arg) { + LDKRevocationBasepoint 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 = RevocationBasepoint_clone_ptr(&arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_ChannelManager_node_features"))) TS_ChannelManager_node_features(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKNodeFeatures ret_var = ChannelManager_node_features(&this_arg_conv); +uint64_t __attribute__((export_name("TS_RevocationBasepoint_clone"))) TS_RevocationBasepoint_clone(uint64_t orig) { + LDKRevocationBasepoint 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; + LDKRevocationBasepoint ret_var = RevocationBasepoint_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_ChannelManager_channel_features"))) TS_ChannelManager_channel_features(uint64_t this_arg) { - LDKChannelManager this_arg_conv; +int64_t __attribute__((export_name("TS_RevocationBasepoint_hash"))) TS_RevocationBasepoint_hash(uint64_t o) { + LDKRevocationBasepoint 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 = RevocationBasepoint_hash(&o_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_RevocationBasepoint_to_public_key"))) TS_RevocationBasepoint_to_public_key(uint64_t this_arg) { + LDKRevocationBasepoint this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKChannelFeatures ret_var = ChannelManager_channel_features(&this_arg_conv); + int8_tArray ret_arr = init_int8_tArray(33, __LINE__); + memcpy(ret_arr->elems, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_RevocationBasepoint_write"))) TS_RevocationBasepoint_write(uint64_t obj) { + LDKRevocationBasepoint 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 = RevocationBasepoint_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_RevocationBasepoint_read"))) TS_RevocationBasepoint_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); + *ret_conv = RevocationBasepoint_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_RevocationKey_free"))) TS_RevocationKey_free(uint64_t this_obj) { + LDKRevocationKey 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); + RevocationKey_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_RevocationKey_get_a"))) TS_RevocationKey_get_a(uint64_t this_ptr) { + LDKRevocationKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, RevocationKey_get_a(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_RevocationKey_set_a"))) TS_RevocationKey_set_a(uint64_t this_ptr, int8_tArray val) { + LDKRevocationKey this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + RevocationKey_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_RevocationKey_new"))) TS_RevocationKey_new(int8_tArray a_arg) { + LDKPublicKey a_arg_ref; + CHECK(a_arg->arr_len == 33); + memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); + LDKRevocationKey ret_var = RevocationKey_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; } -uint64_t __attribute__((export_name("TS_ChannelManager_channel_type_features"))) TS_ChannelManager_channel_type_features(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = ChannelManager_channel_type_features(&this_arg_conv); +jboolean __attribute__((export_name("TS_RevocationKey_eq"))) TS_RevocationKey_eq(uint64_t a, uint64_t b) { + LDKRevocationKey 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; + LDKRevocationKey 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 = RevocationKey_eq(&a_conv, &b_conv); + return ret_conv; +} + +static inline uint64_t RevocationKey_clone_ptr(LDKRevocationKey *NONNULL_PTR arg) { + LDKRevocationKey ret_var = RevocationKey_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_RevocationKey_clone_ptr"))) TS_RevocationKey_clone_ptr(uint64_t arg) { + LDKRevocationKey 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 = RevocationKey_clone_ptr(&arg_conv); + return ret_conv; +} -uint64_t __attribute__((export_name("TS_ChannelManager_init_features"))) TS_ChannelManager_init_features(uint64_t this_arg) { - LDKChannelManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKInitFeatures ret_var = ChannelManager_init_features(&this_arg_conv); +uint64_t __attribute__((export_name("TS_RevocationKey_clone"))) TS_RevocationKey_clone(uint64_t orig) { + LDKRevocationKey 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; + LDKRevocationKey ret_var = RevocationKey_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_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(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; - LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler"); - *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); -} - -uint64_t __attribute__((export_name("TS_ChannelManager_as_OffersMessageHandler"))) TS_ChannelManager_as_OffersMessageHandler(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; - LDKOffersMessageHandler* ret_ret = MALLOC(sizeof(LDKOffersMessageHandler), "LDKOffersMessageHandler"); - *ret_ret = ChannelManager_as_OffersMessageHandler(&this_arg_conv); - return tag_ptr(ret_ret, true); +int64_t __attribute__((export_name("TS_RevocationKey_hash"))) TS_RevocationKey_hash(uint64_t o) { + LDKRevocationKey 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 = RevocationKey_hash(&o_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_provided_init_features"))) TS_provided_init_features(uint64_t config) { - LDKUserConfig config_conv; - config_conv.inner = untag_ptr(config); - config_conv.is_owned = ptr_is_owned(config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv); - config_conv.is_owned = false; - LDKInitFeatures ret_var = provided_init_features(&config_conv); +uint64_t __attribute__((export_name("TS_RevocationKey_from_basepoint"))) TS_RevocationKey_from_basepoint(uint64_t countersignatory_basepoint, int8_tArray per_commitment_point) { + LDKRevocationBasepoint countersignatory_basepoint_conv; + countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); + countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); + countersignatory_basepoint_conv.is_owned = false; + 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); + LDKRevocationKey ret_var = RevocationKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_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_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) { - LDKCounterpartyForwardingInfo obj_conv; +int8_tArray __attribute__((export_name("TS_RevocationKey_to_public_key"))) TS_RevocationKey_to_public_key(uint64_t this_arg) { + LDKRevocationKey this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, RevocationKey_to_public_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + +int8_tArray __attribute__((export_name("TS_RevocationKey_write"))) TS_RevocationKey_write(uint64_t obj) { + LDKRevocationKey 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 = CounterpartyForwardingInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = RevocationKey_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_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_RevocationKey_read"))) TS_RevocationKey_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); - *ret_conv = CounterpartyForwardingInfo_read(ser_ref); + LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); + *ret_conv = RevocationKey_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) { - LDKChannelCounterparty 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 = ChannelCounterparty_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_InboundHTLCStateDetails_clone"))) TS_InboundHTLCStateDetails_clone(uint64_t orig) { + LDKInboundHTLCStateDetails* orig_conv = (LDKInboundHTLCStateDetails*)untag_ptr(orig); + uint32_t ret_conv = LDKInboundHTLCStateDetails_to_js(InboundHTLCStateDetails_clone(orig_conv)); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); - *ret_conv = ChannelCounterparty_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint32_t __attribute__((export_name("TS_InboundHTLCStateDetails_awaiting_remote_revoke_to_add"))) TS_InboundHTLCStateDetails_awaiting_remote_revoke_to_add() { + uint32_t ret_conv = LDKInboundHTLCStateDetails_to_js(InboundHTLCStateDetails_awaiting_remote_revoke_to_add()); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) { - LDKChannelDetails 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 = ChannelDetails_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_InboundHTLCStateDetails_committed"))) TS_InboundHTLCStateDetails_committed() { + uint32_t ret_conv = LDKInboundHTLCStateDetails_to_js(InboundHTLCStateDetails_committed()); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); - *ret_conv = ChannelDetails_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint32_t __attribute__((export_name("TS_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill"))) TS_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill() { + uint32_t ret_conv = LDKInboundHTLCStateDetails_to_js(InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fulfill()); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) { - LDKPhantomRouteHints 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 = PhantomRouteHints_write(&obj_conv); +uint32_t __attribute__((export_name("TS_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail"))) TS_InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail() { + uint32_t ret_conv = LDKInboundHTLCStateDetails_to_js(InboundHTLCStateDetails_awaiting_remote_revoke_to_remove_fail()); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_InboundHTLCStateDetails_write"))) TS_InboundHTLCStateDetails_write(uint64_t obj) { + LDKInboundHTLCStateDetails* obj_conv = (LDKInboundHTLCStateDetails*)untag_ptr(obj); + LDKCVec_u8Z ret_var = InboundHTLCStateDetails_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_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_InboundHTLCStateDetails_read"))) TS_InboundHTLCStateDetails_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ"); - *ret_conv = PhantomRouteHints_read(ser_ref); + LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_InboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = InboundHTLCStateDetails_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_BlindedForward_write"))) TS_BlindedForward_write(uint64_t obj) { - LDKBlindedForward 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 = BlindedForward_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_InboundHTLCDetails_free"))) TS_InboundHTLCDetails_free(uint64_t this_obj) { + LDKInboundHTLCDetails 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); + InboundHTLCDetails_free(this_obj_conv); +} + +int64_t __attribute__((export_name("TS_InboundHTLCDetails_get_htlc_id"))) TS_InboundHTLCDetails_get_htlc_id(uint64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCDetails_get_htlc_id(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_InboundHTLCDetails_set_htlc_id"))) TS_InboundHTLCDetails_set_htlc_id(uint64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_htlc_id(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_InboundHTLCDetails_get_amount_msat"))) TS_InboundHTLCDetails_get_amount_msat(uint64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCDetails_get_amount_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_InboundHTLCDetails_set_amount_msat"))) TS_InboundHTLCDetails_set_amount_msat(uint64_t this_ptr, int64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_amount_msat(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_InboundHTLCDetails_get_cltv_expiry"))) TS_InboundHTLCDetails_get_cltv_expiry(uint64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCDetails_get_cltv_expiry(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_InboundHTLCDetails_set_cltv_expiry"))) TS_InboundHTLCDetails_set_cltv_expiry(uint64_t this_ptr, int32_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_cltv_expiry(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_InboundHTLCDetails_get_payment_hash"))) TS_InboundHTLCDetails_get_payment_hash(uint64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *InboundHTLCDetails_get_payment_hash(&this_ptr_conv), 32); return ret_arr; } -uint64_t __attribute__((export_name("TS_BlindedForward_read"))) TS_BlindedForward_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedForwardDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedForwardDecodeErrorZ), "LDKCResult_BlindedForwardDecodeErrorZ"); - *ret_conv = BlindedForward_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_InboundHTLCDetails_set_payment_hash"))) TS_InboundHTLCDetails_set_payment_hash(uint64_t this_ptr, int8_tArray val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + InboundHTLCDetails_set_payment_hash(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_InboundHTLCDetails_get_state"))) TS_InboundHTLCDetails_get_state(uint64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_InboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_InboundHTLCStateDetailsZ), "LDKCOption_InboundHTLCStateDetailsZ"); + *ret_copy = InboundHTLCDetails_get_state(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_InboundHTLCDetails_set_state"))) TS_InboundHTLCDetails_set_state(uint64_t this_ptr, uint64_t val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_InboundHTLCStateDetailsZ val_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(val_ptr); + val_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(val)); + InboundHTLCDetails_set_state(&this_ptr_conv, val_conv); +} + +jboolean __attribute__((export_name("TS_InboundHTLCDetails_get_is_dust"))) TS_InboundHTLCDetails_get_is_dust(uint64_t this_ptr) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InboundHTLCDetails_get_is_dust(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_InboundHTLCDetails_set_is_dust"))) TS_InboundHTLCDetails_set_is_dust(uint64_t this_ptr, jboolean val) { + LDKInboundHTLCDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + InboundHTLCDetails_set_is_dust(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_PendingHTLCRouting_write"))) TS_PendingHTLCRouting_write(uint64_t obj) { - LDKPendingHTLCRouting* obj_conv = (LDKPendingHTLCRouting*)untag_ptr(obj); - LDKCVec_u8Z ret_var = PendingHTLCRouting_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_InboundHTLCDetails_new"))) TS_InboundHTLCDetails_new(int64_t htlc_id_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, uint64_t state_arg, jboolean is_dust_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* state_arg_ptr = untag_ptr(state_arg); + CHECK_ACCESS(state_arg_ptr); + LDKCOption_InboundHTLCStateDetailsZ state_arg_conv = *(LDKCOption_InboundHTLCStateDetailsZ*)(state_arg_ptr); + state_arg_conv = COption_InboundHTLCStateDetailsZ_clone((LDKCOption_InboundHTLCStateDetailsZ*)untag_ptr(state_arg)); + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_new(htlc_id_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, state_arg_conv, is_dust_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_PendingHTLCRouting_read"))) TS_PendingHTLCRouting_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_PendingHTLCRoutingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCRoutingDecodeErrorZ), "LDKCResult_PendingHTLCRoutingDecodeErrorZ"); - *ret_conv = PendingHTLCRouting_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +static inline uint64_t InboundHTLCDetails_clone_ptr(LDKInboundHTLCDetails *NONNULL_PTR arg) { + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_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_InboundHTLCDetails_clone_ptr"))) TS_InboundHTLCDetails_clone_ptr(uint64_t arg) { + LDKInboundHTLCDetails 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 = InboundHTLCDetails_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_PendingHTLCInfo_write"))) TS_PendingHTLCInfo_write(uint64_t obj) { - LDKPendingHTLCInfo obj_conv; +uint64_t __attribute__((export_name("TS_InboundHTLCDetails_clone"))) TS_InboundHTLCDetails_clone(uint64_t orig) { + LDKInboundHTLCDetails 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; + LDKInboundHTLCDetails ret_var = InboundHTLCDetails_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_InboundHTLCDetails_write"))) TS_InboundHTLCDetails_write(uint64_t obj) { + LDKInboundHTLCDetails 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 = PendingHTLCInfo_write(&obj_conv); + LDKCVec_u8Z ret_var = InboundHTLCDetails_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_PendingHTLCInfo_read"))) TS_PendingHTLCInfo_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_InboundHTLCDetails_read"))) TS_InboundHTLCDetails_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_PendingHTLCInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PendingHTLCInfoDecodeErrorZ), "LDKCResult_PendingHTLCInfoDecodeErrorZ"); - *ret_conv = PendingHTLCInfo_read(ser_ref); + LDKCResult_InboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InboundHTLCDetailsDecodeErrorZ), "LDKCResult_InboundHTLCDetailsDecodeErrorZ"); + *ret_conv = InboundHTLCDetails_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -int8_tArray __attribute__((export_name("TS_BlindedFailure_write"))) TS_BlindedFailure_write(uint64_t obj) { - LDKBlindedFailure* obj_conv = (LDKBlindedFailure*)untag_ptr(obj); - LDKCVec_u8Z ret_var = BlindedFailure_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_OutboundHTLCStateDetails_clone"))) TS_OutboundHTLCStateDetails_clone(uint64_t orig) { + LDKOutboundHTLCStateDetails* orig_conv = (LDKOutboundHTLCStateDetails*)untag_ptr(orig); + uint32_t ret_conv = LDKOutboundHTLCStateDetails_to_js(OutboundHTLCStateDetails_clone(orig_conv)); + return ret_conv; } -uint64_t __attribute__((export_name("TS_BlindedFailure_read"))) TS_BlindedFailure_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_BlindedFailureDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedFailureDecodeErrorZ), "LDKCResult_BlindedFailureDecodeErrorZ"); - *ret_conv = BlindedFailure_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint32_t __attribute__((export_name("TS_OutboundHTLCStateDetails_awaiting_remote_revoke_to_add"))) TS_OutboundHTLCStateDetails_awaiting_remote_revoke_to_add() { + uint32_t ret_conv = LDKOutboundHTLCStateDetails_to_js(OutboundHTLCStateDetails_awaiting_remote_revoke_to_add()); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) { - LDKChannelManager 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 = ChannelManager_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_OutboundHTLCStateDetails_committed"))) TS_OutboundHTLCStateDetails_committed() { + uint32_t ret_conv = LDKOutboundHTLCStateDetails_to_js(OutboundHTLCStateDetails_committed()); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_ChannelShutdownState_write"))) TS_ChannelShutdownState_write(uint64_t obj) { - LDKChannelShutdownState* obj_conv = (LDKChannelShutdownState*)untag_ptr(obj); - LDKCVec_u8Z ret_var = ChannelShutdownState_write(obj_conv); +uint32_t __attribute__((export_name("TS_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success"))) TS_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success() { + uint32_t ret_conv = LDKOutboundHTLCStateDetails_to_js(OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_success()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure"))) TS_OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure() { + uint32_t ret_conv = LDKOutboundHTLCStateDetails_to_js(OutboundHTLCStateDetails_awaiting_remote_revoke_to_remove_failure()); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_OutboundHTLCStateDetails_write"))) TS_OutboundHTLCStateDetails_write(uint64_t obj) { + LDKOutboundHTLCStateDetails* obj_conv = (LDKOutboundHTLCStateDetails*)untag_ptr(obj); + LDKCVec_u8Z ret_var = OutboundHTLCStateDetails_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_ChannelShutdownState_read"))) TS_ChannelShutdownState_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_OutboundHTLCStateDetails_read"))) TS_OutboundHTLCStateDetails_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); - *ret_conv = ChannelShutdownState_read(ser_ref); + LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ), "LDKCResult_COption_OutboundHTLCStateDetailsZDecodeErrorZ"); + *ret_conv = OutboundHTLCStateDetails_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) { - LDKChannelManagerReadArgs this_obj_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_free"))) TS_OutboundHTLCDetails_free(uint64_t this_obj) { + LDKOutboundHTLCDetails 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); - ChannelManagerReadArgs_free(this_obj_conv); + OutboundHTLCDetails_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_entropy_source"))) TS_ChannelManagerReadArgs_get_entropy_source(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +uint64_t __attribute__((export_name("TS_OutboundHTLCDetails_get_htlc_id"))) TS_OutboundHTLCDetails_get_htlc_id(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_entropy_source(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = OutboundHTLCDetails_get_htlc_id(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_entropy_source"))) TS_ChannelManagerReadArgs_set_entropy_source(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_htlc_id"))) TS_OutboundHTLCDetails_set_htlc_id(uint64_t this_ptr, uint64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKEntropySource val_conv = *(LDKEntropySource*)(val_ptr); - if (val_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_entropy_source(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + OutboundHTLCDetails_set_htlc_id(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_node_signer"))) TS_ChannelManagerReadArgs_get_node_signer(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int64_t __attribute__((export_name("TS_OutboundHTLCDetails_get_amount_msat"))) TS_OutboundHTLCDetails_get_amount_msat(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_node_signer(&this_ptr_conv), false); - return ret_ret; + int64_t ret_conv = OutboundHTLCDetails_get_amount_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_node_signer"))) TS_ChannelManagerReadArgs_set_node_signer(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_amount_msat"))) TS_OutboundHTLCDetails_set_amount_msat(uint64_t this_ptr, int64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKNodeSigner val_conv = *(LDKNodeSigner*)(val_ptr); - if (val_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_node_signer(&this_ptr_conv, val_conv); + OutboundHTLCDetails_set_amount_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_signer_provider"))) TS_ChannelManagerReadArgs_get_signer_provider(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int32_t __attribute__((export_name("TS_OutboundHTLCDetails_get_cltv_expiry"))) TS_OutboundHTLCDetails_get_cltv_expiry(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_signer_provider(&this_ptr_conv), false); - return ret_ret; + int32_t ret_conv = OutboundHTLCDetails_get_cltv_expiry(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_signer_provider"))) TS_ChannelManagerReadArgs_set_signer_provider(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_cltv_expiry"))) TS_OutboundHTLCDetails_set_cltv_expiry(uint64_t this_ptr, int32_t val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKSignerProvider val_conv = *(LDKSignerProvider*)(val_ptr); - if (val_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_signer_provider(&this_ptr_conv, val_conv); + OutboundHTLCDetails_set_cltv_expiry(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +int8_tArray __attribute__((export_name("TS_OutboundHTLCDetails_get_payment_hash"))) TS_OutboundHTLCDetails_get_payment_hash(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false); - return ret_ret; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *OutboundHTLCDetails_get_payment_hash(&this_ptr_conv), 32); + return ret_arr; } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_payment_hash"))) TS_OutboundHTLCDetails_set_payment_hash(uint64_t this_ptr, int8_tArray val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr); - if (val_conv.free == LDKFeeEstimator_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKFeeEstimator_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + OutboundHTLCDetails_set_payment_hash(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +uint64_t __attribute__((export_name("TS_OutboundHTLCDetails_get_state"))) TS_OutboundHTLCDetails_get_state(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false); - return ret_ret; + LDKCOption_OutboundHTLCStateDetailsZ *ret_copy = MALLOC(sizeof(LDKCOption_OutboundHTLCStateDetailsZ), "LDKCOption_OutboundHTLCStateDetailsZ"); + *ret_copy = OutboundHTLCDetails_get_state(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_state"))) TS_OutboundHTLCDetails_set_state(uint64_t this_ptr, uint64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKWatch val_conv = *(LDKWatch*)(val_ptr); - if (val_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv); + LDKCOption_OutboundHTLCStateDetailsZ val_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(val_ptr); + val_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(val)); + OutboundHTLCDetails_set_state(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +uint64_t __attribute__((export_name("TS_OutboundHTLCDetails_get_skimmed_fee_msat"))) TS_OutboundHTLCDetails_get_skimmed_fee_msat(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = OutboundHTLCDetails_get_skimmed_fee_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_skimmed_fee_msat"))) TS_OutboundHTLCDetails_set_skimmed_fee_msat(uint64_t this_ptr, uint64_t val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr); - if (val_conv.free == LDKBroadcasterInterface_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKBroadcasterInterface_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_router"))) TS_ChannelManagerReadArgs_get_router(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_router(&this_ptr_conv), false); - return ret_ret; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + OutboundHTLCDetails_set_skimmed_fee_msat(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_router"))) TS_ChannelManagerReadArgs_set_router(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; +jboolean __attribute__((export_name("TS_OutboundHTLCDetails_get_is_dust"))) TS_OutboundHTLCDetails_get_is_dust(uint64_t this_ptr) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKRouter val_conv = *(LDKRouter*)(val_ptr); - if (val_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_router(&this_ptr_conv, val_conv); + jboolean ret_conv = OutboundHTLCDetails_get_is_dust(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; +void __attribute__((export_name("TS_OutboundHTLCDetails_set_is_dust"))) TS_OutboundHTLCDetails_set_is_dust(uint64_t this_ptr, jboolean val) { + LDKOutboundHTLCDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - // WARNING: This object doesn't live past this scope, needs clone! - uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false); - return ret_ret; + OutboundHTLCDetails_set_is_dust(&this_ptr_conv, val); } -void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - void* val_ptr = untag_ptr(val); - CHECK_ACCESS(val_ptr); - LDKLogger val_conv = *(LDKLogger*)(val_ptr); - if (val_conv.free == LDKLogger_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKLogger_JCalls_cloned(&val_conv); - } - ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv); +uint64_t __attribute__((export_name("TS_OutboundHTLCDetails_new"))) TS_OutboundHTLCDetails_new(uint64_t htlc_id_arg, int64_t amount_msat_arg, int32_t cltv_expiry_arg, int8_tArray payment_hash_arg, uint64_t state_arg, uint64_t skimmed_fee_msat_arg, jboolean is_dust_arg) { + void* htlc_id_arg_ptr = untag_ptr(htlc_id_arg); + CHECK_ACCESS(htlc_id_arg_ptr); + LDKCOption_u64Z htlc_id_arg_conv = *(LDKCOption_u64Z*)(htlc_id_arg_ptr); + htlc_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_id_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* state_arg_ptr = untag_ptr(state_arg); + CHECK_ACCESS(state_arg_ptr); + LDKCOption_OutboundHTLCStateDetailsZ state_arg_conv = *(LDKCOption_OutboundHTLCStateDetailsZ*)(state_arg_ptr); + state_arg_conv = COption_OutboundHTLCStateDetailsZ_clone((LDKCOption_OutboundHTLCStateDetailsZ*)untag_ptr(state_arg)); + void* skimmed_fee_msat_arg_ptr = untag_ptr(skimmed_fee_msat_arg); + CHECK_ACCESS(skimmed_fee_msat_arg_ptr); + LDKCOption_u64Z skimmed_fee_msat_arg_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_arg_ptr); + skimmed_fee_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_msat_arg)); + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_new(htlc_id_arg_conv, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, state_arg_conv, skimmed_fee_msat_arg_conv, is_dust_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_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) { - LDKChannelManagerReadArgs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv); +static inline uint64_t OutboundHTLCDetails_clone_ptr(LDKOutboundHTLCDetails *NONNULL_PTR arg) { + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_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_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) { - LDKChannelManagerReadArgs this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKUserConfig 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 = UserConfig_clone(&val_conv); - ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv); +int64_t __attribute__((export_name("TS_OutboundHTLCDetails_clone_ptr"))) TS_OutboundHTLCDetails_clone_ptr(uint64_t arg) { + LDKOutboundHTLCDetails 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 = OutboundHTLCDetails_clone_ptr(&arg_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_new"))) TS_ChannelManagerReadArgs_new(uint64_t entropy_source, uint64_t node_signer, uint64_t signer_provider, uint64_t fee_estimator, uint64_t chain_monitor, uint64_t tx_broadcaster, uint64_t router, uint64_t logger, uint64_t default_config, uint64_tArray channel_monitors) { - void* entropy_source_ptr = untag_ptr(entropy_source); - CHECK_ACCESS(entropy_source_ptr); - LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); - if (entropy_source_conv.free == LDKEntropySource_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKEntropySource_JCalls_cloned(&entropy_source_conv); - } - void* node_signer_ptr = untag_ptr(node_signer); - CHECK_ACCESS(node_signer_ptr); - LDKNodeSigner node_signer_conv = *(LDKNodeSigner*)(node_signer_ptr); - if (node_signer_conv.free == LDKNodeSigner_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKNodeSigner_JCalls_cloned(&node_signer_conv); - } - void* signer_provider_ptr = untag_ptr(signer_provider); - CHECK_ACCESS(signer_provider_ptr); - LDKSignerProvider signer_provider_conv = *(LDKSignerProvider*)(signer_provider_ptr); - if (signer_provider_conv.free == LDKSignerProvider_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKSignerProvider_JCalls_cloned(&signer_provider_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* chain_monitor_ptr = untag_ptr(chain_monitor); - CHECK_ACCESS(chain_monitor_ptr); - LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr); - if (chain_monitor_conv.free == LDKWatch_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKWatch_JCalls_cloned(&chain_monitor_conv); - } - void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster); - CHECK_ACCESS(tx_broadcaster_ptr); - LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr); - if (tx_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(&tx_broadcaster_conv); - } - void* router_ptr = untag_ptr(router); - CHECK_ACCESS(router_ptr); - LDKRouter router_conv = *(LDKRouter*)(router_ptr); - if (router_conv.free == LDKRouter_JCalls_free) { - // If this_arg is a JCalls struct, then we need to increment the refcnt in it. - LDKRouter_JCalls_cloned(&router_conv); - } - void* logger_ptr = untag_ptr(logger); - CHECK_ACCESS(logger_ptr); - LDKLogger logger_conv = *(LDKLogger*)(logger_ptr); - if (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); - } - LDKUserConfig default_config_conv; - default_config_conv.inner = untag_ptr(default_config); - default_config_conv.is_owned = ptr_is_owned(default_config); - CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv); - default_config_conv = UserConfig_clone(&default_config_conv); - LDKCVec_ChannelMonitorZ channel_monitors_constr; - channel_monitors_constr.datalen = channel_monitors->arr_len; - if (channel_monitors_constr.datalen > 0) - channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements"); - else - channel_monitors_constr.data = NULL; - uint64_t* channel_monitors_vals = channel_monitors->elems; - for (size_t q = 0; q < channel_monitors_constr.datalen; q++) { - uint64_t channel_monitors_conv_16 = channel_monitors_vals[q]; - LDKChannelMonitor channel_monitors_conv_16_conv; - channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16); - channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv); - channel_monitors_conv_16_conv.is_owned = false; - channel_monitors_constr.data[q] = channel_monitors_conv_16_conv; - } - FREE(channel_monitors); - LDKChannelManagerReadArgs ret_var = ChannelManagerReadArgs_new(entropy_source_conv, node_signer_conv, signer_provider_conv, fee_estimator_conv, chain_monitor_conv, tx_broadcaster_conv, router_conv, logger_conv, default_config_conv, channel_monitors_constr); +uint64_t __attribute__((export_name("TS_OutboundHTLCDetails_clone"))) TS_OutboundHTLCDetails_clone(uint64_t orig) { + LDKOutboundHTLCDetails 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; + LDKOutboundHTLCDetails ret_var = OutboundHTLCDetails_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_C2Tuple_ThirtyTwoBytesChannelManagerZ_read"))) TS_C2Tuple_ThirtyTwoBytesChannelManagerZ_read(int8_tArray ser, uint64_t arg) { +int8_tArray __attribute__((export_name("TS_OutboundHTLCDetails_write"))) TS_OutboundHTLCDetails_write(uint64_t obj) { + LDKOutboundHTLCDetails 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 = OutboundHTLCDetails_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_OutboundHTLCDetails_read"))) TS_OutboundHTLCDetails_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKChannelManagerReadArgs arg_conv; - arg_conv.inner = untag_ptr(arg); - arg_conv.is_owned = ptr_is_owned(arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv); - // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs - - LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ"); - *ret_conv = C2Tuple_ThirtyTwoBytesChannelManagerZ_read(ser_ref, arg_conv); + LDKCResult_OutboundHTLCDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutboundHTLCDetailsDecodeErrorZ), "LDKCResult_OutboundHTLCDetailsDecodeErrorZ"); + *ret_conv = OutboundHTLCDetails_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_DelayedPaymentBasepoint_free"))) TS_DelayedPaymentBasepoint_free(uint64_t this_obj) { - LDKDelayedPaymentBasepoint this_obj_conv; +void __attribute__((export_name("TS_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) { + LDKCounterpartyForwardingInfo 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); - DelayedPaymentBasepoint_free(this_obj_conv); + CounterpartyForwardingInfo_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_get_a"))) TS_DelayedPaymentBasepoint_get_a(uint64_t this_ptr) { - LDKDelayedPaymentBasepoint this_ptr_conv; +int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, DelayedPaymentBasepoint_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_DelayedPaymentBasepoint_set_a"))) TS_DelayedPaymentBasepoint_set_a(uint64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentBasepoint this_ptr_conv; +void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - DelayedPaymentBasepoint_set_a(&this_ptr_conv, val_ref); + CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_DelayedPaymentBasepoint_new"))) TS_DelayedPaymentBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_new(a_arg_ref); +int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val); +} + +int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) { + LDKCounterpartyForwardingInfo this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_new"))) TS_CounterpartyForwardingInfo_new(int32_t fee_base_msat_arg, int32_t fee_proportional_millionths_arg, int16_t cltv_expiry_delta_arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_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; } -jboolean __attribute__((export_name("TS_DelayedPaymentBasepoint_eq"))) TS_DelayedPaymentBasepoint_eq(uint64_t a, uint64_t b) { - LDKDelayedPaymentBasepoint 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; - LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t DelayedPaymentBasepoint_clone_ptr(LDKDelayedPaymentBasepoint *NONNULL_PTR arg) { - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(arg); +static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) { + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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_DelayedPaymentBasepoint_clone_ptr"))) TS_DelayedPaymentBasepoint_clone_ptr(uint64_t arg) { - LDKDelayedPaymentBasepoint arg_conv; +int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) { + LDKCounterpartyForwardingInfo 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 = DelayedPaymentBasepoint_clone_ptr(&arg_conv); + int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_DelayedPaymentBasepoint_clone"))) TS_DelayedPaymentBasepoint_clone(uint64_t orig) { - LDKDelayedPaymentBasepoint orig_conv; +uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) { + LDKCounterpartyForwardingInfo 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; - LDKDelayedPaymentBasepoint ret_var = DelayedPaymentBasepoint_clone(&orig_conv); + LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_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_DelayedPaymentBasepoint_hash"))) TS_DelayedPaymentBasepoint_hash(uint64_t o) { - LDKDelayedPaymentBasepoint 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 = DelayedPaymentBasepoint_hash(&o_conv); - return ret_conv; -} - -int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_to_public_key"))) TS_DelayedPaymentBasepoint_to_public_key(uint64_t this_arg) { - LDKDelayedPaymentBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, DelayedPaymentBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray __attribute__((export_name("TS_DelayedPaymentBasepoint_write"))) TS_DelayedPaymentBasepoint_write(uint64_t obj) { - LDKDelayedPaymentBasepoint obj_conv; +int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) { + LDKCounterpartyForwardingInfo 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 = DelayedPaymentBasepoint_write(&obj_conv); + LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_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_DelayedPaymentBasepoint_read"))) TS_DelayedPaymentBasepoint_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentBasepointDecodeErrorZ), "LDKCResult_DelayedPaymentBasepointDecodeErrorZ"); - *ret_conv = DelayedPaymentBasepoint_read(ser_ref); + LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ"); + *ret_conv = CounterpartyForwardingInfo_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_DelayedPaymentKey_free"))) TS_DelayedPaymentKey_free(uint64_t this_obj) { - LDKDelayedPaymentKey this_obj_conv; +void __attribute__((export_name("TS_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) { + LDKChannelCounterparty 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); - DelayedPaymentKey_free(this_obj_conv); + ChannelCounterparty_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_DelayedPaymentKey_get_a"))) TS_DelayedPaymentKey_get_a(uint64_t this_ptr) { - LDKDelayedPaymentKey this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, DelayedPaymentKey_get_a(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_DelayedPaymentKey_set_a"))) TS_DelayedPaymentKey_set_a(uint64_t this_ptr, int8_tArray val) { - LDKDelayedPaymentKey this_ptr_conv; +void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) { + LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -39791,2231 +44582,2166 @@ void __attribute__((export_name("TS_DelayedPaymentKey_set_a"))) TS_DelayedPayme LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - DelayedPaymentKey_set_a(&this_ptr_conv, val_ref); + ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_DelayedPaymentKey_new"))) TS_DelayedPaymentKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_new(a_arg_ref); +uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures ret_var = ChannelCounterparty_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_DelayedPaymentKey_eq"))) TS_DelayedPaymentKey_eq(uint64_t a, uint64_t b) { - LDKDelayedPaymentKey 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; - LDKDelayedPaymentKey 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 = DelayedPaymentKey_eq(&a_conv, &b_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures 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 = InitFeatures_clone(&val_conv); + ChannelCounterparty_set_features(&this_ptr_conv, val_conv); } -static inline uint64_t DelayedPaymentKey_clone_ptr(LDKDelayedPaymentKey *NONNULL_PTR arg) { - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_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_DelayedPaymentKey_clone_ptr"))) TS_DelayedPaymentKey_clone_ptr(uint64_t arg) { - LDKDelayedPaymentKey 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 = DelayedPaymentKey_clone_ptr(&arg_conv); +int64_t __attribute__((export_name("TS_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_DelayedPaymentKey_clone"))) TS_DelayedPaymentKey_clone(uint64_t orig) { - LDKDelayedPaymentKey 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; - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_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_DelayedPaymentKey_from_basepoint"))) TS_DelayedPaymentKey_from_basepoint(uint64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKDelayedPaymentBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - 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); - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_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_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_DelayedPaymentKey_from_secret_key"))) TS_DelayedPaymentKey_from_secret_key(int8_tArray sk) { - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKDelayedPaymentKey ret_var = DelayedPaymentKey_from_secret_key(sk_ref); +uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_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; } -int8_tArray __attribute__((export_name("TS_DelayedPaymentKey_to_public_key"))) TS_DelayedPaymentKey_to_public_key(uint64_t this_arg) { - LDKDelayedPaymentKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, DelayedPaymentKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray __attribute__((export_name("TS_DelayedPaymentKey_write"))) TS_DelayedPaymentKey_write(uint64_t obj) { - LDKDelayedPaymentKey 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 = DelayedPaymentKey_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_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCounterpartyForwardingInfo 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 = CounterpartyForwardingInfo_clone(&val_conv); + ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_DelayedPaymentKey_read"))) TS_DelayedPaymentKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_DelayedPaymentKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentKeyDecodeErrorZ), "LDKCResult_DelayedPaymentKeyDecodeErrorZ"); - *ret_conv = DelayedPaymentKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_HtlcBasepoint_free"))) TS_HtlcBasepoint_free(uint64_t this_obj) { - LDKHtlcBasepoint 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); - HtlcBasepoint_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelCounterparty_set_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_set_outbound_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) { + LDKChannelCounterparty this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_HtlcBasepoint_get_a"))) TS_HtlcBasepoint_get_a(uint64_t this_ptr) { - LDKHtlcBasepoint this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) { + LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, HtlcBasepoint_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_HtlcBasepoint_set_a"))) TS_HtlcBasepoint_set_a(uint64_t this_ptr, int8_tArray val) { - LDKHtlcBasepoint this_ptr_conv; +void __attribute__((export_name("TS_ChannelCounterparty_set_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_set_outbound_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) { + LDKChannelCounterparty this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - HtlcBasepoint_set_a(&this_ptr_conv, val_ref); + 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)); + ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_HtlcBasepoint_new"))) TS_HtlcBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKHtlcBasepoint ret_var = HtlcBasepoint_new(a_arg_ref); +uint64_t __attribute__((export_name("TS_ChannelCounterparty_new"))) TS_ChannelCounterparty_new(int8_tArray node_id_arg, uint64_t features_arg, int64_t unspendable_punishment_reserve_arg, uint64_t forwarding_info_arg, uint64_t outbound_htlc_minimum_msat_arg, uint64_t outbound_htlc_maximum_msat_arg) { + LDKPublicKey node_id_arg_ref; + CHECK(node_id_arg->arr_len == 33); + memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg); + LDKInitFeatures 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 = InitFeatures_clone(&features_arg_conv); + LDKCounterpartyForwardingInfo forwarding_info_arg_conv; + forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg); + forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv); + forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv); + void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg); + CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr); + outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg)); + void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg); + CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr); + outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg)); + LDKChannelCounterparty ret_var = ChannelCounterparty_new(node_id_arg_ref, features_arg_conv, unspendable_punishment_reserve_arg, forwarding_info_arg_conv, outbound_htlc_minimum_msat_arg_conv, outbound_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; } -jboolean __attribute__((export_name("TS_HtlcBasepoint_eq"))) TS_HtlcBasepoint_eq(uint64_t a, uint64_t b) { - LDKHtlcBasepoint 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; - LDKHtlcBasepoint 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 = HtlcBasepoint_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t HtlcBasepoint_clone_ptr(LDKHtlcBasepoint *NONNULL_PTR arg) { - LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(arg); +static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) { + LDKChannelCounterparty ret_var = ChannelCounterparty_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_HtlcBasepoint_clone_ptr"))) TS_HtlcBasepoint_clone_ptr(uint64_t arg) { - LDKHtlcBasepoint arg_conv; +int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) { + LDKChannelCounterparty 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 = HtlcBasepoint_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_HtlcBasepoint_clone"))) TS_HtlcBasepoint_clone(uint64_t orig) { - LDKHtlcBasepoint orig_conv; +uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) { + LDKChannelCounterparty 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; - LDKHtlcBasepoint ret_var = HtlcBasepoint_clone(&orig_conv); + LDKChannelCounterparty ret_var = ChannelCounterparty_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_HtlcBasepoint_hash"))) TS_HtlcBasepoint_hash(uint64_t o) { - LDKHtlcBasepoint 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 = HtlcBasepoint_hash(&o_conv); - return ret_conv; -} - -int8_tArray __attribute__((export_name("TS_HtlcBasepoint_to_public_key"))) TS_HtlcBasepoint_to_public_key(uint64_t this_arg) { - LDKHtlcBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, HtlcBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray __attribute__((export_name("TS_HtlcBasepoint_write"))) TS_HtlcBasepoint_write(uint64_t obj) { - LDKHtlcBasepoint obj_conv; +int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) { + LDKChannelCounterparty 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 = HtlcBasepoint_write(&obj_conv); + LDKCVec_u8Z ret_var = ChannelCounterparty_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_HtlcBasepoint_read"))) TS_HtlcBasepoint_read(int8_tArray ser) { +uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) { LDKu8slice ser_ref; ser_ref.datalen = ser->arr_len; ser_ref.data = ser->elems; - LDKCResult_HtlcBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcBasepointDecodeErrorZ), "LDKCResult_HtlcBasepointDecodeErrorZ"); - *ret_conv = HtlcBasepoint_read(ser_ref); + LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ"); + *ret_conv = ChannelCounterparty_read(ser_ref); FREE(ser); return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_HtlcKey_free"))) TS_HtlcKey_free(uint64_t this_obj) { - LDKHtlcKey this_obj_conv; +void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) { + LDKChannelDetails 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); - HtlcKey_free(this_obj_conv); + ChannelDetails_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_HtlcKey_get_a"))) TS_HtlcKey_get_a(uint64_t this_ptr) { - LDKHtlcKey this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, HtlcKey_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_HtlcKey_set_a"))) TS_HtlcKey_set_a(uint64_t this_ptr, int8_tArray val) { - LDKHtlcKey this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - HtlcKey_set_a(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + ChannelDetails_set_channel_id(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_HtlcKey_new"))) TS_HtlcKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKHtlcKey ret_var = HtlcKey_new(a_arg_ref); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(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; + LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&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_HtlcKey_eq"))) TS_HtlcKey_eq(uint64_t a, uint64_t b) { - LDKHtlcKey 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; - LDKHtlcKey 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 = HtlcKey_eq(&a_conv, &b_conv); - return ret_conv; -} - -static inline uint64_t HtlcKey_clone_ptr(LDKHtlcKey *NONNULL_PTR arg) { - LDKHtlcKey ret_var = HtlcKey_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_HtlcKey_clone_ptr"))) TS_HtlcKey_clone_ptr(uint64_t arg) { - LDKHtlcKey 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 = HtlcKey_clone_ptr(&arg_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(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; + LDKChannelCounterparty 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 = ChannelCounterparty_clone(&val_conv); + ChannelDetails_set_counterparty(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_HtlcKey_clone"))) TS_HtlcKey_clone(uint64_t orig) { - LDKHtlcKey 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; - LDKHtlcKey ret_var = HtlcKey_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(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; + LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&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_HtlcKey_from_basepoint"))) TS_HtlcKey_from_basepoint(uint64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKHtlcBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - 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); - LDKHtlcKey ret_var = HtlcKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_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_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(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; + 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); + ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_HtlcKey_from_secret_key"))) TS_HtlcKey_from_secret_key(int8_tArray sk) { - uint8_t sk_arr[32]; - CHECK(sk->arr_len == 32); - memcpy(sk_arr, sk->elems, 32); FREE(sk); - uint8_t (*sk_ref)[32] = &sk_arr; - LDKHtlcKey ret_var = HtlcKey_from_secret_key(sk_ref); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(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; + LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&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_tArray __attribute__((export_name("TS_HtlcKey_to_public_key"))) TS_HtlcKey_to_public_key(uint64_t this_arg) { - LDKHtlcKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, HtlcKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray __attribute__((export_name("TS_HtlcKey_write"))) TS_HtlcKey_write(uint64_t obj) { - LDKHtlcKey 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 = HtlcKey_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_HtlcKey_read"))) TS_HtlcKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_HtlcKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HtlcKeyDecodeErrorZ), "LDKCResult_HtlcKeyDecodeErrorZ"); - *ret_conv = HtlcKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(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; + LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone(&val_conv); + ChannelDetails_set_channel_type(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_RevocationBasepoint_free"))) TS_RevocationBasepoint_free(uint64_t this_obj) { - LDKRevocationBasepoint 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); - RevocationBasepoint_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray __attribute__((export_name("TS_RevocationBasepoint_get_a"))) TS_RevocationBasepoint_get_a(uint64_t this_ptr) { - LDKRevocationBasepoint this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(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; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationBasepoint_get_a(&this_ptr_conv).compressed_form, 33); - return ret_arr; + 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)); + ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_RevocationBasepoint_set_a"))) TS_RevocationBasepoint_set_a(uint64_t this_ptr, int8_tArray val) { - LDKRevocationBasepoint this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(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; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RevocationBasepoint_set_a(&this_ptr_conv, val_ref); -} - -uint64_t __attribute__((export_name("TS_RevocationBasepoint_new"))) TS_RevocationBasepoint_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKRevocationBasepoint ret_var = RevocationBasepoint_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); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -jboolean __attribute__((export_name("TS_RevocationBasepoint_eq"))) TS_RevocationBasepoint_eq(uint64_t a, uint64_t b) { - LDKRevocationBasepoint 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; - LDKRevocationBasepoint 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 = RevocationBasepoint_eq(&a_conv, &b_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv); } -static inline uint64_t RevocationBasepoint_clone_ptr(LDKRevocationBasepoint *NONNULL_PTR arg) { - LDKRevocationBasepoint ret_var = RevocationBasepoint_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_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_RevocationBasepoint_clone_ptr"))) TS_RevocationBasepoint_clone_ptr(uint64_t arg) { - LDKRevocationBasepoint 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 = RevocationBasepoint_clone_ptr(&arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_RevocationBasepoint_clone"))) TS_RevocationBasepoint_clone(uint64_t orig) { - LDKRevocationBasepoint 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; - LDKRevocationBasepoint ret_var = RevocationBasepoint_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_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv); } -int64_t __attribute__((export_name("TS_RevocationBasepoint_hash"))) TS_RevocationBasepoint_hash(uint64_t o) { - LDKRevocationBasepoint 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 = RevocationBasepoint_hash(&o_conv); +int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv); return ret_conv; } -int8_tArray __attribute__((export_name("TS_RevocationBasepoint_to_public_key"))) TS_RevocationBasepoint_to_public_key(uint64_t this_arg) { - LDKRevocationBasepoint this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, RevocationBasepoint_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; -} - -int8_tArray __attribute__((export_name("TS_RevocationBasepoint_write"))) TS_RevocationBasepoint_write(uint64_t obj) { - LDKRevocationBasepoint 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 = RevocationBasepoint_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_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_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; + ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_RevocationBasepoint_read"))) TS_RevocationBasepoint_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RevocationBasepointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationBasepointDecodeErrorZ), "LDKCResult_RevocationBasepointDecodeErrorZ"); - *ret_conv = RevocationBasepoint_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_RevocationKey_free"))) TS_RevocationKey_free(uint64_t this_obj) { - LDKRevocationKey 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); - RevocationKey_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(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_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_RevocationKey_get_a"))) TS_RevocationKey_get_a(uint64_t this_ptr) { - LDKRevocationKey this_ptr_conv; +int8_tArray __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - int8_tArray ret_arr = init_int8_tArray(33, __LINE__); - memcpy(ret_arr->elems, RevocationKey_get_a(&this_ptr_conv).compressed_form, 33); + int8_tArray ret_arr = init_int8_tArray(16, __LINE__); + memcpy(ret_arr->elems, ChannelDetails_get_user_channel_id(&this_ptr_conv).le_bytes, 16); return ret_arr; } -void __attribute__((export_name("TS_RevocationKey_set_a"))) TS_RevocationKey_set_a(uint64_t this_ptr, int8_tArray val) { - LDKRevocationKey this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int8_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKPublicKey val_ref; - CHECK(val->arr_len == 33); - memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - RevocationKey_set_a(&this_ptr_conv, val_ref); + LDKU128 val_ref; + CHECK(val->arr_len == 16); + memcpy(val_ref.le_bytes, val->elems, 16); FREE(val); + ChannelDetails_set_user_channel_id(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_RevocationKey_new"))) TS_RevocationKey_new(int8_tArray a_arg) { - LDKPublicKey a_arg_ref; - CHECK(a_arg->arr_len == 33); - memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg); - LDKRevocationKey ret_var = RevocationKey_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); +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; } -jboolean __attribute__((export_name("TS_RevocationKey_eq"))) TS_RevocationKey_eq(uint64_t a, uint64_t b) { - LDKRevocationKey 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; - LDKRevocationKey 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 = RevocationKey_eq(&a_conv, &b_conv); - return ret_conv; +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); } -static inline uint64_t RevocationKey_clone_ptr(LDKRevocationKey *NONNULL_PTR arg) { - LDKRevocationKey ret_var = RevocationKey_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_RevocationKey_clone_ptr"))) TS_RevocationKey_clone_ptr(uint64_t arg) { - LDKRevocationKey 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 = RevocationKey_clone_ptr(&arg_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); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_RevocationKey_clone"))) TS_RevocationKey_clone(uint64_t orig) { - LDKRevocationKey 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; - LDKRevocationKey ret_var = RevocationKey_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_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_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; + ChannelDetails_set_balance_msat(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_RevocationKey_hash"))) TS_RevocationKey_hash(uint64_t o) { - LDKRevocationKey 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 = RevocationKey_hash(&o_conv); +int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_RevocationKey_from_basepoint"))) TS_RevocationKey_from_basepoint(uint64_t countersignatory_basepoint, int8_tArray per_commitment_point) { - LDKRevocationBasepoint countersignatory_basepoint_conv; - countersignatory_basepoint_conv.inner = untag_ptr(countersignatory_basepoint); - countersignatory_basepoint_conv.is_owned = ptr_is_owned(countersignatory_basepoint); - CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_basepoint_conv); - countersignatory_basepoint_conv.is_owned = false; - 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); - LDKRevocationKey ret_var = RevocationKey_from_basepoint(&countersignatory_basepoint_conv, per_commitment_point_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_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_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; + ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_RevocationKey_to_public_key"))) TS_RevocationKey_to_public_key(uint64_t this_arg) { - LDKRevocationKey this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_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, RevocationKey_to_public_key(&this_arg_conv).compressed_form, 33); - return ret_arr; +int64_t __attribute__((export_name("TS_ChannelDetails_get_next_outbound_htlc_limit_msat"))) TS_ChannelDetails_get_next_outbound_htlc_limit_msat(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_RevocationKey_write"))) TS_RevocationKey_write(uint64_t obj) { - LDKRevocationKey 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 = RevocationKey_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_ChannelDetails_set_next_outbound_htlc_limit_msat"))) TS_ChannelDetails_set_next_outbound_htlc_limit_msat(uint64_t this_ptr, int64_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; + ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_RevocationKey_read"))) TS_RevocationKey_read(int8_tArray ser) { - LDKu8slice ser_ref; - ser_ref.datalen = ser->arr_len; - ser_ref.data = ser->elems; - LDKCResult_RevocationKeyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevocationKeyDecodeErrorZ), "LDKCResult_RevocationKeyDecodeErrorZ"); - *ret_conv = RevocationKey_read(ser_ref); - FREE(ser); - return tag_ptr(ret_conv, true); +int64_t __attribute__((export_name("TS_ChannelDetails_get_next_outbound_htlc_minimum_msat"))) TS_ChannelDetails_get_next_outbound_htlc_minimum_msat(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_minimum_msat(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) { - LDKExpandedKey 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); - ExpandedKey_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelDetails_set_next_outbound_htlc_minimum_msat"))) TS_ChannelDetails_set_next_outbound_htlc_minimum_msat(uint64_t this_ptr, int64_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; + ChannelDetails_set_next_outbound_htlc_minimum_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) { - uint8_t key_material_arr[32]; - CHECK(key_material->arr_len == 32); - memcpy(key_material_arr, key_material->elems, 32); FREE(key_material); - uint8_t (*key_material_ref)[32] = &key_material_arr; - LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref); - uint64_t ret_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); - ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); - return ret_ref; +int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_create"))) TS_create(uint64_t keys, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t entropy_source, int64_t current_time, uint64_t min_final_cltv_expiry_delta) { - LDKExpandedKey keys_conv; - keys_conv.inner = untag_ptr(keys); - keys_conv.is_owned = ptr_is_owned(keys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); - keys_conv.is_owned = false; - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - void* entropy_source_ptr = untag_ptr(entropy_source); - if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } - LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); - *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, entropy_source_conv, current_time, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); +void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_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; + ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_create_from_hash"))) TS_create_from_hash(uint64_t keys, uint64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time, uint64_t min_final_cltv_expiry_delta) { - LDKExpandedKey keys_conv; - keys_conv.inner = untag_ptr(keys); - keys_conv.is_owned = ptr_is_owned(keys); - CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); - keys_conv.is_owned = false; - void* min_value_msat_ptr = untag_ptr(min_value_msat); - CHECK_ACCESS(min_value_msat_ptr); - LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); - min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); - LDKThirtyTwoBytes payment_hash_ref; - CHECK(payment_hash->arr_len == 32); - memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); - void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); - CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); - LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); - min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); - LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); - *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta_conv); - return tag_ptr(ret_conv, true); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_ptr) { - if (!ptr_is_owned(this_ptr)) return; - void* this_ptr_ptr = untag_ptr(this_ptr); - CHECK_ACCESS(this_ptr_ptr); - LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr); - FREE(untag_ptr(this_ptr)); - DecodeError_free(this_ptr_conv); +void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv); } -static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_clone(arg); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations"))) TS_ChannelDetails_get_confirmations(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z"); + *ret_copy = ChannelDetails_get_confirmations(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) { - LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg); - int64_t ret_conv = DecodeError_clone_ptr(arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) { - LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_clone(orig_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelDetails_set_confirmations"))) TS_ChannelDetails_set_confirmations(uint64_t this_ptr, uint64_t val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr); + val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val)); + ChannelDetails_set_confirmations(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_DecodeError_unknown_version"))) TS_DecodeError_unknown_version() { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_unknown_version(); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z"); + *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_DecodeError_unknown_required_feature"))) TS_DecodeError_unknown_required_feature() { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_unknown_required_feature(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelDetails_set_force_close_spend_delay"))) TS_ChannelDetails_set_force_close_spend_delay(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_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr); + val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val)); + ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_DecodeError_invalid_value"))) TS_DecodeError_invalid_value() { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_invalid_value(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(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; + jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_DecodeError_short_read"))) TS_DecodeError_short_read() { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_short_read(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_is_outbound(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_DecodeError_bad_length_descriptor"))) TS_DecodeError_bad_length_descriptor() { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_bad_length_descriptor(); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(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; + jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv); + return ret_conv; } -uint64_t __attribute__((export_name("TS_DecodeError_io"))) TS_DecodeError_io(uint32_t a) { - LDKIOError a_conv = LDKIOError_from_js(a); - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_io(a_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_is_channel_ready(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_DecodeError_unsupported_compression"))) TS_DecodeError_unsupported_compression() { - LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = DecodeError_unsupported_compression(); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_shutdown_state"))) TS_ChannelDetails_get_channel_shutdown_state(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_ChannelShutdownStateZ *ret_copy = MALLOC(sizeof(LDKCOption_ChannelShutdownStateZ), "LDKCOption_ChannelShutdownStateZ"); + *ret_copy = ChannelDetails_get_channel_shutdown_state(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_DecodeError_hash"))) TS_DecodeError_hash(uint64_t o) { - LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); - int64_t ret_conv = DecodeError_hash(o_conv); - return ret_conv; +void __attribute__((export_name("TS_ChannelDetails_set_channel_shutdown_state"))) TS_ChannelDetails_set_channel_shutdown_state(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_ChannelShutdownStateZ val_conv = *(LDKCOption_ChannelShutdownStateZ*)(val_ptr); + val_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(val)); + ChannelDetails_set_channel_shutdown_state(&this_ptr_conv, val_conv); } -jboolean __attribute__((export_name("TS_DecodeError_eq"))) TS_DecodeError_eq(uint64_t a, uint64_t b) { - LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a); - LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b); - jboolean ret_conv = DecodeError_eq(a_conv, b_conv); +jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(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; + jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) { - LDKInit this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Init_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) { + LDKChannelDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + ChannelDetails_set_is_usable(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) { - LDKInit this_ptr_conv; +jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(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; - LDKInitFeatures ret_var = Init_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 ret_conv = ChannelDetails_get_is_public(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) { - LDKInit this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean 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; - LDKInitFeatures 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 = InitFeatures_clone(&val_conv); - Init_set_features(&this_ptr_conv, val_conv); + ChannelDetails_set_is_public(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_Init_get_networks"))) TS_Init_get_networks(uint64_t this_ptr) { - LDKInit this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(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_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); - *ret_copy = Init_get_networks(&this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_Init_set_networks"))) TS_Init_set_networks(uint64_t this_ptr, uint64_t val) { - LDKInit this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_inbound_htlc_minimum_msat"))) TS_ChannelDetails_set_inbound_htlc_minimum_msat(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_CVec_ThirtyTwoBytesZZ val_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(val_ptr); - val_conv = COption_CVec_ThirtyTwoBytesZZ_clone((LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(val)); - Init_set_networks(&this_ptr_conv, val_conv); + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) { - LDKInit this_ptr_conv; +uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(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_SocketAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_SocketAddressZ), "LDKCOption_SocketAddressZ"); - *ret_copy = Init_get_remote_network_address(&this_ptr_conv); + LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) { - LDKInit this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_inbound_htlc_maximum_msat"))) TS_ChannelDetails_set_inbound_htlc_maximum_msat(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_SocketAddressZ val_conv = *(LDKCOption_SocketAddressZ*)(val_ptr); - val_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(val)); - Init_set_remote_network_address(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t networks_arg, uint64_t remote_network_address_arg) { - LDKInitFeatures 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 = InitFeatures_clone(&features_arg_conv); - void* networks_arg_ptr = untag_ptr(networks_arg); - CHECK_ACCESS(networks_arg_ptr); - LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(networks_arg_ptr); - networks_arg_conv = COption_CVec_ThirtyTwoBytesZZ_clone((LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(networks_arg)); - void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg); - CHECK_ACCESS(remote_network_address_arg_ptr); - LDKCOption_SocketAddressZ remote_network_address_arg_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_arg_ptr); - LDKInit ret_var = Init_new(features_arg_conv, networks_arg_conv, remote_network_address_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 Init_clone_ptr(LDKInit *NONNULL_PTR arg) { - LDKInit ret_var = Init_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_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) { - LDKInit 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 = Init_clone_ptr(&arg_conv); - return ret_conv; + LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr); + val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val)); + ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) { - LDKInit 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; - LDKInit ret_var = Init_clone(&orig_conv); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(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; + LDKChannelConfig ret_var = ChannelDetails_get_config(&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_Init_hash"))) TS_Init_hash(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.is_owned = false; - int64_t ret_conv = Init_hash(&o_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_Init_eq"))) TS_Init_eq(uint64_t a, uint64_t b) { - LDKInit a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKInit b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Init_eq(&a_conv, &b_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) { - LDKErrorMessage this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - ErrorMessage_free(this_obj_conv); +void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(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; + LDKChannelConfig 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 = ChannelConfig_clone(&val_conv); + ChannelDetails_set_config(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) { - LDKErrorMessage this_ptr_conv; +uint64_tArray __attribute__((export_name("TS_ChannelDetails_get_pending_inbound_htlcs"))) TS_ChannelDetails_get_pending_inbound_htlcs(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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32); + LDKCVec_InboundHTLCDetailsZ ret_var = ChannelDetails_get_pending_inbound_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 u = 0; u < ret_var.datalen; u++) { + LDKInboundHTLCDetails ret_conv_20_var = ret_var.data[u]; + uint64_t ret_conv_20_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_20_var); + ret_conv_20_ref = tag_ptr(ret_conv_20_var.inner, ret_conv_20_var.is_owned); + ret_arr_ptr[u] = ret_conv_20_ref; + } + + FREE(ret_var.data); return ret_arr; } -void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKErrorMessage this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_pending_inbound_htlcs"))) TS_ChannelDetails_set_pending_inbound_htlcs(uint64_t this_ptr, uint64_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKThirtyTwoBytes val_ref; - CHECK(val->arr_len == 32); - memcpy(val_ref.data, val->elems, 32); FREE(val); - ErrorMessage_set_channel_id(&this_ptr_conv, val_ref); + LDKCVec_InboundHTLCDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t u = 0; u < val_constr.datalen; u++) { + uint64_t val_conv_20 = val_vals[u]; + LDKInboundHTLCDetails val_conv_20_conv; + val_conv_20_conv.inner = untag_ptr(val_conv_20); + val_conv_20_conv.is_owned = ptr_is_owned(val_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_20_conv); + val_conv_20_conv = InboundHTLCDetails_clone(&val_conv_20_conv); + val_constr.data[u] = val_conv_20_conv; + } + FREE(val); + ChannelDetails_set_pending_inbound_htlcs(&this_ptr_conv, val_constr); } -jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) { - LDKErrorMessage this_ptr_conv; +uint64_tArray __attribute__((export_name("TS_ChannelDetails_get_pending_outbound_htlcs"))) TS_ChannelDetails_get_pending_outbound_htlcs(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; - LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv); - jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); - Str_free(ret_str); - return ret_conv; + LDKCVec_OutboundHTLCDetailsZ ret_var = ChannelDetails_get_pending_outbound_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 v = 0; v < ret_var.datalen; v++) { + LDKOutboundHTLCDetails ret_conv_21_var = ret_var.data[v]; + uint64_t ret_conv_21_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_21_var); + ret_conv_21_ref = tag_ptr(ret_conv_21_var.inner, ret_conv_21_var.is_owned); + ret_arr_ptr[v] = ret_conv_21_ref; + } + + FREE(ret_var.data); + return ret_arr; } -void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) { - LDKErrorMessage this_ptr_conv; +void __attribute__((export_name("TS_ChannelDetails_set_pending_outbound_htlcs"))) TS_ChannelDetails_set_pending_outbound_htlcs(uint64_t this_ptr, uint64_tArray val) { + LDKChannelDetails this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKStr val_conv = str_ref_to_owned_c(val); - ErrorMessage_set_data(&this_ptr_conv, val_conv); + LDKCVec_OutboundHTLCDetailsZ val_constr; + val_constr.datalen = val->arr_len; + if (val_constr.datalen > 0) + val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + val_constr.data = NULL; + uint64_t* val_vals = val->elems; + for (size_t v = 0; v < val_constr.datalen; v++) { + uint64_t val_conv_21 = val_vals[v]; + LDKOutboundHTLCDetails val_conv_21_conv; + val_conv_21_conv.inner = untag_ptr(val_conv_21); + val_conv_21_conv.is_owned = ptr_is_owned(val_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_21_conv); + val_conv_21_conv = OutboundHTLCDetails_clone(&val_conv_21_conv); + val_constr.data[v] = val_conv_21_conv; + } + FREE(val); + ChannelDetails_set_pending_outbound_htlcs(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_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); - LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); - LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv); +uint64_t __attribute__((export_name("TS_ChannelDetails_new"))) TS_ChannelDetails_new(uint64_t 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 next_outbound_htlc_minimum_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, uint64_t channel_shutdown_state_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_tArray pending_inbound_htlcs_arg, uint64_tArray pending_outbound_htlcs_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKChannelCounterparty counterparty_arg_conv; + counterparty_arg_conv.inner = untag_ptr(counterparty_arg); + counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv); + counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv); + LDKOutPoint funding_txo_arg_conv; + funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg); + funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv); + funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv); + LDKChannelTypeFeatures channel_type_arg_conv; + channel_type_arg_conv.inner = untag_ptr(channel_type_arg); + channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); + channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg); + CHECK_ACCESS(short_channel_id_arg_ptr); + LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr); + short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg)); + void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg); + CHECK_ACCESS(outbound_scid_alias_arg_ptr); + LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr); + outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg)); + void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg); + CHECK_ACCESS(inbound_scid_alias_arg_ptr); + LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr); + inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg)); + void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg); + CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr); + LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr); + LDKU128 user_channel_id_arg_ref; + CHECK(user_channel_id_arg->arr_len == 16); + memcpy(user_channel_id_arg_ref.le_bytes, user_channel_id_arg->elems, 16); FREE(user_channel_id_arg); + void* 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); + confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg)); + void* confirmations_arg_ptr = untag_ptr(confirmations_arg); + CHECK_ACCESS(confirmations_arg_ptr); + LDKCOption_u32Z confirmations_arg_conv = *(LDKCOption_u32Z*)(confirmations_arg_ptr); + confirmations_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_arg)); + void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg); + CHECK_ACCESS(force_close_spend_delay_arg_ptr); + LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr); + force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg)); + void* channel_shutdown_state_arg_ptr = untag_ptr(channel_shutdown_state_arg); + CHECK_ACCESS(channel_shutdown_state_arg_ptr); + LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg_conv = *(LDKCOption_ChannelShutdownStateZ*)(channel_shutdown_state_arg_ptr); + channel_shutdown_state_arg_conv = COption_ChannelShutdownStateZ_clone((LDKCOption_ChannelShutdownStateZ*)untag_ptr(channel_shutdown_state_arg)); + void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg); + CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr); + inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg)); + void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg); + CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr); + LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr); + inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg)); + LDKChannelConfig config_arg_conv; + config_arg_conv.inner = untag_ptr(config_arg); + 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); + LDKCVec_InboundHTLCDetailsZ pending_inbound_htlcs_arg_constr; + pending_inbound_htlcs_arg_constr.datalen = pending_inbound_htlcs_arg->arr_len; + if (pending_inbound_htlcs_arg_constr.datalen > 0) + pending_inbound_htlcs_arg_constr.data = MALLOC(pending_inbound_htlcs_arg_constr.datalen * sizeof(LDKInboundHTLCDetails), "LDKCVec_InboundHTLCDetailsZ Elements"); + else + pending_inbound_htlcs_arg_constr.data = NULL; + uint64_t* pending_inbound_htlcs_arg_vals = pending_inbound_htlcs_arg->elems; + for (size_t u = 0; u < pending_inbound_htlcs_arg_constr.datalen; u++) { + uint64_t pending_inbound_htlcs_arg_conv_20 = pending_inbound_htlcs_arg_vals[u]; + LDKInboundHTLCDetails pending_inbound_htlcs_arg_conv_20_conv; + pending_inbound_htlcs_arg_conv_20_conv.inner = untag_ptr(pending_inbound_htlcs_arg_conv_20); + pending_inbound_htlcs_arg_conv_20_conv.is_owned = ptr_is_owned(pending_inbound_htlcs_arg_conv_20); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_inbound_htlcs_arg_conv_20_conv); + pending_inbound_htlcs_arg_conv_20_conv = InboundHTLCDetails_clone(&pending_inbound_htlcs_arg_conv_20_conv); + pending_inbound_htlcs_arg_constr.data[u] = pending_inbound_htlcs_arg_conv_20_conv; + } + FREE(pending_inbound_htlcs_arg); + LDKCVec_OutboundHTLCDetailsZ pending_outbound_htlcs_arg_constr; + pending_outbound_htlcs_arg_constr.datalen = pending_outbound_htlcs_arg->arr_len; + if (pending_outbound_htlcs_arg_constr.datalen > 0) + pending_outbound_htlcs_arg_constr.data = MALLOC(pending_outbound_htlcs_arg_constr.datalen * sizeof(LDKOutboundHTLCDetails), "LDKCVec_OutboundHTLCDetailsZ Elements"); + else + pending_outbound_htlcs_arg_constr.data = NULL; + uint64_t* pending_outbound_htlcs_arg_vals = pending_outbound_htlcs_arg->elems; + for (size_t v = 0; v < pending_outbound_htlcs_arg_constr.datalen; v++) { + uint64_t pending_outbound_htlcs_arg_conv_21 = pending_outbound_htlcs_arg_vals[v]; + LDKOutboundHTLCDetails pending_outbound_htlcs_arg_conv_21_conv; + pending_outbound_htlcs_arg_conv_21_conv.inner = untag_ptr(pending_outbound_htlcs_arg_conv_21); + pending_outbound_htlcs_arg_conv_21_conv.is_owned = ptr_is_owned(pending_outbound_htlcs_arg_conv_21); + CHECK_INNER_FIELD_ACCESS_OR_NULL(pending_outbound_htlcs_arg_conv_21_conv); + pending_outbound_htlcs_arg_conv_21_conv = OutboundHTLCDetails_clone(&pending_outbound_htlcs_arg_conv_21_conv); + pending_outbound_htlcs_arg_constr.data[v] = pending_outbound_htlcs_arg_conv_21_conv; + } + FREE(pending_outbound_htlcs_arg); + LDKChannelDetails ret_var = ChannelDetails_new(channel_id_arg_conv, 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, next_outbound_htlc_minimum_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, channel_shutdown_state_arg_conv, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg_conv, inbound_htlc_maximum_msat_arg_conv, config_arg_conv, pending_inbound_htlcs_arg_constr, pending_outbound_htlcs_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 ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { - LDKErrorMessage ret_var = ErrorMessage_clone(arg); +static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { + LDKChannelDetails ret_var = ChannelDetails_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_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) { - LDKErrorMessage arg_conv; +int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) { + LDKChannelDetails 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 = ErrorMessage_clone_ptr(&arg_conv); + int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) { - LDKErrorMessage orig_conv; +uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) { + LDKChannelDetails 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; - LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv); + LDKChannelDetails ret_var = ChannelDetails_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_ErrorMessage_hash"))) TS_ErrorMessage_hash(uint64_t o) { - LDKErrorMessage 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 = ErrorMessage_hash(&o_conv); - return ret_conv; -} - -jboolean __attribute__((export_name("TS_ErrorMessage_eq"))) TS_ErrorMessage_eq(uint64_t a, uint64_t b) { - LDKErrorMessage a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKErrorMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) { - LDKWarningMessage this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - WarningMessage_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) { + LDKChannelDetails this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); + *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int8_tArray __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, *WarningMessage_get_channel_id(&this_ptr_conv), 32); +int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) { + LDKChannelDetails 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 = ChannelDetails_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_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - WarningMessage_set_channel_id(&this_ptr_conv, val_ref); -} - -jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = WarningMessage_get_data(&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_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) { - LDKWarningMessage this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - WarningMessage_set_data(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(int8_tArray channel_id_arg, jstring data_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); - LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); - LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_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_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ"); + *ret_conv = ChannelDetails_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { - LDKWarningMessage ret_var = WarningMessage_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_ChannelShutdownState_clone"))) TS_ChannelShutdownState_clone(uint64_t orig) { + LDKChannelShutdownState* orig_conv = (LDKChannelShutdownState*)untag_ptr(orig); + uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_clone(orig_conv)); + return ret_conv; } -int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) { - LDKWarningMessage 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 = WarningMessage_clone_ptr(&arg_conv); + +uint32_t __attribute__((export_name("TS_ChannelShutdownState_not_shutting_down"))) TS_ChannelShutdownState_not_shutting_down() { + uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_not_shutting_down()); return ret_conv; } -uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) { - LDKWarningMessage 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; - LDKWarningMessage ret_var = WarningMessage_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_ChannelShutdownState_shutdown_initiated"))) TS_ChannelShutdownState_shutdown_initiated() { + uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_shutdown_initiated()); + return ret_conv; } -int64_t __attribute__((export_name("TS_WarningMessage_hash"))) TS_WarningMessage_hash(uint64_t o) { - LDKWarningMessage 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 = WarningMessage_hash(&o_conv); +uint32_t __attribute__((export_name("TS_ChannelShutdownState_resolving_htlcs"))) TS_ChannelShutdownState_resolving_htlcs() { + uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_resolving_htlcs()); return ret_conv; } -jboolean __attribute__((export_name("TS_WarningMessage_eq"))) TS_WarningMessage_eq(uint64_t a, uint64_t b) { - LDKWarningMessage a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKWarningMessage b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv); +uint32_t __attribute__((export_name("TS_ChannelShutdownState_negotiating_closing_fee"))) TS_ChannelShutdownState_negotiating_closing_fee() { + uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_negotiating_closing_fee()); return ret_conv; } -void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) { - LDKPing this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Ping_free(this_obj_conv); +uint32_t __attribute__((export_name("TS_ChannelShutdownState_shutdown_complete"))) TS_ChannelShutdownState_shutdown_complete() { + uint32_t ret_conv = LDKChannelShutdownState_to_js(ChannelShutdownState_shutdown_complete()); + return ret_conv; } -int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Ping_get_ponglen(&this_ptr_conv); +jboolean __attribute__((export_name("TS_ChannelShutdownState_eq"))) TS_ChannelShutdownState_eq(uint64_t a, uint64_t b) { + LDKChannelShutdownState* a_conv = (LDKChannelShutdownState*)untag_ptr(a); + LDKChannelShutdownState* b_conv = (LDKChannelShutdownState*)untag_ptr(b); + jboolean ret_conv = ChannelShutdownState_eq(a_conv, b_conv); return ret_conv; } -void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Ping_set_ponglen(&this_ptr_conv, val); +int8_tArray __attribute__((export_name("TS_ChannelShutdownState_write"))) TS_ChannelShutdownState_write(uint64_t obj) { + LDKChannelShutdownState* obj_conv = (LDKChannelShutdownState*)untag_ptr(obj); + LDKCVec_u8Z ret_var = ChannelShutdownState_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_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Ping_get_byteslen(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ChannelShutdownState_read"))) TS_ChannelShutdownState_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelShutdownStateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelShutdownStateDecodeErrorZ), "LDKCResult_ChannelShutdownStateDecodeErrorZ"); + *ret_conv = ChannelShutdownState_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); } -void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) { - LDKPing this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Ping_set_byteslen(&this_ptr_conv, val); +void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) { + LDKExpandedKey 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); + ExpandedKey_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) { - LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg); +uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) { + uint8_t key_material_arr[32]; + CHECK(key_material->arr_len == 32); + memcpy(key_material_arr, key_material->elems, 32); FREE(key_material); + uint8_t (*key_material_ref)[32] = &key_material_arr; + LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref); uint64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } -static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { - LDKPing ret_var = Ping_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_create"))) TS_create(uint64_t keys, uint64_t min_value_msat, int32_t invoice_expiry_delta_secs, uint64_t entropy_source, int64_t current_time, uint64_t min_final_cltv_expiry_delta) { + LDKExpandedKey keys_conv; + keys_conv.inner = untag_ptr(keys); + keys_conv.is_owned = ptr_is_owned(keys); + CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv); + keys_conv.is_owned = false; + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ), "LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ"); + *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, entropy_source_conv, current_time, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_create_from_hash"))) TS_create_from_hash(uint64_t keys, uint64_t min_value_msat, int8_tArray payment_hash, int32_t invoice_expiry_delta_secs, int64_t current_time, uint64_t min_final_cltv_expiry_delta) { + LDKExpandedKey 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; + void* min_value_msat_ptr = untag_ptr(min_value_msat); + CHECK_ACCESS(min_value_msat_ptr); + LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr); + min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat)); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + void* min_final_cltv_expiry_delta_ptr = untag_ptr(min_final_cltv_expiry_delta); + CHECK_ACCESS(min_final_cltv_expiry_delta_ptr); + LDKCOption_u16Z min_final_cltv_expiry_delta_conv = *(LDKCOption_u16Z*)(min_final_cltv_expiry_delta_ptr); + min_final_cltv_expiry_delta_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(min_final_cltv_expiry_delta)); + LDKCResult_ThirtyTwoBytesNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesNoneZ), "LDKCResult_ThirtyTwoBytesNoneZ"); + *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKDecodeError this_ptr_conv = *(LDKDecodeError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + DecodeError_free(this_ptr_conv); +} + +static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) { - LDKPing 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 = Ping_clone_ptr(&arg_conv); +int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) { + LDKDecodeError* arg_conv = (LDKDecodeError*)untag_ptr(arg); + int64_t ret_conv = DecodeError_clone_ptr(arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) { - LDKPing 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; - LDKPing ret_var = Ping_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_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) { + LDKDecodeError* orig_conv = (LDKDecodeError*)untag_ptr(orig); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_Ping_hash"))) TS_Ping_hash(uint64_t o) { - LDKPing 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 = Ping_hash(&o_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_DecodeError_unknown_version"))) TS_DecodeError_unknown_version() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_unknown_version(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -jboolean __attribute__((export_name("TS_Ping_eq"))) TS_Ping_eq(uint64_t a, uint64_t b) { - LDKPing a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPing b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Ping_eq(&a_conv, &b_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_DecodeError_unknown_required_feature"))) TS_DecodeError_unknown_required_feature() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_unknown_required_feature(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) { - LDKPong this_obj_conv; - this_obj_conv.inner = untag_ptr(this_obj); - this_obj_conv.is_owned = ptr_is_owned(this_obj); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - Pong_free(this_obj_conv); +uint64_t __attribute__((export_name("TS_DecodeError_invalid_value"))) TS_DecodeError_invalid_value() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_invalid_value(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = Pong_get_byteslen(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_DecodeError_short_read"))) TS_DecodeError_short_read() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_short_read(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) { - LDKPong this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - Pong_set_byteslen(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_DecodeError_bad_length_descriptor"))) TS_DecodeError_bad_length_descriptor() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_bad_length_descriptor(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) { - LDKPong ret_var = Pong_new(byteslen_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_DecodeError_io"))) TS_DecodeError_io(uint32_t a) { + LDKIOError a_conv = LDKIOError_from_js(a); + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_io(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { - LDKPong ret_var = Pong_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_DecodeError_unsupported_compression"))) TS_DecodeError_unsupported_compression() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_unsupported_compression(); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) { - LDKPong 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 = Pong_clone_ptr(&arg_conv); - return ret_conv; -} -uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) { - LDKPong 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; - LDKPong ret_var = Pong_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_DecodeError_dangerous_value"))) TS_DecodeError_dangerous_value() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_dangerous_value(); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t __attribute__((export_name("TS_Pong_hash"))) TS_Pong_hash(uint64_t o) { - LDKPong 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 = Pong_hash(&o_conv); +int64_t __attribute__((export_name("TS_DecodeError_hash"))) TS_DecodeError_hash(uint64_t o) { + LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); + int64_t ret_conv = DecodeError_hash(o_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_Pong_eq"))) TS_Pong_eq(uint64_t a, uint64_t b) { - LDKPong a_conv; - a_conv.inner = untag_ptr(a); - a_conv.is_owned = ptr_is_owned(a); - CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); - a_conv.is_owned = false; - LDKPong b_conv; - b_conv.inner = untag_ptr(b); - b_conv.is_owned = ptr_is_owned(b); - CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); - b_conv.is_owned = false; - jboolean ret_conv = Pong_eq(&a_conv, &b_conv); +jboolean __attribute__((export_name("TS_DecodeError_eq"))) TS_DecodeError_eq(uint64_t a, uint64_t b) { + LDKDecodeError* a_conv = (LDKDecodeError*)untag_ptr(a); + LDKDecodeError* b_conv = (LDKDecodeError*)untag_ptr(b); + jboolean ret_conv = DecodeError_eq(a_conv, b_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) { - LDKOpenChannel this_obj_conv; +void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) { + LDKInit this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OpenChannel_free(this_obj_conv); + Init_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_OpenChannel_get_chain_hash(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *OpenChannel_get_chain_hash(&this_ptr_conv), 32); - return ret_arr; + LDKInitFeatures ret_var = Init_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_OpenChannel_set_chain_hash"))) TS_OpenChannel_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OpenChannel_set_chain_hash(&this_ptr_conv, val_ref); + LDKInitFeatures 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 = InitFeatures_clone(&val_conv); + Init_set_features(&this_ptr_conv, val_conv); } -int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id"))) TS_OpenChannel_get_temporary_channel_id(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_Init_get_networks"))) TS_Init_get_networks(uint64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKCOption_CVec_ThirtyTwoBytesZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_ThirtyTwoBytesZZ), "LDKCOption_CVec_ThirtyTwoBytesZZ"); + *ret_copy = Init_get_networks(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS_OpenChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_Init_set_networks"))) TS_Init_set_networks(uint64_t this_ptr, uint64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_CVec_ThirtyTwoBytesZZ val_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(val_ptr); + val_conv = COption_CVec_ThirtyTwoBytesZZ_clone((LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(val)); + Init_set_networks(&this_ptr_conv, val_conv); } -int64_t __attribute__((export_name("TS_OpenChannel_get_funding_satoshis"))) TS_OpenChannel_get_funding_satoshis(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) { + LDKInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannel_get_funding_satoshis(&this_ptr_conv); - return ret_conv; + LDKCOption_SocketAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_SocketAddressZ), "LDKCOption_SocketAddressZ"); + *ret_copy = Init_get_remote_network_address(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_OpenChannel_set_funding_satoshis"))) TS_OpenChannel_set_funding_satoshis(uint64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) { + LDKInit this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannel_set_funding_satoshis(&this_ptr_conv, val); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKCOption_SocketAddressZ val_conv = *(LDKCOption_SocketAddressZ*)(val_ptr); + val_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(val)); + Init_set_remote_network_address(&this_ptr_conv, val_conv); } -int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_push_msat(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t networks_arg, uint64_t remote_network_address_arg) { + LDKInitFeatures 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 = InitFeatures_clone(&features_arg_conv); + void* networks_arg_ptr = untag_ptr(networks_arg); + CHECK_ACCESS(networks_arg_ptr); + LDKCOption_CVec_ThirtyTwoBytesZZ networks_arg_conv = *(LDKCOption_CVec_ThirtyTwoBytesZZ*)(networks_arg_ptr); + networks_arg_conv = COption_CVec_ThirtyTwoBytesZZ_clone((LDKCOption_CVec_ThirtyTwoBytesZZ*)untag_ptr(networks_arg)); + void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg); + CHECK_ACCESS(remote_network_address_arg_ptr); + LDKCOption_SocketAddressZ remote_network_address_arg_conv = *(LDKCOption_SocketAddressZ*)(remote_network_address_arg_ptr); + LDKInit ret_var = Init_new(features_arg_conv, networks_arg_conv, remote_network_address_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_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_push_msat(&this_ptr_conv, val); +static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) { + LDKInit ret_var = Init_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_OpenChannel_get_dust_limit_satoshis"))) TS_OpenChannel_get_dust_limit_satoshis(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv); +int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) { + LDKInit 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 = Init_clone_ptr(&arg_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_dust_limit_satoshis"))) TS_OpenChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) { + LDKInit 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; + LDKInit ret_var = Init_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_OpenChannel_get_max_htlc_value_in_flight_msat"))) TS_OpenChannel_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); +int64_t __attribute__((export_name("TS_Init_hash"))) TS_Init_hash(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.is_owned = false; + int64_t ret_conv = Init_hash(&o_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_max_htlc_value_in_flight_msat"))) TS_OpenChannel_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); -} - -int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); +jboolean __attribute__((export_name("TS_Init_eq"))) TS_Init_eq(uint64_t a, uint64_t b) { + LDKInit a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKInit b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Init_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) { + LDKErrorMessage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + ErrorMessage_free(this_obj_conv); } -int64_t __attribute__((export_name("TS_OpenChannel_get_htlc_minimum_msat"))) TS_OpenChannel_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = ErrorMessage_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_OpenChannel_set_htlc_minimum_msat"))) TS_OpenChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, uint64_t val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val); + LDKChannelId 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 = ChannelId_clone(&val_conv); + ErrorMessage_set_channel_id(&this_ptr_conv, val_conv); } -int32_t __attribute__((export_name("TS_OpenChannel_get_feerate_per_kw"))) TS_OpenChannel_get_feerate_per_kw(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannel_get_feerate_per_kw(&this_ptr_conv); + LDKStr ret_str = ErrorMessage_get_data(&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_OpenChannel_set_feerate_per_kw"))) TS_OpenChannel_set_feerate_per_kw(uint64_t this_ptr, int32_t val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) { + LDKErrorMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannel_set_feerate_per_kw(&this_ptr_conv, val); + LDKStr val_conv = str_ref_to_owned_c(val); + ErrorMessage_set_data(&this_ptr_conv, val_conv); } -int16_t __attribute__((export_name("TS_OpenChannel_get_to_self_delay"))) TS_OpenChannel_get_to_self_delay(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_to_self_delay(&this_ptr_conv); - return ret_conv; +uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(uint64_t channel_id_arg, jstring data_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); + LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_conv, data_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_OpenChannel_set_to_self_delay"))) TS_OpenChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_to_self_delay(&this_ptr_conv, val); +static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) { + LDKErrorMessage ret_var = ErrorMessage_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; } - -int16_t __attribute__((export_name("TS_OpenChannel_get_max_accepted_htlcs"))) TS_OpenChannel_get_max_accepted_htlcs(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv); +int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) { + LDKErrorMessage 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 = ErrorMessage_clone_ptr(&arg_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_max_accepted_htlcs"))) TS_OpenChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val); +uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) { + LDKErrorMessage 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; + LDKErrorMessage ret_var = ErrorMessage_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_OpenChannel_get_funding_pubkey"))) TS_OpenChannel_get_funding_pubkey(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; +int64_t __attribute__((export_name("TS_ErrorMessage_hash"))) TS_ErrorMessage_hash(uint64_t o) { + LDKErrorMessage 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 = ErrorMessage_hash(&o_conv); + return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref); +jboolean __attribute__((export_name("TS_ErrorMessage_eq"))) TS_ErrorMessage_eq(uint64_t a, uint64_t b) { + LDKErrorMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKErrorMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = ErrorMessage_eq(&a_conv, &b_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint"))) TS_OpenChannel_get_revocation_basepoint(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; +void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) { + LDKWarningMessage this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + WarningMessage_free(this_obj_conv); } -void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS_OpenChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + LDKChannelId ret_var = WarningMessage_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS_OpenChannel_get_payment_point(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, uint64_t val) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKChannelId 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 = ChannelId_clone(&val_conv); + WarningMessage_set_channel_id(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OpenChannel_set_payment_point(&this_ptr_conv, val_ref); + LDKStr ret_str = WarningMessage_get_data(&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 __attribute__((export_name("TS_OpenChannel_get_delayed_payment_basepoint"))) TS_OpenChannel_get_delayed_payment_basepoint(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) { + LDKWarningMessage this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKStr val_conv = str_ref_to_owned_c(val); + WarningMessage_set_data(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint"))) TS_OpenChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); +uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(uint64_t channel_id_arg, jstring data_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStr data_arg_conv = str_ref_to_owned_c(data_arg); + LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_conv, data_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_OpenChannel_get_htlc_basepoint"))) TS_OpenChannel_get_htlc_basepoint(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; +static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) { + LDKWarningMessage ret_var = WarningMessage_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_OpenChannel_set_htlc_basepoint"))) TS_OpenChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); +int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) { + LDKWarningMessage 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 = WarningMessage_clone_ptr(&arg_conv); + return ret_conv; } -int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment_point"))) TS_OpenChannel_get_first_per_commitment_point(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; +uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) { + LDKWarningMessage 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; + LDKWarningMessage ret_var = WarningMessage_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_OpenChannel_set_first_per_commitment_point"))) TS_OpenChannel_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); +int64_t __attribute__((export_name("TS_WarningMessage_hash"))) TS_WarningMessage_hash(uint64_t o) { + LDKWarningMessage 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 = WarningMessage_hash(&o_conv); + return ret_conv; } -int8_t __attribute__((export_name("TS_OpenChannel_get_channel_flags"))) TS_OpenChannel_get_channel_flags(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannel_get_channel_flags(&this_ptr_conv); +jboolean __attribute__((export_name("TS_WarningMessage_eq"))) TS_WarningMessage_eq(uint64_t a, uint64_t b) { + LDKWarningMessage a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKWarningMessage b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = WarningMessage_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_channel_flags"))) TS_OpenChannel_set_channel_flags(uint64_t this_ptr, int8_t val) { - LDKOpenChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannel_set_channel_flags(&this_ptr_conv, val); +void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) { + LDKPing this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + Ping_free(this_obj_conv); } -uint64_t __attribute__((export_name("TS_OpenChannel_get_shutdown_scriptpubkey"))) TS_OpenChannel_get_shutdown_scriptpubkey(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannel_get_shutdown_scriptpubkey(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; + int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_shutdown_scriptpubkey"))) TS_OpenChannel_set_shutdown_scriptpubkey(uint64_t this_ptr, uint64_t val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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)); - OpenChannel_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); + Ping_set_ponglen(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_OpenChannel_get_channel_type(uint64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int16_t __attribute__((export_name("TS_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&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; + int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenChannel_set_channel_type(uint64_t this_ptr, uint64_t val) { - LDKOpenChannel this_ptr_conv; +void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) { + LDKPing this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone(&val_conv); - OpenChannel_set_channel_type(&this_ptr_conv, val_conv); + Ping_set_byteslen(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_OpenChannel_new"))) TS_OpenChannel_new(int8_tArray chain_hash_arg, int8_tArray temporary_channel_id_arg, int64_t funding_satoshis_arg, int64_t push_msat_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t channel_reserve_satoshis_arg, int64_t htlc_minimum_msat_arg, int32_t feerate_per_kw_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, 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, int8_tArray first_per_commitment_point_arg, int8_t channel_flags_arg, uint64_t shutdown_scriptpubkey_arg, uint64_t channel_type_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); - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_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); - LDKPublicKey first_per_commitment_point_arg_ref; - CHECK(first_per_commitment_point_arg->arr_len == 33); - memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); - void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); - CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); - LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); - shutdown_scriptpubkey_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(shutdown_scriptpubkey_arg)); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - LDKOpenChannel ret_var = OpenChannel_new(chain_hash_arg_ref, temporary_channel_id_arg_ref, funding_satoshis_arg, push_msat_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, channel_reserve_satoshis_arg, htlc_minimum_msat_arg, feerate_per_kw_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, channel_flags_arg, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv); +uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) { + LDKPing ret_var = Ping_new(ponglen_arg, byteslen_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 OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { - LDKOpenChannel ret_var = OpenChannel_clone(arg); +static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) { + LDKPing ret_var = Ping_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_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) { - LDKOpenChannel arg_conv; +int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) { + LDKPing 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 = OpenChannel_clone_ptr(&arg_conv); + int64_t ret_conv = Ping_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) { - LDKOpenChannel orig_conv; +uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) { + LDKPing 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; - LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv); + LDKPing ret_var = Ping_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_OpenChannel_hash"))) TS_OpenChannel_hash(uint64_t o) { - LDKOpenChannel o_conv; +int64_t __attribute__((export_name("TS_Ping_hash"))) TS_Ping_hash(uint64_t o) { + LDKPing 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 = OpenChannel_hash(&o_conv); + int64_t ret_conv = Ping_hash(&o_conv); return ret_conv; } -jboolean __attribute__((export_name("TS_OpenChannel_eq"))) TS_OpenChannel_eq(uint64_t a, uint64_t b) { - LDKOpenChannel a_conv; +jboolean __attribute__((export_name("TS_Ping_eq"))) TS_Ping_eq(uint64_t a, uint64_t b) { + LDKPing a_conv; a_conv.inner = untag_ptr(a); a_conv.is_owned = ptr_is_owned(a); CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); a_conv.is_owned = false; - LDKOpenChannel b_conv; + LDKPing b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv.is_owned = false; - jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv); + jboolean ret_conv = Ping_eq(&a_conv, &b_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_free"))) TS_OpenChannelV2_free(uint64_t this_obj) { - LDKOpenChannelV2 this_obj_conv; +void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) { + LDKPong this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); this_obj_conv.is_owned = ptr_is_owned(this_obj); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); - OpenChannelV2_free(this_obj_conv); + Pong_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_chain_hash"))) TS_OpenChannelV2_get_chain_hash(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) { + LDKPong this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *OpenChannelV2_get_chain_hash(&this_ptr_conv), 32); - return ret_arr; + int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_chain_hash"))) TS_OpenChannelV2_set_chain_hash(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) { + LDKPong this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OpenChannelV2_set_chain_hash(&this_ptr_conv, val_ref); + Pong_set_byteslen(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_temporary_channel_id"))) TS_OpenChannelV2_get_temporary_channel_id(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, *OpenChannelV2_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; +uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) { + LDKPong ret_var = Pong_new(byteslen_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_OpenChannelV2_set_temporary_channel_id"))) TS_OpenChannelV2_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - OpenChannelV2_set_temporary_channel_id(&this_ptr_conv, val_ref); +static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) { + LDKPong ret_var = Pong_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_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) { + LDKPong 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 = Pong_clone_ptr(&arg_conv); + return ret_conv; } -int32_t __attribute__((export_name("TS_OpenChannelV2_get_funding_feerate_sat_per_1000_weight"))) TS_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = OpenChannelV2_get_funding_feerate_sat_per_1000_weight(&this_ptr_conv); +uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) { + LDKPong 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; + LDKPong ret_var = Pong_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_Pong_hash"))) TS_Pong_hash(uint64_t o) { + LDKPong 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 = Pong_hash(&o_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_funding_feerate_sat_per_1000_weight"))) TS_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(uint64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - OpenChannelV2_set_funding_feerate_sat_per_1000_weight(&this_ptr_conv, val); +jboolean __attribute__((export_name("TS_Pong_eq"))) TS_Pong_eq(uint64_t a, uint64_t b) { + LDKPong a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKPong b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = Pong_eq(&a_conv, &b_conv); + return ret_conv; } -int32_t __attribute__((export_name("TS_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight"))) TS_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_free"))) TS_CommonOpenChannelFields_free(uint64_t this_obj) { + LDKCommonOpenChannelFields 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); + CommonOpenChannelFields_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_chain_hash"))) TS_CommonOpenChannelFields_get_chain_hash(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); - return ret_conv; + int8_tArray ret_arr = init_int8_tArray(32, __LINE__); + memcpy(ret_arr->elems, *CommonOpenChannelFields_get_chain_hash(&this_ptr_conv), 32); + return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight"))) TS_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(uint64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_chain_hash"))) TS_CommonOpenChannelFields_set_chain_hash(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); + LDKThirtyTwoBytes val_ref; + CHECK(val->arr_len == 32); + memcpy(val_ref.data, val->elems, 32); FREE(val); + CommonOpenChannelFields_set_chain_hash(&this_ptr_conv, val_ref); } -int64_t __attribute__((export_name("TS_OpenChannelV2_get_funding_satoshis"))) TS_OpenChannelV2_get_funding_satoshis(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +uint64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_temporary_channel_id"))) TS_CommonOpenChannelFields_get_temporary_channel_id(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_funding_satoshis(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = CommonOpenChannelFields_get_temporary_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_OpenChannelV2_set_funding_satoshis"))) TS_OpenChannelV2_set_funding_satoshis(uint64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_temporary_channel_id"))) TS_CommonOpenChannelFields_set_temporary_channel_id(uint64_t this_ptr, uint64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_funding_satoshis(&this_ptr_conv, val); + LDKChannelId 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 = ChannelId_clone(&val_conv); + CommonOpenChannelFields_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int64_t __attribute__((export_name("TS_OpenChannelV2_get_dust_limit_satoshis"))) TS_OpenChannelV2_get_dust_limit_satoshis(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_funding_satoshis"))) TS_CommonOpenChannelFields_get_funding_satoshis(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_dust_limit_satoshis(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_funding_satoshis(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_dust_limit_satoshis"))) TS_OpenChannelV2_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_funding_satoshis"))) TS_CommonOpenChannelFields_set_funding_satoshis(uint64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_dust_limit_satoshis(&this_ptr_conv, val); + CommonOpenChannelFields_set_funding_satoshis(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_OpenChannelV2_get_max_htlc_value_in_flight_msat"))) TS_OpenChannelV2_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_dust_limit_satoshis"))) TS_CommonOpenChannelFields_get_dust_limit_satoshis(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_dust_limit_satoshis(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_max_htlc_value_in_flight_msat"))) TS_OpenChannelV2_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_dust_limit_satoshis"))) TS_CommonOpenChannelFields_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + CommonOpenChannelFields_set_dust_limit_satoshis(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_OpenChannelV2_get_htlc_minimum_msat"))) TS_OpenChannelV2_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_max_htlc_value_in_flight_msat"))) TS_CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_htlc_minimum_msat"))) TS_OpenChannelV2_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_max_htlc_value_in_flight_msat"))) TS_CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_htlc_minimum_msat(&this_ptr_conv, val); + CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int16_t __attribute__((export_name("TS_OpenChannelV2_get_to_self_delay"))) TS_OpenChannelV2_get_to_self_delay(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_htlc_minimum_msat"))) TS_CommonOpenChannelFields_get_htlc_minimum_msat(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_to_self_delay(&this_ptr_conv); + int64_t ret_conv = CommonOpenChannelFields_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_to_self_delay"))) TS_OpenChannelV2_set_to_self_delay(uint64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_htlc_minimum_msat"))) TS_CommonOpenChannelFields_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_to_self_delay(&this_ptr_conv, val); + CommonOpenChannelFields_set_htlc_minimum_msat(&this_ptr_conv, val); } -int16_t __attribute__((export_name("TS_OpenChannelV2_get_max_accepted_htlcs"))) TS_OpenChannelV2_get_max_accepted_htlcs(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int32_t __attribute__((export_name("TS_CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight"))) TS_CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_max_accepted_htlcs(&this_ptr_conv); + int32_t ret_conv = CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_max_accepted_htlcs"))) TS_OpenChannelV2_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight"))) TS_CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(uint64_t this_ptr, int32_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_max_accepted_htlcs(&this_ptr_conv, val); + CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); } -int32_t __attribute__((export_name("TS_OpenChannelV2_get_locktime"))) TS_OpenChannelV2_get_locktime(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t __attribute__((export_name("TS_CommonOpenChannelFields_get_to_self_delay"))) TS_CommonOpenChannelFields_get_to_self_delay(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_locktime(&this_ptr_conv); + int16_t ret_conv = CommonOpenChannelFields_get_to_self_delay(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_locktime"))) TS_OpenChannelV2_set_locktime(uint64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_to_self_delay"))) TS_CommonOpenChannelFields_set_to_self_delay(uint64_t this_ptr, int16_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_locktime(&this_ptr_conv, val); + CommonOpenChannelFields_set_to_self_delay(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_funding_pubkey"))) TS_OpenChannelV2_get_funding_pubkey(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t __attribute__((export_name("TS_CommonOpenChannelFields_get_max_accepted_htlcs"))) TS_CommonOpenChannelFields_get_max_accepted_htlcs(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; + int16_t ret_conv = CommonOpenChannelFields_get_max_accepted_htlcs(&this_ptr_conv); + return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_funding_pubkey"))) TS_OpenChannelV2_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_max_accepted_htlcs"))) TS_CommonOpenChannelFields_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - OpenChannelV2_set_funding_pubkey(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_max_accepted_htlcs(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_revocation_basepoint"))) TS_OpenChannelV2_get_revocation_basepoint(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_funding_pubkey"))) TS_CommonOpenChannelFields_get_funding_pubkey(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_revocation_basepoint"))) TS_OpenChannelV2_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_funding_pubkey"))) TS_CommonOpenChannelFields_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42023,22 +46749,22 @@ void __attribute__((export_name("TS_OpenChannelV2_set_revocation_basepoint"))) LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_revocation_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_payment_basepoint"))) TS_OpenChannelV2_get_payment_basepoint(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_revocation_basepoint"))) TS_CommonOpenChannelFields_get_revocation_basepoint(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_payment_basepoint"))) TS_OpenChannelV2_set_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_revocation_basepoint"))) TS_CommonOpenChannelFields_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42046,22 +46772,22 @@ void __attribute__((export_name("TS_OpenChannelV2_set_payment_basepoint"))) TS_ LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_payment_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_revocation_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_delayed_payment_basepoint"))) TS_OpenChannelV2_get_delayed_payment_basepoint(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_payment_basepoint"))) TS_CommonOpenChannelFields_get_payment_basepoint(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_delayed_payment_basepoint"))) TS_OpenChannelV2_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_payment_basepoint"))) TS_CommonOpenChannelFields_set_payment_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42069,22 +46795,22 @@ void __attribute__((export_name("TS_OpenChannelV2_set_delayed_payment_basepoint LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_htlc_basepoint"))) TS_OpenChannelV2_get_htlc_basepoint(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_delayed_payment_basepoint"))) TS_CommonOpenChannelFields_get_delayed_payment_basepoint(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_htlc_basepoint"))) TS_OpenChannelV2_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_delayed_payment_basepoint"))) TS_CommonOpenChannelFields_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42092,22 +46818,22 @@ void __attribute__((export_name("TS_OpenChannelV2_set_htlc_basepoint"))) TS_Ope LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_htlc_basepoint(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_first_per_commitment_point"))) TS_OpenChannelV2_get_first_per_commitment_point(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_htlc_basepoint"))) TS_CommonOpenChannelFields_get_htlc_basepoint(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_first_per_commitment_point"))) TS_OpenChannelV2_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_htlc_basepoint"))) TS_CommonOpenChannelFields_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42115,22 +46841,22 @@ void __attribute__((export_name("TS_OpenChannelV2_set_first_per_commitment_poin LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_first_per_commitment_point(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_htlc_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_second_per_commitment_point"))) TS_OpenChannelV2_get_second_per_commitment_point(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonOpenChannelFields_get_first_per_commitment_point"))) TS_CommonOpenChannelFields_get_first_per_commitment_point(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, OpenChannelV2_get_second_per_commitment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonOpenChannelFields_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_OpenChannelV2_set_second_per_commitment_point"))) TS_OpenChannelV2_set_second_per_commitment_point(uint64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_first_per_commitment_point"))) TS_CommonOpenChannelFields_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42138,42 +46864,42 @@ void __attribute__((export_name("TS_OpenChannelV2_set_second_per_commitment_poi LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - OpenChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); + CommonOpenChannelFields_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -int8_t __attribute__((export_name("TS_OpenChannelV2_get_channel_flags"))) TS_OpenChannelV2_get_channel_flags(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_t __attribute__((export_name("TS_CommonOpenChannelFields_get_channel_flags"))) TS_CommonOpenChannelFields_get_channel_flags(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_channel_flags(&this_ptr_conv); + int8_t ret_conv = CommonOpenChannelFields_get_channel_flags(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_OpenChannelV2_set_channel_flags"))) TS_OpenChannelV2_set_channel_flags(uint64_t this_ptr, int8_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_channel_flags"))) TS_CommonOpenChannelFields_set_channel_flags(uint64_t this_ptr, int8_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - OpenChannelV2_set_channel_flags(&this_ptr_conv, val); + CommonOpenChannelFields_set_channel_flags(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_OpenChannelV2_get_shutdown_scriptpubkey"))) TS_OpenChannelV2_get_shutdown_scriptpubkey(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +uint64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_shutdown_scriptpubkey"))) TS_CommonOpenChannelFields_get_shutdown_scriptpubkey(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = OpenChannelV2_get_shutdown_scriptpubkey(&this_ptr_conv); + *ret_copy = CommonOpenChannelFields_get_shutdown_scriptpubkey(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_OpenChannelV2_set_shutdown_scriptpubkey"))) TS_OpenChannelV2_set_shutdown_scriptpubkey(uint64_t this_ptr, uint64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_shutdown_scriptpubkey"))) TS_CommonOpenChannelFields_set_shutdown_scriptpubkey(uint64_t this_ptr, uint64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42182,24 +46908,24 @@ void __attribute__((export_name("TS_OpenChannelV2_set_shutdown_scriptpubkey"))) 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)); - OpenChannelV2_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); + CommonOpenChannelFields_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_OpenChannelV2_get_channel_type"))) TS_OpenChannelV2_get_channel_type(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +uint64_t __attribute__((export_name("TS_CommonOpenChannelFields_get_channel_type"))) TS_CommonOpenChannelFields_get_channel_type(uint64_t this_ptr) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = OpenChannelV2_get_channel_type(&this_ptr_conv); + LDKChannelTypeFeatures ret_var = CommonOpenChannelFields_get_channel_type(&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_OpenChannelV2_set_channel_type"))) TS_OpenChannelV2_set_channel_type(uint64_t this_ptr, uint64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void __attribute__((export_name("TS_CommonOpenChannelFields_set_channel_type"))) TS_CommonOpenChannelFields_set_channel_type(uint64_t this_ptr, uint64_t val) { + LDKCommonOpenChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42209,36 +46935,18 @@ void __attribute__((export_name("TS_OpenChannelV2_set_channel_type"))) TS_OpenC val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelTypeFeatures_clone(&val_conv); - OpenChannelV2_set_channel_type(&this_ptr_conv, val_conv); -} - -uint32_t __attribute__((export_name("TS_OpenChannelV2_get_require_confirmed_inputs"))) TS_OpenChannelV2_get_require_confirmed_inputs(uint64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); - return ret_conv; + CommonOpenChannelFields_set_channel_type(&this_ptr_conv, val_conv); } -void __attribute__((export_name("TS_OpenChannelV2_set_require_confirmed_inputs"))) TS_OpenChannelV2_set_require_confirmed_inputs(uint64_t this_ptr, uint32_t val) { - LDKOpenChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_OpenChannelV2_new"))) TS_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray temporary_channel_id_arg, int32_t funding_feerate_sat_per_1000_weight_arg, int32_t commitment_feerate_sat_per_1000_weight_arg, int64_t funding_satoshis_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_tArray second_per_commitment_point_arg, int8_t channel_flags_arg, uint64_t shutdown_scriptpubkey_arg, uint64_t channel_type_arg, uint32_t require_confirmed_inputs_arg) { +uint64_t __attribute__((export_name("TS_CommonOpenChannelFields_new"))) TS_CommonOpenChannelFields_new(int8_tArray chain_hash_arg, uint64_t temporary_channel_id_arg, int64_t funding_satoshis_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t commitment_feerate_sat_per_1000_weight_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_t channel_flags_arg, uint64_t shutdown_scriptpubkey_arg, uint64_t channel_type_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); - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); + LDKChannelId temporary_channel_id_arg_conv; + temporary_channel_id_arg_conv.inner = untag_ptr(temporary_channel_id_arg); + temporary_channel_id_arg_conv.is_owned = ptr_is_owned(temporary_channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_arg_conv); + temporary_channel_id_arg_conv = ChannelId_clone(&temporary_channel_id_arg_conv); 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); @@ -42257,9 +46965,6 @@ uint64_t __attribute__((export_name("TS_OpenChannelV2_new"))) TS_OpenChannelV2_ LDKPublicKey first_per_commitment_point_arg_ref; CHECK(first_per_commitment_point_arg->arr_len == 33); memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); - LDKPublicKey second_per_commitment_point_arg_ref; - CHECK(second_per_commitment_point_arg->arr_len == 33); - memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); @@ -42269,8 +46974,336 @@ uint64_t __attribute__((export_name("TS_OpenChannelV2_new"))) TS_OpenChannelV2_ channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); + LDKCommonOpenChannelFields ret_var = CommonOpenChannelFields_new(chain_hash_arg_ref, temporary_channel_id_arg_conv, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, commitment_feerate_sat_per_1000_weight_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, channel_flags_arg, shutdown_scriptpubkey_arg_conv, channel_type_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 CommonOpenChannelFields_clone_ptr(LDKCommonOpenChannelFields *NONNULL_PTR arg) { + LDKCommonOpenChannelFields ret_var = CommonOpenChannelFields_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_CommonOpenChannelFields_clone_ptr"))) TS_CommonOpenChannelFields_clone_ptr(uint64_t arg) { + LDKCommonOpenChannelFields 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 = CommonOpenChannelFields_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CommonOpenChannelFields_clone"))) TS_CommonOpenChannelFields_clone(uint64_t orig) { + LDKCommonOpenChannelFields 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; + LDKCommonOpenChannelFields ret_var = CommonOpenChannelFields_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_CommonOpenChannelFields_hash"))) TS_CommonOpenChannelFields_hash(uint64_t o) { + LDKCommonOpenChannelFields 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 = CommonOpenChannelFields_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_CommonOpenChannelFields_eq"))) TS_CommonOpenChannelFields_eq(uint64_t a, uint64_t b) { + LDKCommonOpenChannelFields 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; + LDKCommonOpenChannelFields 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 = CommonOpenChannelFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) { + LDKOpenChannel this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + OpenChannel_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_OpenChannel_get_common_fields"))) TS_OpenChannel_get_common_fields(uint64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields ret_var = OpenChannel_get_common_fields(&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_OpenChannel_set_common_fields"))) TS_OpenChannel_set_common_fields(uint64_t this_ptr, uint64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields 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 = CommonOpenChannelFields_clone(&val_conv); + OpenChannel_set_common_fields(&this_ptr_conv, val_conv); +} + +int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = OpenChannel_get_push_msat(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannel_set_push_msat(&this_ptr_conv, val); +} + +int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) { + LDKOpenChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_OpenChannel_new"))) TS_OpenChannel_new(uint64_t common_fields_arg, int64_t push_msat_arg, int64_t channel_reserve_satoshis_arg) { + LDKCommonOpenChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonOpenChannelFields_clone(&common_fields_arg_conv); + LDKOpenChannel ret_var = OpenChannel_new(common_fields_arg_conv, push_msat_arg, channel_reserve_satoshis_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 OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) { + LDKOpenChannel ret_var = OpenChannel_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_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) { + LDKOpenChannel 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 = OpenChannel_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) { + LDKOpenChannel 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; + LDKOpenChannel ret_var = OpenChannel_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_OpenChannel_hash"))) TS_OpenChannel_hash(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.is_owned = false; + int64_t ret_conv = OpenChannel_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_OpenChannel_eq"))) TS_OpenChannel_eq(uint64_t a, uint64_t b) { + LDKOpenChannel a_conv; + a_conv.inner = untag_ptr(a); + a_conv.is_owned = ptr_is_owned(a); + CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv); + a_conv.is_owned = false; + LDKOpenChannel b_conv; + b_conv.inner = untag_ptr(b); + b_conv.is_owned = ptr_is_owned(b); + CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); + b_conv.is_owned = false; + jboolean ret_conv = OpenChannel_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannelV2_free"))) TS_OpenChannelV2_free(uint64_t this_obj) { + LDKOpenChannelV2 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); + OpenChannelV2_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_OpenChannelV2_get_common_fields"))) TS_OpenChannelV2_get_common_fields(uint64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields ret_var = OpenChannelV2_get_common_fields(&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_OpenChannelV2_set_common_fields"))) TS_OpenChannelV2_set_common_fields(uint64_t this_ptr, uint64_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonOpenChannelFields 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 = CommonOpenChannelFields_clone(&val_conv); + OpenChannelV2_set_common_fields(&this_ptr_conv, val_conv); +} + +int32_t __attribute__((export_name("TS_OpenChannelV2_get_funding_feerate_sat_per_1000_weight"))) TS_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(uint64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = OpenChannelV2_get_funding_feerate_sat_per_1000_weight(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannelV2_set_funding_feerate_sat_per_1000_weight"))) TS_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(uint64_t this_ptr, int32_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannelV2_set_funding_feerate_sat_per_1000_weight(&this_ptr_conv, val); +} + +int32_t __attribute__((export_name("TS_OpenChannelV2_get_locktime"))) TS_OpenChannelV2_get_locktime(uint64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = OpenChannelV2_get_locktime(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannelV2_set_locktime"))) TS_OpenChannelV2_set_locktime(uint64_t this_ptr, int32_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + OpenChannelV2_set_locktime(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_OpenChannelV2_get_second_per_commitment_point"))) TS_OpenChannelV2_get_second_per_commitment_point(uint64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, OpenChannelV2_get_second_per_commitment_point(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_OpenChannelV2_set_second_per_commitment_point"))) TS_OpenChannelV2_set_second_per_commitment_point(uint64_t this_ptr, int8_tArray val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + OpenChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); +} + +uint32_t __attribute__((export_name("TS_OpenChannelV2_get_require_confirmed_inputs"))) TS_OpenChannelV2_get_require_confirmed_inputs(uint64_t this_ptr) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; +} + +void __attribute__((export_name("TS_OpenChannelV2_set_require_confirmed_inputs"))) TS_OpenChannelV2_set_require_confirmed_inputs(uint64_t this_ptr, uint32_t val) { + LDKOpenChannelV2 this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_OpenChannelV2_new"))) TS_OpenChannelV2_new(uint64_t common_fields_arg, int32_t funding_feerate_sat_per_1000_weight_arg, int32_t locktime_arg, int8_tArray second_per_commitment_point_arg, uint32_t require_confirmed_inputs_arg) { + LDKCommonOpenChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonOpenChannelFields_clone(&common_fields_arg_conv); + LDKPublicKey second_per_commitment_point_arg_ref; + CHECK(second_per_commitment_point_arg->arr_len == 33); + memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_js(require_confirmed_inputs_arg); - LDKOpenChannelV2 ret_var = OpenChannelV2_new(chain_hash_arg_ref, temporary_channel_id_arg_ref, funding_feerate_sat_per_1000_weight_arg, commitment_feerate_sat_per_1000_weight_arg, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, to_self_delay_arg, max_accepted_htlcs_arg, locktime_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, second_per_commitment_point_arg_ref, channel_flags_arg, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv, require_confirmed_inputs_arg_conv); + LDKOpenChannelV2 ret_var = OpenChannelV2_new(common_fields_arg_conv, funding_feerate_sat_per_1000_weight_arg, locktime_arg, second_per_commitment_point_arg_ref, require_confirmed_inputs_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); @@ -42332,183 +47365,168 @@ jboolean __attribute__((export_name("TS_OpenChannelV2_eq"))) TS_OpenChannelV2_e return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) { - LDKAcceptChannel this_obj_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_free"))) TS_CommonAcceptChannelFields_free(uint64_t this_obj) { + LDKCommonAcceptChannelFields 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); - AcceptChannel_free(this_obj_conv); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_id"))) TS_AcceptChannel_get_temporary_channel_id(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) TS_AcceptChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_free(this_obj_conv); } -int64_t __attribute__((export_name("TS_AcceptChannel_get_dust_limit_satoshis"))) TS_AcceptChannel_get_dust_limit_satoshis(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_temporary_channel_id"))) TS_CommonAcceptChannelFields_get_temporary_channel_id(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv); - return ret_conv; + LDKChannelId ret_var = CommonAcceptChannelFields_get_temporary_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_AcceptChannel_set_dust_limit_satoshis"))) TS_AcceptChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_temporary_channel_id"))) TS_CommonAcceptChannelFields_set_temporary_channel_id(uint64_t this_ptr, uint64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val); + LDKChannelId 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 = ChannelId_clone(&val_conv); + CommonAcceptChannelFields_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int64_t __attribute__((export_name("TS_AcceptChannel_get_max_htlc_value_in_flight_msat"))) TS_AcceptChannel_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_dust_limit_satoshis"))) TS_CommonAcceptChannelFields_get_dust_limit_satoshis(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv); + int64_t ret_conv = CommonAcceptChannelFields_get_dust_limit_satoshis(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_set_max_htlc_value_in_flight_msat"))) TS_AcceptChannel_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_dust_limit_satoshis"))) TS_CommonAcceptChannelFields_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); + CommonAcceptChannelFields_set_dust_limit_satoshis(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat"))) TS_CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); + int64_t ret_conv = CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat"))) TS_CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); + CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_AcceptChannel_get_htlc_minimum_msat"))) TS_AcceptChannel_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_htlc_minimum_msat"))) TS_CommonAcceptChannelFields_get_htlc_minimum_msat(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv); + int64_t ret_conv = CommonAcceptChannelFields_get_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_set_htlc_minimum_msat"))) TS_AcceptChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_htlc_minimum_msat"))) TS_CommonAcceptChannelFields_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val); + CommonAcceptChannelFields_set_htlc_minimum_msat(&this_ptr_conv, val); } -int32_t __attribute__((export_name("TS_AcceptChannel_get_minimum_depth"))) TS_AcceptChannel_get_minimum_depth(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int32_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_minimum_depth"))) TS_CommonAcceptChannelFields_get_minimum_depth(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_minimum_depth(&this_ptr_conv); + int32_t ret_conv = CommonAcceptChannelFields_get_minimum_depth(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_set_minimum_depth"))) TS_AcceptChannel_set_minimum_depth(uint64_t this_ptr, int32_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_minimum_depth"))) TS_CommonAcceptChannelFields_set_minimum_depth(uint64_t this_ptr, int32_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_minimum_depth(&this_ptr_conv, val); + CommonAcceptChannelFields_set_minimum_depth(&this_ptr_conv, val); } -int16_t __attribute__((export_name("TS_AcceptChannel_get_to_self_delay"))) TS_AcceptChannel_get_to_self_delay(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_to_self_delay"))) TS_CommonAcceptChannelFields_get_to_self_delay(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_to_self_delay(&this_ptr_conv); + int16_t ret_conv = CommonAcceptChannelFields_get_to_self_delay(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_set_to_self_delay"))) TS_AcceptChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_to_self_delay"))) TS_CommonAcceptChannelFields_set_to_self_delay(uint64_t this_ptr, int16_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_to_self_delay(&this_ptr_conv, val); + CommonAcceptChannelFields_set_to_self_delay(&this_ptr_conv, val); } -int16_t __attribute__((export_name("TS_AcceptChannel_get_max_accepted_htlcs"))) TS_AcceptChannel_get_max_accepted_htlcs(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_max_accepted_htlcs"))) TS_CommonAcceptChannelFields_get_max_accepted_htlcs(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv); + int16_t ret_conv = CommonAcceptChannelFields_get_max_accepted_htlcs(&this_ptr_conv); return ret_conv; } -void __attribute__((export_name("TS_AcceptChannel_set_max_accepted_htlcs"))) TS_AcceptChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_max_accepted_htlcs"))) TS_CommonAcceptChannelFields_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val); + CommonAcceptChannelFields_set_max_accepted_htlcs(&this_ptr_conv, val); } -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) TS_AcceptChannel_get_funding_pubkey(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonAcceptChannelFields_get_funding_pubkey"))) TS_CommonAcceptChannelFields_get_funding_pubkey(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_AcceptChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_funding_pubkey"))) TS_CommonAcceptChannelFields_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42516,22 +47534,22 @@ void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_Acc LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_funding_pubkey(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoint"))) TS_AcceptChannel_get_revocation_basepoint(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonAcceptChannelFields_get_revocation_basepoint"))) TS_CommonAcceptChannelFields_get_revocation_basepoint(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) TS_AcceptChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_revocation_basepoint"))) TS_CommonAcceptChannelFields_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42539,22 +47557,22 @@ void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_revocation_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) TS_AcceptChannel_get_payment_point(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonAcceptChannelFields_get_payment_basepoint"))) TS_CommonAcceptChannelFields_get_payment_basepoint(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_AcceptChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_payment_basepoint"))) TS_CommonAcceptChannelFields_set_payment_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42562,22 +47580,22 @@ void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_Acce LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_payment_point(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_basepoint"))) TS_AcceptChannel_get_delayed_payment_basepoint(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonAcceptChannelFields_get_delayed_payment_basepoint"))) TS_CommonAcceptChannelFields_get_delayed_payment_basepoint(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_delayed_payment_basepoint"))) TS_CommonAcceptChannelFields_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42585,22 +47603,22 @@ void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) TS_AcceptChannel_get_htlc_basepoint(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonAcceptChannelFields_get_htlc_basepoint"))) TS_CommonAcceptChannelFields_get_htlc_basepoint(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_AcceptChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_htlc_basepoint"))) TS_CommonAcceptChannelFields_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42608,22 +47626,22 @@ void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_Acc LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_htlc_basepoint(&this_ptr_conv, val_ref); } -int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitment_point"))) TS_AcceptChannel_get_first_per_commitment_point(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray __attribute__((export_name("TS_CommonAcceptChannelFields_get_first_per_commitment_point"))) TS_CommonAcceptChannelFields_get_first_per_commitment_point(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); + memcpy(ret_arr->elems, CommonAcceptChannelFields_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); return ret_arr; } -void __attribute__((export_name("TS_AcceptChannel_set_first_per_commitment_point"))) TS_AcceptChannel_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_first_per_commitment_point"))) TS_CommonAcceptChannelFields_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42631,23 +47649,23 @@ void __attribute__((export_name("TS_AcceptChannel_set_first_per_commitment_poin LDKPublicKey val_ref; CHECK(val->arr_len == 33); memcpy(val_ref.compressed_form, val->elems, 33); FREE(val); - AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref); + CommonAcceptChannelFields_set_first_per_commitment_point(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_AcceptChannel_get_shutdown_scriptpubkey"))) TS_AcceptChannel_get_shutdown_scriptpubkey(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_shutdown_scriptpubkey"))) TS_CommonAcceptChannelFields_get_shutdown_scriptpubkey(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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 = AcceptChannel_get_shutdown_scriptpubkey(&this_ptr_conv); + *ret_copy = CommonAcceptChannelFields_get_shutdown_scriptpubkey(&this_ptr_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_AcceptChannel_set_shutdown_scriptpubkey"))) TS_AcceptChannel_set_shutdown_scriptpubkey(uint64_t this_ptr, uint64_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_shutdown_scriptpubkey"))) TS_CommonAcceptChannelFields_set_shutdown_scriptpubkey(uint64_t this_ptr, uint64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42656,24 +47674,24 @@ void __attribute__((export_name("TS_AcceptChannel_set_shutdown_scriptpubkey"))) 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)); - AcceptChannel_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); + CommonAcceptChannelFields_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_AcceptChannel_get_channel_type"))) TS_AcceptChannel_get_channel_type(uint64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +uint64_t __attribute__((export_name("TS_CommonAcceptChannelFields_get_channel_type"))) TS_CommonAcceptChannelFields_get_channel_type(uint64_t this_ptr) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv); + LDKChannelTypeFeatures ret_var = CommonAcceptChannelFields_get_channel_type(&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_AcceptChannel_set_channel_type"))) TS_AcceptChannel_set_channel_type(uint64_t this_ptr, uint64_t val) { - LDKAcceptChannel this_ptr_conv; +void __attribute__((export_name("TS_CommonAcceptChannelFields_set_channel_type"))) TS_CommonAcceptChannelFields_set_channel_type(uint64_t this_ptr, uint64_t val) { + LDKCommonAcceptChannelFields this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_ptr_conv.is_owned = ptr_is_owned(this_ptr); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); @@ -42683,22 +47701,24 @@ void __attribute__((export_name("TS_AcceptChannel_set_channel_type"))) TS_Accep val_conv.is_owned = ptr_is_owned(val); CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv); val_conv = ChannelTypeFeatures_clone(&val_conv); - AcceptChannel_set_channel_type(&this_ptr_conv, val_conv); + CommonAcceptChannelFields_set_channel_type(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_AcceptChannel_new"))) TS_AcceptChannel_new(int8_tArray temporary_channel_id_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t channel_reserve_satoshis_arg, int64_t htlc_minimum_msat_arg, int32_t minimum_depth_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, 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, int8_tArray first_per_commitment_point_arg, uint64_t shutdown_scriptpubkey_arg, uint64_t channel_type_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); +uint64_t __attribute__((export_name("TS_CommonAcceptChannelFields_new"))) TS_CommonAcceptChannelFields_new(uint64_t temporary_channel_id_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t minimum_depth_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, uint64_t shutdown_scriptpubkey_arg, uint64_t channel_type_arg) { + LDKChannelId temporary_channel_id_arg_conv; + temporary_channel_id_arg_conv.inner = untag_ptr(temporary_channel_id_arg); + temporary_channel_id_arg_conv.is_owned = ptr_is_owned(temporary_channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_arg_conv); + temporary_channel_id_arg_conv = ChannelId_clone(&temporary_channel_id_arg_conv); 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 payment_basepoint_arg_ref; + CHECK(payment_basepoint_arg->arr_len == 33); + memcpy(payment_basepoint_arg_ref.compressed_form, payment_basepoint_arg->elems, 33); FREE(payment_basepoint_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); @@ -42717,7 +47737,129 @@ uint64_t __attribute__((export_name("TS_AcceptChannel_new"))) TS_AcceptChannel_ channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); - LDKAcceptChannel ret_var = AcceptChannel_new(temporary_channel_id_arg_ref, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, channel_reserve_satoshis_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_point_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv); + LDKCommonAcceptChannelFields ret_var = CommonAcceptChannelFields_new(temporary_channel_id_arg_conv, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, shutdown_scriptpubkey_arg_conv, channel_type_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 CommonAcceptChannelFields_clone_ptr(LDKCommonAcceptChannelFields *NONNULL_PTR arg) { + LDKCommonAcceptChannelFields ret_var = CommonAcceptChannelFields_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_CommonAcceptChannelFields_clone_ptr"))) TS_CommonAcceptChannelFields_clone_ptr(uint64_t arg) { + LDKCommonAcceptChannelFields 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 = CommonAcceptChannelFields_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_CommonAcceptChannelFields_clone"))) TS_CommonAcceptChannelFields_clone(uint64_t orig) { + LDKCommonAcceptChannelFields 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; + LDKCommonAcceptChannelFields ret_var = CommonAcceptChannelFields_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_CommonAcceptChannelFields_hash"))) TS_CommonAcceptChannelFields_hash(uint64_t o) { + LDKCommonAcceptChannelFields 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 = CommonAcceptChannelFields_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_CommonAcceptChannelFields_eq"))) TS_CommonAcceptChannelFields_eq(uint64_t a, uint64_t b) { + LDKCommonAcceptChannelFields 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; + LDKCommonAcceptChannelFields 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 = CommonAcceptChannelFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) { + LDKAcceptChannel this_obj_conv; + this_obj_conv.inner = untag_ptr(this_obj); + this_obj_conv.is_owned = ptr_is_owned(this_obj); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv); + AcceptChannel_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_AcceptChannel_get_common_fields"))) TS_AcceptChannel_get_common_fields(uint64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonAcceptChannelFields ret_var = AcceptChannel_get_common_fields(&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_AcceptChannel_set_common_fields"))) TS_AcceptChannel_set_common_fields(uint64_t this_ptr, uint64_t val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKCommonAcceptChannelFields 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 = CommonAcceptChannelFields_clone(&val_conv); + AcceptChannel_set_common_fields(&this_ptr_conv, val_conv); +} + +int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) { + LDKAcceptChannel this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_AcceptChannel_new"))) TS_AcceptChannel_new(uint64_t common_fields_arg, int64_t channel_reserve_satoshis_arg) { + LDKCommonAcceptChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonAcceptChannelFields_clone(&common_fields_arg_conv); + LDKAcceptChannel ret_var = AcceptChannel_new(common_fields_arg_conv, channel_reserve_satoshis_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); @@ -42787,27 +47929,31 @@ void __attribute__((export_name("TS_AcceptChannelV2_free"))) TS_AcceptChannelV2 AcceptChannelV2_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_temporary_channel_id"))) TS_AcceptChannelV2_get_temporary_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_AcceptChannelV2_get_common_fields"))) TS_AcceptChannelV2_get_common_fields(uint64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *AcceptChannelV2_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKCommonAcceptChannelFields ret_var = AcceptChannelV2_get_common_fields(&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_AcceptChannelV2_set_temporary_channel_id"))) TS_AcceptChannelV2_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_AcceptChannelV2_set_common_fields"))) TS_AcceptChannelV2_set_common_fields(uint64_t this_ptr, uint64_t val) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - AcceptChannelV2_set_temporary_channel_id(&this_ptr_conv, val_ref); + LDKCommonAcceptChannelFields 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 = CommonAcceptChannelFields_clone(&val_conv); + AcceptChannelV2_set_common_fields(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_AcceptChannelV2_get_funding_satoshis"))) TS_AcceptChannelV2_get_funding_satoshis(uint64_t this_ptr) { @@ -42829,258 +47975,6 @@ void __attribute__((export_name("TS_AcceptChannelV2_set_funding_satoshis"))) TS AcceptChannelV2_set_funding_satoshis(&this_ptr_conv, val); } -int64_t __attribute__((export_name("TS_AcceptChannelV2_get_dust_limit_satoshis"))) TS_AcceptChannelV2_get_dust_limit_satoshis(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_dust_limit_satoshis(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_dust_limit_satoshis"))) TS_AcceptChannelV2_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_dust_limit_satoshis(&this_ptr_conv, val); -} - -int64_t __attribute__((export_name("TS_AcceptChannelV2_get_max_htlc_value_in_flight_msat"))) TS_AcceptChannelV2_get_max_htlc_value_in_flight_msat(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_max_htlc_value_in_flight_msat(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_max_htlc_value_in_flight_msat"))) TS_AcceptChannelV2_set_max_htlc_value_in_flight_msat(uint64_t this_ptr, int64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val); -} - -int64_t __attribute__((export_name("TS_AcceptChannelV2_get_htlc_minimum_msat"))) TS_AcceptChannelV2_get_htlc_minimum_msat(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_htlc_minimum_msat"))) TS_AcceptChannelV2_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_htlc_minimum_msat(&this_ptr_conv, val); -} - -int32_t __attribute__((export_name("TS_AcceptChannelV2_get_minimum_depth"))) TS_AcceptChannelV2_get_minimum_depth(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_minimum_depth(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_minimum_depth"))) TS_AcceptChannelV2_set_minimum_depth(uint64_t this_ptr, int32_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_minimum_depth(&this_ptr_conv, val); -} - -int16_t __attribute__((export_name("TS_AcceptChannelV2_get_to_self_delay"))) TS_AcceptChannelV2_get_to_self_delay(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_to_self_delay"))) TS_AcceptChannelV2_set_to_self_delay(uint64_t this_ptr, int16_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_to_self_delay(&this_ptr_conv, val); -} - -int16_t __attribute__((export_name("TS_AcceptChannelV2_get_max_accepted_htlcs"))) TS_AcceptChannelV2_get_max_accepted_htlcs(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_max_accepted_htlcs(&this_ptr_conv); - return ret_conv; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_max_accepted_htlcs"))) TS_AcceptChannelV2_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - AcceptChannelV2_set_max_accepted_htlcs(&this_ptr_conv, val); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_funding_pubkey"))) TS_AcceptChannelV2_get_funding_pubkey(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, AcceptChannelV2_get_funding_pubkey(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_funding_pubkey"))) TS_AcceptChannelV2_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannelV2_set_funding_pubkey(&this_ptr_conv, val_ref); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_revocation_basepoint"))) TS_AcceptChannelV2_get_revocation_basepoint(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, AcceptChannelV2_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_revocation_basepoint"))) TS_AcceptChannelV2_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannelV2_set_revocation_basepoint(&this_ptr_conv, val_ref); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_payment_basepoint"))) TS_AcceptChannelV2_get_payment_basepoint(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, AcceptChannelV2_get_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_payment_basepoint"))) TS_AcceptChannelV2_set_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannelV2_set_payment_basepoint(&this_ptr_conv, val_ref); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_delayed_payment_basepoint"))) TS_AcceptChannelV2_get_delayed_payment_basepoint(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, AcceptChannelV2_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_delayed_payment_basepoint"))) TS_AcceptChannelV2_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannelV2_set_delayed_payment_basepoint(&this_ptr_conv, val_ref); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_htlc_basepoint"))) TS_AcceptChannelV2_get_htlc_basepoint(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, AcceptChannelV2_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_htlc_basepoint"))) TS_AcceptChannelV2_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannelV2_set_htlc_basepoint(&this_ptr_conv, val_ref); -} - -int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_first_per_commitment_point"))) TS_AcceptChannelV2_get_first_per_commitment_point(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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, AcceptChannelV2_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_first_per_commitment_point"))) TS_AcceptChannelV2_set_first_per_commitment_point(uint64_t this_ptr, int8_tArray val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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); - AcceptChannelV2_set_first_per_commitment_point(&this_ptr_conv, val_ref); -} - int8_tArray __attribute__((export_name("TS_AcceptChannelV2_get_second_per_commitment_point"))) TS_AcceptChannelV2_get_second_per_commitment_point(uint64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43104,58 +47998,6 @@ void __attribute__((export_name("TS_AcceptChannelV2_set_second_per_commitment_p AcceptChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_AcceptChannelV2_get_shutdown_scriptpubkey"))) TS_AcceptChannelV2_get_shutdown_scriptpubkey(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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 = AcceptChannelV2_get_shutdown_scriptpubkey(&this_ptr_conv); - uint64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void __attribute__((export_name("TS_AcceptChannelV2_set_shutdown_scriptpubkey"))) TS_AcceptChannelV2_set_shutdown_scriptpubkey(uint64_t this_ptr, uint64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_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)); - AcceptChannelV2_set_shutdown_scriptpubkey(&this_ptr_conv, val_conv); -} - -uint64_t __attribute__((export_name("TS_AcceptChannelV2_get_channel_type"))) TS_AcceptChannelV2_get_channel_type(uint64_t this_ptr) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures ret_var = AcceptChannelV2_get_channel_type(&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_AcceptChannelV2_set_channel_type"))) TS_AcceptChannelV2_set_channel_type(uint64_t this_ptr, uint64_t val) { - LDKAcceptChannelV2 this_ptr_conv; - this_ptr_conv.inner = untag_ptr(this_ptr); - this_ptr_conv.is_owned = ptr_is_owned(this_ptr); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); - this_ptr_conv.is_owned = false; - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone(&val_conv); - AcceptChannelV2_set_channel_type(&this_ptr_conv, val_conv); -} - uint32_t __attribute__((export_name("TS_AcceptChannelV2_get_require_confirmed_inputs"))) TS_AcceptChannelV2_get_require_confirmed_inputs(uint64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43176,42 +48018,17 @@ void __attribute__((export_name("TS_AcceptChannelV2_set_require_confirmed_input AcceptChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_AcceptChannelV2_new"))) TS_AcceptChannelV2_new(int8_tArray temporary_channel_id_arg, int64_t funding_satoshis_arg, int64_t dust_limit_satoshis_arg, int64_t max_htlc_value_in_flight_msat_arg, int64_t htlc_minimum_msat_arg, int32_t minimum_depth_arg, int16_t to_self_delay_arg, int16_t max_accepted_htlcs_arg, int8_tArray funding_pubkey_arg, int8_tArray revocation_basepoint_arg, int8_tArray payment_basepoint_arg, int8_tArray delayed_payment_basepoint_arg, int8_tArray htlc_basepoint_arg, int8_tArray first_per_commitment_point_arg, int8_tArray second_per_commitment_point_arg, uint64_t shutdown_scriptpubkey_arg, uint64_t channel_type_arg, uint32_t require_confirmed_inputs_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_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_basepoint_arg_ref; - CHECK(payment_basepoint_arg->arr_len == 33); - memcpy(payment_basepoint_arg_ref.compressed_form, payment_basepoint_arg->elems, 33); FREE(payment_basepoint_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); - LDKPublicKey first_per_commitment_point_arg_ref; - CHECK(first_per_commitment_point_arg->arr_len == 33); - memcpy(first_per_commitment_point_arg_ref.compressed_form, first_per_commitment_point_arg->elems, 33); FREE(first_per_commitment_point_arg); +uint64_t __attribute__((export_name("TS_AcceptChannelV2_new"))) TS_AcceptChannelV2_new(uint64_t common_fields_arg, int64_t funding_satoshis_arg, int8_tArray second_per_commitment_point_arg, uint32_t require_confirmed_inputs_arg) { + LDKCommonAcceptChannelFields common_fields_arg_conv; + common_fields_arg_conv.inner = untag_ptr(common_fields_arg); + common_fields_arg_conv.is_owned = ptr_is_owned(common_fields_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(common_fields_arg_conv); + common_fields_arg_conv = CommonAcceptChannelFields_clone(&common_fields_arg_conv); LDKPublicKey second_per_commitment_point_arg_ref; CHECK(second_per_commitment_point_arg->arr_len == 33); memcpy(second_per_commitment_point_arg_ref.compressed_form, second_per_commitment_point_arg->elems, 33); FREE(second_per_commitment_point_arg); - void* shutdown_scriptpubkey_arg_ptr = untag_ptr(shutdown_scriptpubkey_arg); - CHECK_ACCESS(shutdown_scriptpubkey_arg_ptr); - LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg_conv = *(LDKCOption_CVec_u8ZZ*)(shutdown_scriptpubkey_arg_ptr); - shutdown_scriptpubkey_arg_conv = COption_CVec_u8ZZ_clone((LDKCOption_CVec_u8ZZ*)untag_ptr(shutdown_scriptpubkey_arg)); - LDKChannelTypeFeatures channel_type_arg_conv; - channel_type_arg_conv.inner = untag_ptr(channel_type_arg); - channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv); - channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv); LDKCOption_NoneZ require_confirmed_inputs_arg_conv = LDKCOption_NoneZ_from_js(require_confirmed_inputs_arg); - LDKAcceptChannelV2 ret_var = AcceptChannelV2_new(temporary_channel_id_arg_ref, funding_satoshis_arg, dust_limit_satoshis_arg, max_htlc_value_in_flight_msat_arg, htlc_minimum_msat_arg, minimum_depth_arg, to_self_delay_arg, max_accepted_htlcs_arg, funding_pubkey_arg_ref, revocation_basepoint_arg_ref, payment_basepoint_arg_ref, delayed_payment_basepoint_arg_ref, htlc_basepoint_arg_ref, first_per_commitment_point_arg_ref, second_per_commitment_point_arg_ref, shutdown_scriptpubkey_arg_conv, channel_type_arg_conv, require_confirmed_inputs_arg_conv); + LDKAcceptChannelV2 ret_var = AcceptChannelV2_new(common_fields_arg_conv, funding_satoshis_arg, second_per_commitment_point_arg_ref, require_confirmed_inputs_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); @@ -43281,27 +48098,31 @@ void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_f FundingCreated_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) { LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = FundingCreated_get_temporary_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, uint64_t val) { LDKFundingCreated this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) TS_FundingCreated_get_funding_txid(uint64_t this_ptr) { @@ -43369,17 +48190,19 @@ void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_Funding FundingCreated_set_signature(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_FundingCreated_new"))) TS_FundingCreated_new(int8_tArray temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { - LDKThirtyTwoBytes temporary_channel_id_arg_ref; - CHECK(temporary_channel_id_arg->arr_len == 32); - memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg); +uint64_t __attribute__((export_name("TS_FundingCreated_new"))) TS_FundingCreated_new(uint64_t temporary_channel_id_arg, int8_tArray funding_txid_arg, int16_t funding_output_index_arg, int8_tArray signature_arg) { + LDKChannelId temporary_channel_id_arg_conv; + temporary_channel_id_arg_conv.inner = untag_ptr(temporary_channel_id_arg); + temporary_channel_id_arg_conv.is_owned = ptr_is_owned(temporary_channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_arg_conv); + temporary_channel_id_arg_conv = ChannelId_clone(&temporary_channel_id_arg_conv); LDKThirtyTwoBytes funding_txid_arg_ref; CHECK(funding_txid_arg->arr_len == 32); memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg); LDKECDSASignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); - LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref); + LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_conv, funding_txid_arg_ref, funding_output_index_arg, signature_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); @@ -43449,27 +48272,31 @@ void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_fre FundingSigned_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) { LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *FundingSigned_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = FundingSigned_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKFundingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - FundingSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + FundingSigned_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_FundingSigned_get_signature(uint64_t this_ptr) { @@ -43495,14 +48322,16 @@ void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingS FundingSigned_set_signature(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_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); +uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(uint64_t channel_id_arg, int8_tArray signature_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); - LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref); + LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_conv, signature_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); @@ -43572,27 +48401,31 @@ void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free( ChannelReady_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) { LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *ChannelReady_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ChannelReady_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKChannelReady this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ChannelReady_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + ChannelReady_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_ChannelReady_get_next_per_commitment_point"))) TS_ChannelReady_get_next_per_commitment_point(uint64_t this_ptr) { @@ -43643,10 +48476,12 @@ void __attribute__((export_name("TS_ChannelReady_set_short_channel_id_alias"))) ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelReady_new"))) TS_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, uint64_t short_channel_id_alias_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); +uint64_t __attribute__((export_name("TS_ChannelReady_new"))) TS_ChannelReady_new(uint64_t channel_id_arg, int8_tArray next_per_commitment_point_arg, uint64_t short_channel_id_alias_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); @@ -43654,7 +48489,7 @@ uint64_t __attribute__((export_name("TS_ChannelReady_new"))) TS_ChannelReady_ne CHECK_ACCESS(short_channel_id_alias_arg_ptr); LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr); short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg)); - LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv); + LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_conv, next_per_commitment_point_arg_ref, short_channel_id_alias_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); @@ -43724,27 +48559,31 @@ void __attribute__((export_name("TS_Stfu_free"))) TS_Stfu_free(uint64_t this_ob Stfu_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_Stfu_get_channel_id"))) TS_Stfu_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_Stfu_get_channel_id"))) TS_Stfu_get_channel_id(uint64_t this_ptr) { LDKStfu this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *Stfu_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = Stfu_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_Stfu_set_channel_id"))) TS_Stfu_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_Stfu_set_channel_id"))) TS_Stfu_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKStfu this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Stfu_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + Stfu_set_channel_id(&this_ptr_conv, val_conv); } int8_t __attribute__((export_name("TS_Stfu_get_initiator"))) TS_Stfu_get_initiator(uint64_t this_ptr) { @@ -43766,11 +48605,13 @@ void __attribute__((export_name("TS_Stfu_set_initiator"))) TS_Stfu_set_initiato Stfu_set_initiator(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_Stfu_new"))) TS_Stfu_new(int8_tArray channel_id_arg, int8_t initiator_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); - LDKStfu ret_var = Stfu_new(channel_id_arg_ref, initiator_arg); +uint64_t __attribute__((export_name("TS_Stfu_new"))) TS_Stfu_new(uint64_t channel_id_arg, int8_t initiator_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKStfu ret_var = Stfu_new(channel_id_arg_conv, initiator_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); @@ -43830,27 +48671,31 @@ void __attribute__((export_name("TS_Splice_free"))) TS_Splice_free(uint64_t thi Splice_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_Splice_get_channel_id"))) TS_Splice_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_Splice_get_channel_id"))) TS_Splice_get_channel_id(uint64_t this_ptr) { LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *Splice_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = Splice_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_Splice_set_channel_id"))) TS_Splice_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_Splice_set_channel_id"))) TS_Splice_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKSplice this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Splice_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + Splice_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_Splice_get_chain_hash"))) TS_Splice_get_chain_hash(uint64_t this_ptr) { @@ -43956,17 +48801,19 @@ void __attribute__((export_name("TS_Splice_set_funding_pubkey"))) TS_Splice_set Splice_set_funding_pubkey(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_Splice_new"))) TS_Splice_new(int8_tArray channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_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); +uint64_t __attribute__((export_name("TS_Splice_new"))) TS_Splice_new(uint64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int32_t funding_feerate_perkw_arg, int32_t locktime_arg, int8_tArray funding_pubkey_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); 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); 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); - LDKSplice ret_var = Splice_new(channel_id_arg_ref, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_arg_ref); + LDKSplice ret_var = Splice_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, funding_pubkey_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); @@ -44026,27 +48873,31 @@ void __attribute__((export_name("TS_SpliceAck_free"))) TS_SpliceAck_free(uint64 SpliceAck_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_SpliceAck_get_channel_id"))) TS_SpliceAck_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_SpliceAck_get_channel_id"))) TS_SpliceAck_get_channel_id(uint64_t this_ptr) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *SpliceAck_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = SpliceAck_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_SpliceAck_set_channel_id"))) TS_SpliceAck_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_SpliceAck_set_channel_id"))) TS_SpliceAck_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKSpliceAck this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - SpliceAck_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + SpliceAck_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_SpliceAck_get_chain_hash"))) TS_SpliceAck_get_chain_hash(uint64_t this_ptr) { @@ -44114,17 +48965,19 @@ void __attribute__((export_name("TS_SpliceAck_set_funding_pubkey"))) TS_SpliceA SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_SpliceAck_new"))) TS_SpliceAck_new(int8_tArray channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_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); +uint64_t __attribute__((export_name("TS_SpliceAck_new"))) TS_SpliceAck_new(uint64_t channel_id_arg, int8_tArray chain_hash_arg, int64_t relative_satoshis_arg, int8_tArray funding_pubkey_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); 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); 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); - LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_ref, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_arg_ref); + LDKSpliceAck ret_var = SpliceAck_new(channel_id_arg_conv, chain_hash_arg_ref, relative_satoshis_arg, funding_pubkey_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); @@ -44184,34 +49037,40 @@ void __attribute__((export_name("TS_SpliceLocked_free"))) TS_SpliceLocked_free( SpliceLocked_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_SpliceLocked_get_channel_id"))) TS_SpliceLocked_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_SpliceLocked_get_channel_id"))) TS_SpliceLocked_get_channel_id(uint64_t this_ptr) { LDKSpliceLocked this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *SpliceLocked_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = SpliceLocked_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_SpliceLocked_set_channel_id"))) TS_SpliceLocked_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_SpliceLocked_set_channel_id"))) TS_SpliceLocked_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKSpliceLocked this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - SpliceLocked_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + SpliceLocked_set_channel_id(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_SpliceLocked_new"))) TS_SpliceLocked_new(int8_tArray channel_id_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); - LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_arg_ref); +uint64_t __attribute__((export_name("TS_SpliceLocked_new"))) TS_SpliceLocked_new(uint64_t channel_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKSpliceLocked ret_var = SpliceLocked_new(channel_id_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); @@ -44271,27 +49130,31 @@ void __attribute__((export_name("TS_TxAddInput_free"))) TS_TxAddInput_free(uint TxAddInput_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxAddInput_get_channel_id"))) TS_TxAddInput_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxAddInput_get_channel_id"))) TS_TxAddInput_get_channel_id(uint64_t this_ptr) { LDKTxAddInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxAddInput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAddInput_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxAddInput_set_channel_id"))) TS_TxAddInput_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxAddInput_set_channel_id"))) TS_TxAddInput_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxAddInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxAddInput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxAddInput_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_TxAddInput_get_serial_id"))) TS_TxAddInput_get_serial_id(uint64_t this_ptr) { @@ -44378,16 +49241,18 @@ void __attribute__((export_name("TS_TxAddInput_set_sequence"))) TS_TxAddInput_s TxAddInput_set_sequence(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_TxAddInput_new"))) TS_TxAddInput_new(int8_tArray channel_id_arg, int64_t serial_id_arg, uint64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_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); +uint64_t __attribute__((export_name("TS_TxAddInput_new"))) TS_TxAddInput_new(uint64_t channel_id_arg, int64_t serial_id_arg, uint64_t prevtx_arg, int32_t prevtx_out_arg, int32_t sequence_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKTransactionU16LenLimited prevtx_arg_conv; prevtx_arg_conv.inner = untag_ptr(prevtx_arg); prevtx_arg_conv.is_owned = ptr_is_owned(prevtx_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(prevtx_arg_conv); prevtx_arg_conv = TransactionU16LenLimited_clone(&prevtx_arg_conv); - LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_ref, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_arg); + LDKTxAddInput ret_var = TxAddInput_new(channel_id_arg_conv, serial_id_arg, prevtx_arg_conv, prevtx_out_arg, sequence_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); @@ -44457,27 +49322,31 @@ void __attribute__((export_name("TS_TxAddOutput_free"))) TS_TxAddOutput_free(ui TxAddOutput_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxAddOutput_get_channel_id"))) TS_TxAddOutput_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxAddOutput_get_channel_id"))) TS_TxAddOutput_get_channel_id(uint64_t this_ptr) { LDKTxAddOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxAddOutput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAddOutput_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxAddOutput_set_channel_id"))) TS_TxAddOutput_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxAddOutput_set_channel_id"))) TS_TxAddOutput_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxAddOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxAddOutput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxAddOutput_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_TxAddOutput_get_serial_id"))) TS_TxAddOutput_get_serial_id(uint64_t this_ptr) { @@ -44544,15 +49413,17 @@ void __attribute__((export_name("TS_TxAddOutput_set_script"))) TS_TxAddOutput_s TxAddOutput_set_script(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_TxAddOutput_new"))) TS_TxAddOutput_new(int8_tArray channel_id_arg, int64_t serial_id_arg, int64_t sats_arg, int8_tArray script_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); +uint64_t __attribute__((export_name("TS_TxAddOutput_new"))) TS_TxAddOutput_new(uint64_t channel_id_arg, int64_t serial_id_arg, int64_t sats_arg, int8_tArray script_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); 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); - LDKTxAddOutput ret_var = TxAddOutput_new(channel_id_arg_ref, serial_id_arg, sats_arg, script_arg_ref); + LDKTxAddOutput ret_var = TxAddOutput_new(channel_id_arg_conv, serial_id_arg, sats_arg, 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); @@ -44622,27 +49493,31 @@ void __attribute__((export_name("TS_TxRemoveInput_free"))) TS_TxRemoveInput_fre TxRemoveInput_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxRemoveInput_get_channel_id"))) TS_TxRemoveInput_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxRemoveInput_get_channel_id"))) TS_TxRemoveInput_get_channel_id(uint64_t this_ptr) { LDKTxRemoveInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxRemoveInput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxRemoveInput_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxRemoveInput_set_channel_id"))) TS_TxRemoveInput_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxRemoveInput_set_channel_id"))) TS_TxRemoveInput_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxRemoveInput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxRemoveInput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxRemoveInput_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_TxRemoveInput_get_serial_id"))) TS_TxRemoveInput_get_serial_id(uint64_t this_ptr) { @@ -44664,11 +49539,13 @@ void __attribute__((export_name("TS_TxRemoveInput_set_serial_id"))) TS_TxRemove TxRemoveInput_set_serial_id(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_TxRemoveInput_new"))) TS_TxRemoveInput_new(int8_tArray channel_id_arg, int64_t serial_id_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); - LDKTxRemoveInput ret_var = TxRemoveInput_new(channel_id_arg_ref, serial_id_arg); +uint64_t __attribute__((export_name("TS_TxRemoveInput_new"))) TS_TxRemoveInput_new(uint64_t channel_id_arg, int64_t serial_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKTxRemoveInput ret_var = TxRemoveInput_new(channel_id_arg_conv, serial_id_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); @@ -44738,27 +49615,31 @@ void __attribute__((export_name("TS_TxRemoveOutput_free"))) TS_TxRemoveOutput_f TxRemoveOutput_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxRemoveOutput_get_channel_id"))) TS_TxRemoveOutput_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxRemoveOutput_get_channel_id"))) TS_TxRemoveOutput_get_channel_id(uint64_t this_ptr) { LDKTxRemoveOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxRemoveOutput_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxRemoveOutput_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxRemoveOutput_set_channel_id"))) TS_TxRemoveOutput_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxRemoveOutput_set_channel_id"))) TS_TxRemoveOutput_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxRemoveOutput this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxRemoveOutput_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxRemoveOutput_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_TxRemoveOutput_get_serial_id"))) TS_TxRemoveOutput_get_serial_id(uint64_t this_ptr) { @@ -44780,11 +49661,13 @@ void __attribute__((export_name("TS_TxRemoveOutput_set_serial_id"))) TS_TxRemov TxRemoveOutput_set_serial_id(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_TxRemoveOutput_new"))) TS_TxRemoveOutput_new(int8_tArray channel_id_arg, int64_t serial_id_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); - LDKTxRemoveOutput ret_var = TxRemoveOutput_new(channel_id_arg_ref, serial_id_arg); +uint64_t __attribute__((export_name("TS_TxRemoveOutput_new"))) TS_TxRemoveOutput_new(uint64_t channel_id_arg, int64_t serial_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKTxRemoveOutput ret_var = TxRemoveOutput_new(channel_id_arg_conv, serial_id_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); @@ -44854,34 +49737,40 @@ void __attribute__((export_name("TS_TxComplete_free"))) TS_TxComplete_free(uint TxComplete_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxComplete_get_channel_id"))) TS_TxComplete_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxComplete_get_channel_id"))) TS_TxComplete_get_channel_id(uint64_t this_ptr) { LDKTxComplete this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxComplete_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxComplete_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxComplete_set_channel_id"))) TS_TxComplete_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxComplete_set_channel_id"))) TS_TxComplete_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxComplete this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxComplete_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxComplete_set_channel_id(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_TxComplete_new"))) TS_TxComplete_new(int8_tArray channel_id_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); - LDKTxComplete ret_var = TxComplete_new(channel_id_arg_ref); +uint64_t __attribute__((export_name("TS_TxComplete_new"))) TS_TxComplete_new(uint64_t channel_id_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKTxComplete ret_var = TxComplete_new(channel_id_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); @@ -44951,27 +49840,31 @@ void __attribute__((export_name("TS_TxSignatures_free"))) TS_TxSignatures_free( TxSignatures_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxSignatures_get_channel_id"))) TS_TxSignatures_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxSignatures_get_channel_id"))) TS_TxSignatures_get_channel_id(uint64_t this_ptr) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxSignatures_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxSignatures_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxSignatures_set_channel_id"))) TS_TxSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxSignatures_set_channel_id"))) TS_TxSignatures_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxSignatures_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxSignatures_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_TxSignatures_get_tx_hash"))) TS_TxSignatures_get_tx_hash(uint64_t this_ptr) { @@ -45045,10 +49938,37 @@ void __attribute__((export_name("TS_TxSignatures_set_witnesses"))) TS_TxSignatu TxSignatures_set_witnesses(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_TxSignatures_new"))) TS_TxSignatures_new(int8_tArray channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_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); +uint64_t __attribute__((export_name("TS_TxSignatures_get_funding_outpoint_sig"))) TS_TxSignatures_get_funding_outpoint_sig(uint64_t this_ptr) { + LDKTxSignatures this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = TxSignatures_get_funding_outpoint_sig(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_TxSignatures_set_funding_outpoint_sig"))) TS_TxSignatures_set_funding_outpoint_sig(uint64_t this_ptr, uint64_t val) { + LDKTxSignatures this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_ECDSASignatureZ val_conv = *(LDKCOption_ECDSASignatureZ*)(val_ptr); + val_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(val)); + TxSignatures_set_funding_outpoint_sig(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_TxSignatures_new"))) TS_TxSignatures_new(uint64_t channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg, uint64_t funding_outpoint_sig_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes tx_hash_arg_ref; CHECK(tx_hash_arg->arr_len == 32); memcpy(tx_hash_arg_ref.data, tx_hash_arg->elems, 32); FREE(tx_hash_arg); @@ -45069,7 +49989,11 @@ uint64_t __attribute__((export_name("TS_TxSignatures_new"))) TS_TxSignatures_ne witnesses_arg_constr.data[m] = witnesses_arg_conv_12_ref; } FREE(witnesses_arg); - LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_ref, tx_hash_arg_ref, witnesses_arg_constr); + void* funding_outpoint_sig_arg_ptr = untag_ptr(funding_outpoint_sig_arg); + CHECK_ACCESS(funding_outpoint_sig_arg_ptr); + LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg_conv = *(LDKCOption_ECDSASignatureZ*)(funding_outpoint_sig_arg_ptr); + funding_outpoint_sig_arg_conv = COption_ECDSASignatureZ_clone((LDKCOption_ECDSASignatureZ*)untag_ptr(funding_outpoint_sig_arg)); + LDKTxSignatures ret_var = TxSignatures_new(channel_id_arg_conv, tx_hash_arg_ref, witnesses_arg_constr, funding_outpoint_sig_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); @@ -45139,27 +50063,31 @@ void __attribute__((export_name("TS_TxInitRbf_free"))) TS_TxInitRbf_free(uint64 TxInitRbf_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxInitRbf_get_channel_id"))) TS_TxInitRbf_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxInitRbf_get_channel_id"))) TS_TxInitRbf_get_channel_id(uint64_t this_ptr) { LDKTxInitRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxInitRbf_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxInitRbf_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxInitRbf_set_channel_id"))) TS_TxInitRbf_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxInitRbf_set_channel_id"))) TS_TxInitRbf_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxInitRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxInitRbf_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxInitRbf_set_channel_id(&this_ptr_conv, val_conv); } int32_t __attribute__((export_name("TS_TxInitRbf_get_locktime"))) TS_TxInitRbf_get_locktime(uint64_t this_ptr) { @@ -45225,15 +50153,17 @@ void __attribute__((export_name("TS_TxInitRbf_set_funding_output_contribution") TxInitRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_TxInitRbf_new"))) TS_TxInitRbf_new(int8_tArray channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, uint64_t funding_output_contribution_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); +uint64_t __attribute__((export_name("TS_TxInitRbf_new"))) TS_TxInitRbf_new(uint64_t channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, uint64_t funding_output_contribution_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); void* funding_output_contribution_arg_ptr = untag_ptr(funding_output_contribution_arg); CHECK_ACCESS(funding_output_contribution_arg_ptr); LDKCOption_i64Z funding_output_contribution_arg_conv = *(LDKCOption_i64Z*)(funding_output_contribution_arg_ptr); funding_output_contribution_arg_conv = COption_i64Z_clone((LDKCOption_i64Z*)untag_ptr(funding_output_contribution_arg)); - LDKTxInitRbf ret_var = TxInitRbf_new(channel_id_arg_ref, locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg_conv); + LDKTxInitRbf ret_var = TxInitRbf_new(channel_id_arg_conv, locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_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); @@ -45303,27 +50233,31 @@ void __attribute__((export_name("TS_TxAckRbf_free"))) TS_TxAckRbf_free(uint64_t TxAckRbf_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxAckRbf_get_channel_id"))) TS_TxAckRbf_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxAckRbf_get_channel_id"))) TS_TxAckRbf_get_channel_id(uint64_t this_ptr) { LDKTxAckRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxAckRbf_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAckRbf_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxAckRbf_set_channel_id"))) TS_TxAckRbf_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxAckRbf_set_channel_id"))) TS_TxAckRbf_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxAckRbf this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxAckRbf_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxAckRbf_set_channel_id(&this_ptr_conv, val_conv); } uint64_t __attribute__((export_name("TS_TxAckRbf_get_funding_output_contribution"))) TS_TxAckRbf_get_funding_output_contribution(uint64_t this_ptr) { @@ -45351,15 +50285,17 @@ void __attribute__((export_name("TS_TxAckRbf_set_funding_output_contribution")) TxAckRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_TxAckRbf_new"))) TS_TxAckRbf_new(int8_tArray channel_id_arg, uint64_t funding_output_contribution_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); +uint64_t __attribute__((export_name("TS_TxAckRbf_new"))) TS_TxAckRbf_new(uint64_t channel_id_arg, uint64_t funding_output_contribution_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); void* funding_output_contribution_arg_ptr = untag_ptr(funding_output_contribution_arg); CHECK_ACCESS(funding_output_contribution_arg_ptr); LDKCOption_i64Z funding_output_contribution_arg_conv = *(LDKCOption_i64Z*)(funding_output_contribution_arg_ptr); funding_output_contribution_arg_conv = COption_i64Z_clone((LDKCOption_i64Z*)untag_ptr(funding_output_contribution_arg)); - LDKTxAckRbf ret_var = TxAckRbf_new(channel_id_arg_ref, funding_output_contribution_arg_conv); + LDKTxAckRbf ret_var = TxAckRbf_new(channel_id_arg_conv, funding_output_contribution_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); @@ -45429,27 +50365,31 @@ void __attribute__((export_name("TS_TxAbort_free"))) TS_TxAbort_free(uint64_t t TxAbort_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_TxAbort_get_channel_id"))) TS_TxAbort_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_TxAbort_get_channel_id"))) TS_TxAbort_get_channel_id(uint64_t this_ptr) { LDKTxAbort this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *TxAbort_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = TxAbort_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_TxAbort_set_channel_id"))) TS_TxAbort_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_TxAbort_set_channel_id"))) TS_TxAbort_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKTxAbort this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - TxAbort_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + TxAbort_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_TxAbort_get_data"))) TS_TxAbort_get_data(uint64_t this_ptr) { @@ -45478,15 +50418,17 @@ void __attribute__((export_name("TS_TxAbort_set_data"))) TS_TxAbort_set_data(ui TxAbort_set_data(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_TxAbort_new"))) TS_TxAbort_new(int8_tArray channel_id_arg, int8_tArray data_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); +uint64_t __attribute__((export_name("TS_TxAbort_new"))) TS_TxAbort_new(uint64_t channel_id_arg, int8_tArray data_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKCVec_u8Z data_arg_ref; data_arg_ref.datalen = data_arg->arr_len; data_arg_ref.data = MALLOC(data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(data_arg_ref.data, data_arg->elems, data_arg_ref.datalen); FREE(data_arg); - LDKTxAbort ret_var = TxAbort_new(channel_id_arg_ref, data_arg_ref); + LDKTxAbort ret_var = TxAbort_new(channel_id_arg_conv, 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); @@ -45556,27 +50498,31 @@ void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t Shutdown_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) { LDKShutdown this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *Shutdown_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = Shutdown_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKShutdown this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - Shutdown_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + Shutdown_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shutdown_get_scriptpubkey(uint64_t this_ptr) { @@ -45605,15 +50551,17 @@ void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_s Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_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); +uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(uint64_t channel_id_arg, int8_tArray scriptpubkey_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKCVec_u8Z scriptpubkey_arg_ref; scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len; scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes"); memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg); - LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref); + LDKShutdown ret_var = Shutdown_new(channel_id_arg_conv, scriptpubkey_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); @@ -45792,27 +50740,31 @@ void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_fre ClosingSigned_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) { LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *ClosingSigned_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ClosingSigned_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKClosingSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ClosingSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + ClosingSigned_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_ClosingSigned_get_fee_satoshis"))) TS_ClosingSigned_get_fee_satoshis(uint64_t this_ptr) { @@ -45884,10 +50836,12 @@ void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingS ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, uint64_t fee_range_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); +uint64_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_new(uint64_t channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, uint64_t fee_range_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); @@ -45896,7 +50850,7 @@ uint64_t __attribute__((export_name("TS_ClosingSigned_new"))) TS_ClosingSigned_ fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv); fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv); - LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv); + LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_conv, fee_satoshis_arg, signature_arg_ref, fee_range_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); @@ -45966,27 +50920,31 @@ void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_fre UpdateAddHTLC_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) { LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateAddHTLC_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKUpdateAddHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_htlc_id"))) TS_UpdateAddHTLC_get_htlc_id(uint64_t this_ptr) { @@ -46144,10 +51102,12 @@ void __attribute__((export_name("TS_UpdateAddHTLC_set_blinding_point"))) TS_Upd UpdateAddHTLC_set_blinding_point(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_UpdateAddHTLC_new"))) TS_UpdateAddHTLC_new(int8_tArray channel_id_arg, int64_t htlc_id_arg, int64_t amount_msat_arg, int8_tArray payment_hash_arg, int32_t cltv_expiry_arg, uint64_t skimmed_fee_msat_arg, uint64_t onion_routing_packet_arg, int8_tArray blinding_point_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); +uint64_t __attribute__((export_name("TS_UpdateAddHTLC_new"))) TS_UpdateAddHTLC_new(uint64_t channel_id_arg, int64_t htlc_id_arg, int64_t amount_msat_arg, int8_tArray payment_hash_arg, int32_t cltv_expiry_arg, uint64_t skimmed_fee_msat_arg, uint64_t onion_routing_packet_arg, int8_tArray blinding_point_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); 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); @@ -46163,7 +51123,7 @@ uint64_t __attribute__((export_name("TS_UpdateAddHTLC_new"))) TS_UpdateAddHTLC_ 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); - LDKUpdateAddHTLC ret_var = UpdateAddHTLC_new(channel_id_arg_ref, htlc_id_arg, amount_msat_arg, payment_hash_arg_ref, cltv_expiry_arg, skimmed_fee_msat_arg_conv, onion_routing_packet_arg_conv, blinding_point_arg_ref); + LDKUpdateAddHTLC ret_var = UpdateAddHTLC_new(channel_id_arg_conv, htlc_id_arg, amount_msat_arg, payment_hash_arg_ref, cltv_expiry_arg, skimmed_fee_msat_arg_conv, onion_routing_packet_arg_conv, blinding_point_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); @@ -46362,27 +51322,31 @@ void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfill UpdateFulfillHTLC_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) { LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFulfillHTLC_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKUpdateFulfillHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_htlc_id"))) TS_UpdateFulfillHTLC_get_htlc_id(uint64_t this_ptr) { @@ -46427,14 +51391,16 @@ void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_new"))) TS_UpdateFulfillHTLC_new(int8_tArray channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_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); +uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_new"))) TS_UpdateFulfillHTLC_new(uint64_t channel_id_arg, int64_t htlc_id_arg, int8_tArray payment_preimage_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes payment_preimage_arg_ref; CHECK(payment_preimage_arg->arr_len == 32); memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg); - LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref); + LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_conv, htlc_id_arg, payment_preimage_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); @@ -46504,27 +51470,31 @@ void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_f UpdateFailHTLC_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) { LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFailHTLC_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKUpdateFailHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_UpdateFailHTLC_get_htlc_id"))) TS_UpdateFailHTLC_get_htlc_id(uint64_t this_ptr) { @@ -46609,27 +51579,31 @@ void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateF UpdateFailMalformedHTLC_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKUpdateFailMalformedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_htlc_id"))) TS_UpdateFailMalformedHTLC_get_htlc_id(uint64_t this_ptr) { @@ -46733,27 +51707,31 @@ void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSign CommitmentSigned_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) { LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = CommitmentSigned_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKCommitmentSigned this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + CommitmentSigned_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) TS_CommitmentSigned_get_signature(uint64_t this_ptr) { @@ -46823,10 +51801,12 @@ void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_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); +uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(uint64_t channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature signature_arg_ref; CHECK(signature_arg->arr_len == 64); memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg); @@ -46845,7 +51825,7 @@ uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentS htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref; } FREE(htlc_signatures_arg); - LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr); + LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_conv, signature_arg_ref, htlc_signatures_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); @@ -46915,27 +51895,31 @@ void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free( RevokeAndACK_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) { LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = RevokeAndACK_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKRevokeAndACK this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + RevokeAndACK_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secret"))) TS_RevokeAndACK_get_per_commitment_secret(uint64_t this_ptr) { @@ -46984,17 +51968,19 @@ void __attribute__((export_name("TS_RevokeAndACK_set_next_per_commitment_point" RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_RevokeAndACK_new"))) TS_RevokeAndACK_new(int8_tArray channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_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); +uint64_t __attribute__((export_name("TS_RevokeAndACK_new"))) TS_RevokeAndACK_new(uint64_t channel_id_arg, int8_tArray per_commitment_secret_arg, int8_tArray next_per_commitment_point_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes per_commitment_secret_arg_ref; CHECK(per_commitment_secret_arg->arr_len == 32); memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg); LDKPublicKey next_per_commitment_point_arg_ref; CHECK(next_per_commitment_point_arg->arr_len == 33); memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg); - LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref); + LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_conv, per_commitment_secret_arg_ref, next_per_commitment_point_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); @@ -47064,27 +52050,31 @@ void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64 UpdateFee_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) { LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *UpdateFee_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = UpdateFee_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKUpdateFee this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - UpdateFee_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + UpdateFee_set_channel_id(&this_ptr_conv, val_conv); } int32_t __attribute__((export_name("TS_UpdateFee_get_feerate_per_kw"))) TS_UpdateFee_get_feerate_per_kw(uint64_t this_ptr) { @@ -47106,11 +52096,13 @@ void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateF UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_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); - LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg); +uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(uint64_t channel_id_arg, int32_t feerate_per_kw_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); + LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_conv, feerate_per_kw_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); @@ -47180,27 +52172,31 @@ void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReest ChannelReestablish_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) { LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ChannelReestablish_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKChannelReestablish this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + ChannelReestablish_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_local_commitment_number"))) TS_ChannelReestablish_get_next_local_commitment_number(uint64_t this_ptr) { @@ -47312,10 +52308,12 @@ void __attribute__((export_name("TS_ChannelReestablish_set_next_funding_txid")) ChannelReestablish_set_next_funding_txid(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ChannelReestablish_new"))) TS_ChannelReestablish_new(int8_tArray channel_id_arg, int64_t next_local_commitment_number_arg, int64_t next_remote_commitment_number_arg, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg, uint64_t next_funding_txid_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); +uint64_t __attribute__((export_name("TS_ChannelReestablish_new"))) TS_ChannelReestablish_new(uint64_t channel_id_arg, int64_t next_local_commitment_number_arg, int64_t next_remote_commitment_number_arg, int8_tArray your_last_per_commitment_secret_arg, int8_tArray my_current_per_commitment_point_arg, uint64_t next_funding_txid_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref; CHECK(your_last_per_commitment_secret_arg->arr_len == 32); memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg); @@ -47326,7 +52324,7 @@ uint64_t __attribute__((export_name("TS_ChannelReestablish_new"))) TS_ChannelRe CHECK_ACCESS(next_funding_txid_arg_ptr); LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(next_funding_txid_arg_ptr); next_funding_txid_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(next_funding_txid_arg)); - LDKChannelReestablish ret_var = ChannelReestablish_new(channel_id_arg_ref, next_local_commitment_number_arg, next_remote_commitment_number_arg, your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref, next_funding_txid_arg_conv); + LDKChannelReestablish ret_var = ChannelReestablish_new(channel_id_arg_conv, next_local_commitment_number_arg, next_remote_commitment_number_arg, your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref, next_funding_txid_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); @@ -47396,27 +52394,31 @@ void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_Announce AnnouncementSignatures_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) { LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = AnnouncementSignatures_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKAnnouncementSignatures this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_conv); } int64_t __attribute__((export_name("TS_AnnouncementSignatures_get_short_channel_id"))) TS_AnnouncementSignatures_get_short_channel_id(uint64_t this_ptr) { @@ -47484,17 +52486,19 @@ void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signatur AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } -uint64_t __attribute__((export_name("TS_AnnouncementSignatures_new"))) TS_AnnouncementSignatures_new(int8_tArray channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_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); +uint64_t __attribute__((export_name("TS_AnnouncementSignatures_new"))) TS_AnnouncementSignatures_new(uint64_t channel_id_arg, int64_t short_channel_id_arg, int8_tArray node_signature_arg, int8_tArray bitcoin_signature_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); LDKECDSASignature node_signature_arg_ref; CHECK(node_signature_arg->arr_len == 64); memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg); LDKECDSASignature bitcoin_signature_arg_ref; CHECK(bitcoin_signature_arg->arr_len == 64); memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg); - LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref); + LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_conv, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_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); @@ -47708,6 +52712,14 @@ jboolean __attribute__((export_name("TS_SocketAddressParseError_eq"))) TS_Socke return ret_conv; } +jstring __attribute__((export_name("TS_SocketAddressParseError_to_str"))) TS_SocketAddressParseError_to_str(uint64_t o) { + LDKSocketAddressParseError* o_conv = (LDKSocketAddressParseError*)untag_ptr(o); + LDKStr ret_str = SocketAddressParseError_to_str(o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + uint64_t __attribute__((export_name("TS_parse_onion_address"))) TS_parse_onion_address(jstring host, int16_t port) { LDKStr host_conv = str_ref_to_owned_c(host); LDKCResult_SocketAddressSocketAddressParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SocketAddressSocketAddressParseErrorZ), "LDKCResult_SocketAddressSocketAddressParseErrorZ"); @@ -47974,6 +52986,107 @@ void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_excess_address_data"))) TS_UnsignedNodeAnnouncement_get_excess_address_data(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; + LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_get_excess_address_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_UnsignedNodeAnnouncement_set_excess_address_data"))) TS_UnsignedNodeAnnouncement_set_excess_address_data(uint64_t this_ptr, int8_tArray 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; + 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); + UnsignedNodeAnnouncement_set_excess_address_data(&this_ptr_conv, val_ref); +} + +int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_excess_data"))) TS_UnsignedNodeAnnouncement_get_excess_data(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; + LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_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_UnsignedNodeAnnouncement_set_excess_data"))) TS_UnsignedNodeAnnouncement_set_excess_data(uint64_t this_ptr, int8_tArray 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; + 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); + UnsignedNodeAnnouncement_set_excess_data(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_new"))) TS_UnsignedNodeAnnouncement_new(uint64_t features_arg, int32_t timestamp_arg, uint64_t node_id_arg, int8_tArray rgb_arg, uint64_t alias_arg, uint64_tArray addresses_arg, int8_tArray excess_address_data_arg, int8_tArray excess_data_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); + LDKNodeId node_id_arg_conv; + node_id_arg_conv.inner = untag_ptr(node_id_arg); + node_id_arg_conv.is_owned = ptr_is_owned(node_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_arg_conv); + node_id_arg_conv = NodeId_clone(&node_id_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_SocketAddressZ 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(LDKSocketAddress), "LDKCVec_SocketAddressZ Elements"); + else + addresses_arg_constr.data = NULL; + uint64_t* addresses_arg_vals = addresses_arg->elems; + for (size_t p = 0; p < addresses_arg_constr.datalen; p++) { + uint64_t addresses_arg_conv_15 = addresses_arg_vals[p]; + void* addresses_arg_conv_15_ptr = untag_ptr(addresses_arg_conv_15); + CHECK_ACCESS(addresses_arg_conv_15_ptr); + LDKSocketAddress addresses_arg_conv_15_conv = *(LDKSocketAddress*)(addresses_arg_conv_15_ptr); + addresses_arg_constr.data[p] = addresses_arg_conv_15_conv; + } + FREE(addresses_arg); + LDKCVec_u8Z excess_address_data_arg_ref; + excess_address_data_arg_ref.datalen = excess_address_data_arg->arr_len; + excess_address_data_arg_ref.data = MALLOC(excess_address_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(excess_address_data_arg_ref.data, excess_address_data_arg->elems, excess_address_data_arg_ref.datalen); FREE(excess_address_data_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); + LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_new(features_arg_conv, timestamp_arg, node_id_arg_conv, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, excess_address_data_arg_ref, 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 UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) { LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg); uint64_t ret_ref = 0; @@ -50666,6 +55779,199 @@ jboolean __attribute__((export_name("TS_OnionPacket_eq"))) TS_OnionPacket_eq(ui return ret_conv; } +void __attribute__((export_name("TS_TrampolineOnionPacket_free"))) TS_TrampolineOnionPacket_free(uint64_t this_obj) { + LDKTrampolineOnionPacket 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); + TrampolineOnionPacket_free(this_obj_conv); +} + +int8_t __attribute__((export_name("TS_TrampolineOnionPacket_get_version"))) TS_TrampolineOnionPacket_get_version(uint64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = TrampolineOnionPacket_get_version(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_TrampolineOnionPacket_set_version"))) TS_TrampolineOnionPacket_set_version(uint64_t this_ptr, int8_t val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + TrampolineOnionPacket_set_version(&this_ptr_conv, val); +} + +int8_tArray __attribute__((export_name("TS_TrampolineOnionPacket_get_public_key"))) TS_TrampolineOnionPacket_get_public_key(uint64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, TrampolineOnionPacket_get_public_key(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_TrampolineOnionPacket_set_public_key"))) TS_TrampolineOnionPacket_set_public_key(uint64_t this_ptr, int8_tArray val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + TrampolineOnionPacket_set_public_key(&this_ptr_conv, val_ref); +} + +int8_tArray __attribute__((export_name("TS_TrampolineOnionPacket_get_hop_data"))) TS_TrampolineOnionPacket_get_hop_data(uint64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = TrampolineOnionPacket_get_hop_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_TrampolineOnionPacket_set_hop_data"))) TS_TrampolineOnionPacket_set_hop_data(uint64_t this_ptr, int8_tArray val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + TrampolineOnionPacket_set_hop_data(&this_ptr_conv, val_ref); +} + +int8_tArray __attribute__((export_name("TS_TrampolineOnionPacket_get_hmac"))) TS_TrampolineOnionPacket_get_hmac(uint64_t this_ptr) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *TrampolineOnionPacket_get_hmac(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_TrampolineOnionPacket_set_hmac"))) TS_TrampolineOnionPacket_set_hmac(uint64_t this_ptr, int8_tArray val) { + LDKTrampolineOnionPacket this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + TrampolineOnionPacket_set_hmac(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_TrampolineOnionPacket_new"))) TS_TrampolineOnionPacket_new(int8_t version_arg, int8_tArray public_key_arg, int8_tArray hop_data_arg, int8_tArray hmac_arg) { + LDKPublicKey public_key_arg_ref; + CHECK(public_key_arg->arr_len == 33); + memcpy(public_key_arg_ref.compressed_form, public_key_arg->elems, 33); FREE(public_key_arg); + LDKCVec_u8Z hop_data_arg_ref; + hop_data_arg_ref.datalen = hop_data_arg->arr_len; + hop_data_arg_ref.data = MALLOC(hop_data_arg_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(hop_data_arg_ref.data, hop_data_arg->elems, hop_data_arg_ref.datalen); FREE(hop_data_arg); + LDKThirtyTwoBytes hmac_arg_ref; + CHECK(hmac_arg->arr_len == 32); + memcpy(hmac_arg_ref.data, hmac_arg->elems, 32); FREE(hmac_arg); + LDKTrampolineOnionPacket ret_var = TrampolineOnionPacket_new(version_arg, public_key_arg_ref, hop_data_arg_ref, hmac_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 TrampolineOnionPacket_clone_ptr(LDKTrampolineOnionPacket *NONNULL_PTR arg) { + LDKTrampolineOnionPacket ret_var = TrampolineOnionPacket_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_TrampolineOnionPacket_clone_ptr"))) TS_TrampolineOnionPacket_clone_ptr(uint64_t arg) { + LDKTrampolineOnionPacket 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 = TrampolineOnionPacket_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_TrampolineOnionPacket_clone"))) TS_TrampolineOnionPacket_clone(uint64_t orig) { + LDKTrampolineOnionPacket 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; + LDKTrampolineOnionPacket ret_var = TrampolineOnionPacket_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_TrampolineOnionPacket_hash"))) TS_TrampolineOnionPacket_hash(uint64_t o) { + LDKTrampolineOnionPacket 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 = TrampolineOnionPacket_hash(&o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_TrampolineOnionPacket_eq"))) TS_TrampolineOnionPacket_eq(uint64_t a, uint64_t b) { + LDKTrampolineOnionPacket 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; + LDKTrampolineOnionPacket 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 = TrampolineOnionPacket_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_TrampolineOnionPacket_write"))) TS_TrampolineOnionPacket_write(uint64_t obj) { + LDKTrampolineOnionPacket 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 = TrampolineOnionPacket_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; +} + +jstring __attribute__((export_name("TS_DecodeError_to_str"))) TS_DecodeError_to_str(uint64_t o) { + LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); + LDKStr ret_str = DecodeError_to_str(o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) { LDKAcceptChannel obj_conv; obj_conv.inner = untag_ptr(obj); @@ -52183,6 +57489,127 @@ void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescript SocketDescriptor_free(this_ptr_conv); } +void __attribute__((export_name("TS_PeerDetails_free"))) TS_PeerDetails_free(uint64_t this_obj) { + LDKPeerDetails 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); + PeerDetails_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_PeerDetails_get_counterparty_node_id"))) TS_PeerDetails_get_counterparty_node_id(uint64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, PeerDetails_get_counterparty_node_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_PeerDetails_set_counterparty_node_id"))) TS_PeerDetails_set_counterparty_node_id(uint64_t this_ptr, int8_tArray val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + PeerDetails_set_counterparty_node_id(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_PeerDetails_get_socket_address"))) TS_PeerDetails_get_socket_address(uint64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_SocketAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_SocketAddressZ), "LDKCOption_SocketAddressZ"); + *ret_copy = PeerDetails_get_socket_address(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_PeerDetails_set_socket_address"))) TS_PeerDetails_set_socket_address(uint64_t this_ptr, uint64_t val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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_SocketAddressZ val_conv = *(LDKCOption_SocketAddressZ*)(val_ptr); + val_conv = COption_SocketAddressZ_clone((LDKCOption_SocketAddressZ*)untag_ptr(val)); + PeerDetails_set_socket_address(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_PeerDetails_get_init_features"))) TS_PeerDetails_get_init_features(uint64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures ret_var = PeerDetails_get_init_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_PeerDetails_set_init_features"))) TS_PeerDetails_set_init_features(uint64_t this_ptr, uint64_t val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInitFeatures 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 = InitFeatures_clone(&val_conv); + PeerDetails_set_init_features(&this_ptr_conv, val_conv); +} + +jboolean __attribute__((export_name("TS_PeerDetails_get_is_inbound_connection"))) TS_PeerDetails_get_is_inbound_connection(uint64_t this_ptr) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = PeerDetails_get_is_inbound_connection(&this_ptr_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_PeerDetails_set_is_inbound_connection"))) TS_PeerDetails_set_is_inbound_connection(uint64_t this_ptr, jboolean val) { + LDKPeerDetails this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + PeerDetails_set_is_inbound_connection(&this_ptr_conv, val); +} + +uint64_t __attribute__((export_name("TS_PeerDetails_new"))) TS_PeerDetails_new(int8_tArray counterparty_node_id_arg, uint64_t socket_address_arg, uint64_t init_features_arg, jboolean is_inbound_connection_arg) { + LDKPublicKey counterparty_node_id_arg_ref; + CHECK(counterparty_node_id_arg->arr_len == 33); + memcpy(counterparty_node_id_arg_ref.compressed_form, counterparty_node_id_arg->elems, 33); FREE(counterparty_node_id_arg); + void* socket_address_arg_ptr = untag_ptr(socket_address_arg); + CHECK_ACCESS(socket_address_arg_ptr); + LDKCOption_SocketAddressZ socket_address_arg_conv = *(LDKCOption_SocketAddressZ*)(socket_address_arg_ptr); + LDKInitFeatures init_features_arg_conv; + init_features_arg_conv.inner = untag_ptr(init_features_arg); + init_features_arg_conv.is_owned = ptr_is_owned(init_features_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(init_features_arg_conv); + init_features_arg_conv = InitFeatures_clone(&init_features_arg_conv); + LDKPeerDetails ret_var = PeerDetails_new(counterparty_node_id_arg_ref, socket_address_arg_conv, init_features_arg_conv, is_inbound_connection_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_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) { LDKPeerHandleError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52229,6 +57656,18 @@ uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandle return ret_ref; } +jstring __attribute__((export_name("TS_PeerHandleError_to_str"))) TS_PeerHandleError_to_str(uint64_t o) { + LDKPeerHandleError 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; + LDKStr ret_str = PeerHandleError_to_str(&o_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_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) { LDKPeerManager this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52269,26 +57708,44 @@ uint64_t __attribute__((export_name("TS_PeerManager_new"))) TS_PeerManager_new( return ret_ref; } -uint64_tArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) { +uint64_tArray __attribute__((export_name("TS_PeerManager_list_peers"))) TS_PeerManager_list_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; - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv); + LDKCVec_PeerDetailsZ ret_var = PeerManager_list_peers(&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 r = 0; r < ret_var.datalen; r++) { - LDKC2Tuple_PublicKeyCOption_SocketAddressZZ* ret_conv_43_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ), "LDKC2Tuple_PublicKeyCOption_SocketAddressZZ"); - *ret_conv_43_conv = ret_var.data[r]; - ret_arr_ptr[r] = tag_ptr(ret_conv_43_conv, true); + for (size_t n = 0; n < ret_var.datalen; n++) { + LDKPeerDetails 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; } +uint64_t __attribute__((export_name("TS_PeerManager_peer_by_node_id"))) TS_PeerManager_peer_by_node_id(uint64_t this_arg, int8_tArray their_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 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); + LDKPeerDetails ret_var = PeerManager_peer_by_node_id(&this_arg_conv, their_node_id_ref); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + 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); @@ -58121,6 +63578,120 @@ jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_No return ret_conv; } +void __attribute__((export_name("TS_InitFeatures_set_trampoline_routing_optional"))) TS_InitFeatures_set_trampoline_routing_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_trampoline_routing_optional(&this_arg_conv); +} + +void __attribute__((export_name("TS_InitFeatures_set_trampoline_routing_required"))) TS_InitFeatures_set_trampoline_routing_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_trampoline_routing_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_InitFeatures_supports_trampoline_routing"))) TS_InitFeatures_supports_trampoline_routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_NodeFeatures_set_trampoline_routing_optional"))) TS_NodeFeatures_set_trampoline_routing_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_trampoline_routing_optional(&this_arg_conv); +} + +void __attribute__((export_name("TS_NodeFeatures_set_trampoline_routing_required"))) TS_NodeFeatures_set_trampoline_routing_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_trampoline_routing_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_NodeFeatures_supports_trampoline_routing"))) TS_NodeFeatures_supports_trampoline_routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_Bolt11InvoiceFeatures_set_trampoline_routing_optional"))) TS_Bolt11InvoiceFeatures_set_trampoline_routing_optional(uint64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_optional(&this_arg_conv); +} + +void __attribute__((export_name("TS_Bolt11InvoiceFeatures_set_trampoline_routing_required"))) TS_Bolt11InvoiceFeatures_set_trampoline_routing_required(uint64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + Bolt11InvoiceFeatures_set_trampoline_routing_required(&this_arg_conv); +} + +jboolean __attribute__((export_name("TS_Bolt11InvoiceFeatures_supports_trampoline_routing"))) TS_Bolt11InvoiceFeatures_supports_trampoline_routing(uint64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = Bolt11InvoiceFeatures_supports_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_InitFeatures_requires_trampoline_routing"))) TS_InitFeatures_requires_trampoline_routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_NodeFeatures_requires_trampoline_routing"))) TS_NodeFeatures_requires_trampoline_routing(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_trampoline_routing(&this_arg_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_Bolt11InvoiceFeatures_requires_trampoline_routing"))) TS_Bolt11InvoiceFeatures_requires_trampoline_routing(uint64_t this_arg) { + LDKBolt11InvoiceFeatures this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = Bolt11InvoiceFeatures_requires_trampoline_routing(&this_arg_conv); + return ret_conv; +} + 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); @@ -58346,6 +63917,246 @@ jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_Shu return ret_conv; } +jstring __attribute__((export_name("TS_ShutdownScript_to_str"))) TS_ShutdownScript_to_str(uint64_t o) { + LDKShutdownScript 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; + LDKStr ret_str = ShutdownScript_to_str(&o_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_ChannelId_free"))) TS_ChannelId_free(uint64_t this_obj) { + LDKChannelId 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); + ChannelId_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_ChannelId_get_a"))) TS_ChannelId_get_a(uint64_t this_ptr) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *ChannelId_get_a(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_ChannelId_set_a"))) TS_ChannelId_set_a(uint64_t this_ptr, int8_tArray val) { + LDKChannelId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + ChannelId_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_ChannelId_new"))) TS_ChannelId_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); + LDKChannelId ret_var = ChannelId_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 ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg) { + LDKChannelId ret_var = ChannelId_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_ChannelId_clone_ptr"))) TS_ChannelId_clone_ptr(uint64_t arg) { + LDKChannelId 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 = ChannelId_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelId_clone"))) TS_ChannelId_clone(uint64_t orig) { + LDKChannelId 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; + LDKChannelId ret_var = ChannelId_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_ChannelId_eq"))) TS_ChannelId_eq(uint64_t a, uint64_t b) { + LDKChannelId 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; + LDKChannelId 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 = ChannelId_eq(&a_conv, &b_conv); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_ChannelId_hash"))) TS_ChannelId_hash(uint64_t o) { + LDKChannelId 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 = ChannelId_hash(&o_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelId_v1_from_funding_txid"))) TS_ChannelId_v1_from_funding_txid(int8_tArray txid, int16_t output_index) { + uint8_t txid_arr[32]; + CHECK(txid->arr_len == 32); + memcpy(txid_arr, txid->elems, 32); FREE(txid); + uint8_t (*txid_ref)[32] = &txid_arr; + LDKChannelId ret_var = ChannelId_v1_from_funding_txid(txid_ref, output_index); + uint64_t ret_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_ChannelId_v1_from_funding_outpoint"))) TS_ChannelId_v1_from_funding_outpoint(uint64_t outpoint) { + LDKOutPoint outpoint_conv; + outpoint_conv.inner = untag_ptr(outpoint); + outpoint_conv.is_owned = ptr_is_owned(outpoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv); + outpoint_conv = OutPoint_clone(&outpoint_conv); + LDKChannelId ret_var = ChannelId_v1_from_funding_outpoint(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_ChannelId_temporary_from_entropy_source"))) TS_ChannelId_temporary_from_entropy_source(uint64_t entropy_source) { + 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; + LDKChannelId ret_var = ChannelId_temporary_from_entropy_source(entropy_source_conv); + uint64_t ret_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_ChannelId_from_bytes"))) TS_ChannelId_from_bytes(int8_tArray data) { + LDKThirtyTwoBytes data_ref; + CHECK(data->arr_len == 32); + memcpy(data_ref.data, data->elems, 32); FREE(data); + LDKChannelId ret_var = ChannelId_from_bytes(data_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_ChannelId_new_zero"))) TS_ChannelId_new_zero() { + LDKChannelId ret_var = ChannelId_new_zero(); + uint64_t ret_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_ChannelId_is_zero"))) TS_ChannelId_is_zero(uint64_t this_arg) { + LDKChannelId this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = ChannelId_is_zero(&this_arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_ChannelId_v2_from_revocation_basepoints"))) TS_ChannelId_v2_from_revocation_basepoints(uint64_t ours, uint64_t theirs) { + LDKRevocationBasepoint ours_conv; + ours_conv.inner = untag_ptr(ours); + ours_conv.is_owned = ptr_is_owned(ours); + CHECK_INNER_FIELD_ACCESS_OR_NULL(ours_conv); + ours_conv.is_owned = false; + LDKRevocationBasepoint theirs_conv; + theirs_conv.inner = untag_ptr(theirs); + theirs_conv.is_owned = ptr_is_owned(theirs); + CHECK_INNER_FIELD_ACCESS_OR_NULL(theirs_conv); + theirs_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_v2_from_revocation_basepoints(&ours_conv, &theirs_conv); + uint64_t ret_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_ChannelId_temporary_v2_from_revocation_basepoint"))) TS_ChannelId_temporary_v2_from_revocation_basepoint(uint64_t our_revocation_basepoint) { + LDKRevocationBasepoint our_revocation_basepoint_conv; + our_revocation_basepoint_conv.inner = untag_ptr(our_revocation_basepoint); + our_revocation_basepoint_conv.is_owned = ptr_is_owned(our_revocation_basepoint); + CHECK_INNER_FIELD_ACCESS_OR_NULL(our_revocation_basepoint_conv); + our_revocation_basepoint_conv.is_owned = false; + LDKChannelId ret_var = ChannelId_temporary_v2_from_revocation_basepoint(&our_revocation_basepoint_conv); + uint64_t ret_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_ChannelId_write"))) TS_ChannelId_write(uint64_t obj) { + LDKChannelId 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 = ChannelId_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_ChannelId_read"))) TS_ChannelId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = ChannelId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +jstring __attribute__((export_name("TS_ChannelId_to_str"))) TS_ChannelId_to_str(uint64_t o) { + LDKChannelId 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; + LDKStr ret_str = ChannelId_to_str(&o_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_Retry_free"))) TS_Retry_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -58858,6 +64669,413 @@ void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint64_t this_pt Type_free(this_ptr_conv); } +void __attribute__((export_name("TS_OfferId_free"))) TS_OfferId_free(uint64_t this_obj) { + LDKOfferId 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); + OfferId_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_OfferId_get_a"))) TS_OfferId_get_a(uint64_t this_ptr) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *OfferId_get_a(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_OfferId_set_a"))) TS_OfferId_set_a(uint64_t this_ptr, int8_tArray val) { + LDKOfferId this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + OfferId_set_a(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_OfferId_new"))) TS_OfferId_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); + LDKOfferId ret_var = OfferId_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 OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg) { + LDKOfferId ret_var = OfferId_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_OfferId_clone_ptr"))) TS_OfferId_clone_ptr(uint64_t arg) { + LDKOfferId 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 = OfferId_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_OfferId_clone"))) TS_OfferId_clone(uint64_t orig) { + LDKOfferId 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; + LDKOfferId ret_var = OfferId_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_OfferId_eq"))) TS_OfferId_eq(uint64_t a, uint64_t b) { + LDKOfferId 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; + LDKOfferId 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 = OfferId_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_OfferId_write"))) TS_OfferId_write(uint64_t obj) { + LDKOfferId 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 = OfferId_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_OfferId_read"))) TS_OfferId_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_OfferIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferIdDecodeErrorZ), "LDKCResult_OfferIdDecodeErrorZ"); + *ret_conv = OfferId_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_free"))) TS_OfferWithExplicitMetadataBuilder_free(uint64_t this_obj) { + LDKOfferWithExplicitMetadataBuilder 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); + OfferWithExplicitMetadataBuilder_free(this_obj_conv); +} + +static inline uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_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_OfferWithExplicitMetadataBuilder_clone_ptr"))) TS_OfferWithExplicitMetadataBuilder_clone_ptr(uint64_t arg) { + LDKOfferWithExplicitMetadataBuilder 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 = OfferWithExplicitMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_clone"))) TS_OfferWithExplicitMetadataBuilder_clone(uint64_t orig) { + LDKOfferWithExplicitMetadataBuilder 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; + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_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_OfferWithDerivedMetadataBuilder_free"))) TS_OfferWithDerivedMetadataBuilder_free(uint64_t this_obj) { + LDKOfferWithDerivedMetadataBuilder 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); + OfferWithDerivedMetadataBuilder_free(this_obj_conv); +} + +static inline uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_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_OfferWithDerivedMetadataBuilder_clone_ptr"))) TS_OfferWithDerivedMetadataBuilder_clone_ptr(uint64_t arg) { + LDKOfferWithDerivedMetadataBuilder 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 = OfferWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_clone"))) TS_OfferWithDerivedMetadataBuilder_clone(uint64_t orig) { + LDKOfferWithDerivedMetadataBuilder 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; + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_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_OfferWithExplicitMetadataBuilder_new"))) TS_OfferWithExplicitMetadataBuilder_new(int8_tArray signing_pubkey) { + LDKPublicKey signing_pubkey_ref; + CHECK(signing_pubkey->arr_len == 33); + memcpy(signing_pubkey_ref.compressed_form, signing_pubkey->elems, 33); FREE(signing_pubkey); + LDKOfferWithExplicitMetadataBuilder ret_var = OfferWithExplicitMetadataBuilder_new(signing_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; +} + +uint64_t __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_metadata"))) TS_OfferWithExplicitMetadataBuilder_metadata(uint64_t this_arg, int8_tArray metadata) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = metadata->arr_len; + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(metadata_ref.data, metadata->elems, metadata_ref.datalen); FREE(metadata); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_metadata(this_arg_conv, metadata_ref); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_chain"))) TS_OfferWithExplicitMetadataBuilder_chain(uint64_t this_arg, uint32_t network) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_js(network); + OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_amount_msats"))) TS_OfferWithExplicitMetadataBuilder_amount_msats(uint64_t this_arg, int64_t amount_msats) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_amount_msats(this_arg_conv, amount_msats); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_absolute_expiry"))) TS_OfferWithExplicitMetadataBuilder_absolute_expiry(uint64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + OfferWithExplicitMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_description"))) TS_OfferWithExplicitMetadataBuilder_description(uint64_t this_arg, jstring description) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = str_ref_to_owned_c(description); + OfferWithExplicitMetadataBuilder_description(this_arg_conv, description_conv); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_issuer"))) TS_OfferWithExplicitMetadataBuilder_issuer(uint64_t this_arg, jstring issuer) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + OfferWithExplicitMetadataBuilder_issuer(this_arg_conv, issuer_conv); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_path"))) TS_OfferWithExplicitMetadataBuilder_path(uint64_t this_arg, uint64_t path) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKBlindedPath 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 = BlindedPath_clone(&path_conv); + OfferWithExplicitMetadataBuilder_path(this_arg_conv, path_conv); +} + +void __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_supported_quantity"))) TS_OfferWithExplicitMetadataBuilder_supported_quantity(uint64_t this_arg, uint64_t quantity) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithExplicitMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); +} + +uint64_t __attribute__((export_name("TS_OfferWithExplicitMetadataBuilder_build"))) TS_OfferWithExplicitMetadataBuilder_build(uint64_t this_arg) { + LDKOfferWithExplicitMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithExplicitMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithExplicitMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey"))) TS_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(int8_tArray node_id, uint64_t expanded_key, uint64_t entropy_source) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + 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); + } + LDKOfferWithDerivedMetadataBuilder ret_var = OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(node_id_ref, &expanded_key_conv, entropy_source_conv); + uint64_t ret_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_OfferWithDerivedMetadataBuilder_chain"))) TS_OfferWithDerivedMetadataBuilder_chain(uint64_t this_arg, uint32_t network) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_js(network); + OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_amount_msats"))) TS_OfferWithDerivedMetadataBuilder_amount_msats(uint64_t this_arg, int64_t amount_msats) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_amount_msats(this_arg_conv, amount_msats); +} + +void __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_absolute_expiry"))) TS_OfferWithDerivedMetadataBuilder_absolute_expiry(uint64_t this_arg, int64_t absolute_expiry) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + OfferWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +} + +void __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_description"))) TS_OfferWithDerivedMetadataBuilder_description(uint64_t this_arg, jstring description) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = str_ref_to_owned_c(description); + OfferWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +} + +void __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_issuer"))) TS_OfferWithDerivedMetadataBuilder_issuer(uint64_t this_arg, jstring issuer) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + OfferWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); +} + +void __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_path"))) TS_OfferWithDerivedMetadataBuilder_path(uint64_t this_arg, uint64_t path) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedPath 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 = BlindedPath_clone(&path_conv); + OfferWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +} + +void __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_supported_quantity"))) TS_OfferWithDerivedMetadataBuilder_supported_quantity(uint64_t this_arg, uint64_t quantity) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + void* quantity_ptr = untag_ptr(quantity); + CHECK_ACCESS(quantity_ptr); + LDKQuantity quantity_conv = *(LDKQuantity*)(quantity_ptr); + quantity_conv = Quantity_clone((LDKQuantity*)untag_ptr(quantity)); + OfferWithDerivedMetadataBuilder_supported_quantity(this_arg_conv, quantity_conv); +} + +uint64_t __attribute__((export_name("TS_OfferWithDerivedMetadataBuilder_build"))) TS_OfferWithDerivedMetadataBuilder_build(uint64_t this_arg) { + LDKOfferWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = OfferWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_OfferBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12SemanticErrorZ), "LDKCResult_OfferBolt12SemanticErrorZ"); + *ret_conv = OfferWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + 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); @@ -58934,10 +65152,9 @@ uint64_t __attribute__((export_name("TS_Offer_amount"))) TS_Offer_amount(uint64 this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Offer_amount(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59020,10 +65237,9 @@ uint64_t __attribute__((export_name("TS_Offer_supported_quantity"))) TS_Offer_s this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - 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); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Offer_supported_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59038,6 +65254,19 @@ int8_tArray __attribute__((export_name("TS_Offer_signing_pubkey"))) TS_Offer_si return ret_arr; } +uint64_t __attribute__((export_name("TS_Offer_id"))) TS_Offer_id(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; + LDKOfferId ret_var = Offer_id(&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_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); @@ -59081,6 +65310,89 @@ jboolean __attribute__((export_name("TS_Offer_expects_quantity"))) TS_Offer_exp return ret_conv; } +uint64_t __attribute__((export_name("TS_Offer_request_invoice_deriving_payer_id"))) TS_Offer_request_invoice_deriving_payer_id(uint64_t this_arg, uint64_t expanded_key, uint64_t entropy_source, int8_tArray payment_id) { + 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; + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + 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); + } + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_payer_id(&this_arg_conv, &expanded_key_conv, entropy_source_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_Offer_request_invoice_deriving_metadata"))) TS_Offer_request_invoice_deriving_metadata(uint64_t this_arg, int8_tArray payer_id, uint64_t expanded_key, uint64_t entropy_source, int8_tArray payment_id) { + 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; + LDKPublicKey payer_id_ref; + CHECK(payer_id->arr_len == 33); + memcpy(payer_id_ref.compressed_form, payer_id->elems, 33); FREE(payer_id); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + 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); + } + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice_deriving_metadata(&this_arg_conv, payer_id_ref, &expanded_key_conv, entropy_source_conv, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_Offer_request_invoice"))) TS_Offer_request_invoice(uint64_t this_arg, int8_tArray metadata, int8_tArray payer_id) { + 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; + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = metadata->arr_len; + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(metadata_ref.data, metadata->elems, metadata_ref.datalen); FREE(metadata); + LDKPublicKey payer_id_ref; + CHECK(payer_id->arr_len == 33); + memcpy(payer_id_ref.compressed_form, payer_id->elems, 33); FREE(payer_id); + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ"); + *ret_conv = Offer_request_invoice(&this_arg_conv, metadata_ref, payer_id_ref); + return tag_ptr(ret_conv, true); +} + +int64_t __attribute__((export_name("TS_Offer_hash"))) TS_Offer_hash(uint64_t o) { + LDKOffer 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 = Offer_hash(&o_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_Offer_write"))) TS_Offer_write(uint64_t obj) { LDKOffer obj_conv; obj_conv.inner = untag_ptr(obj); @@ -59094,95 +65406,328 @@ int8_tArray __attribute__((export_name("TS_Offer_write"))) TS_Offer_write(uint6 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); +void __attribute__((export_name("TS_Amount_free"))) TS_Amount_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); + LDKAmount this_ptr_conv = *(LDKAmount*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Amount_free(this_ptr_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); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); 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); + LDKAmount* arg_conv = (LDKAmount*)untag_ptr(arg); + int64_t ret_conv = Amount_clone_ptr(arg_conv); return ret_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); + LDKAmount* orig_conv = (LDKAmount*)untag_ptr(orig); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void __attribute__((export_name("TS_Quantity_free"))) TS_Quantity_free(uint64_t this_obj) { - LDKQuantity this_obj_conv; +uint64_t __attribute__((export_name("TS_Amount_bitcoin"))) TS_Amount_bitcoin(int64_t amount_msats) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_bitcoin(amount_msats); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Amount_currency"))) TS_Amount_currency(int8_tArray iso4217_code, int64_t amount) { + LDKThreeBytes iso4217_code_ref; + CHECK(iso4217_code->arr_len == 3); + memcpy(iso4217_code_ref.data, iso4217_code->elems, 3); FREE(iso4217_code); + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_currency(iso4217_code_ref, amount); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_Quantity_free"))) TS_Quantity_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); + LDKQuantity this_ptr_conv = *(LDKQuantity*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + Quantity_free(this_ptr_conv); +} + +static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_Quantity_clone_ptr"))) TS_Quantity_clone_ptr(uint64_t arg) { + LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); + 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 = (LDKQuantity*)untag_ptr(orig); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Quantity_bounded"))) TS_Quantity_bounded(int64_t a) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_bounded(a); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Quantity_unbounded"))) TS_Quantity_unbounded() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_unbounded(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Quantity_one"))) TS_Quantity_one() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_one(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_Offer_from_str"))) TS_Offer_from_str(jstring s) { + LDKStr s_conv = str_ref_to_owned_c(s); + LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); + *ret_conv = Offer_from_str(s_conv); + return tag_ptr(ret_conv, true); +} + +jstring __attribute__((export_name("TS_Offer_to_str"))) TS_Offer_to_str(uint64_t o) { + LDKOffer 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; + LDKStr ret_str = Offer_to_str(&o_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_InvoiceWithExplicitSigningPubkeyBuilder_free"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_free(uint64_t this_obj) { + LDKInvoiceWithExplicitSigningPubkeyBuilder 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); + InvoiceWithExplicitSigningPubkeyBuilder_free(this_obj_conv); } -static inline uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg) { - LDKQuantity ret_var = Quantity_clone(arg); +void __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_free"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_free(uint64_t this_obj) { + LDKInvoiceWithDerivedSigningPubkeyBuilder 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); + InvoiceWithDerivedSigningPubkeyBuilder_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_InvoiceWithExplicitSigningPubkeyBuilder_build"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_build(uint64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithExplicitSigningPubkeyBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(uint64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); +} + +void __attribute__((export_name("TS_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(uint64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + 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; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); +} + +void __attribute__((export_name("TS_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(uint64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + 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; + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); +} + +void __attribute__((export_name("TS_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(uint64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK(utput_key->arr_len == 32); + memcpy(utput_key_ref.x_coordinate, utput_key->elems, 32); FREE(utput_key); + InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); +} + +void __attribute__((export_name("TS_InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp"))) TS_InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(uint64_t this_arg) { + LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithExplicitSigningPubkeyBuilder + + InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this_arg_conv); +} + +uint64_t __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(uint64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ), "LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ"); + *ret_conv = InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(uint64_t this_arg, int32_t relative_expiry_secs) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this_arg_conv, relative_expiry_secs); +} + +void __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(uint64_t this_arg, int8_tArray script_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + 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; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this_arg_conv, script_hash_ref); +} + +void __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(uint64_t this_arg, int8_tArray pubkey_hash) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + 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; + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this_arg_conv, pubkey_hash_ref); +} + +void __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(uint64_t this_arg, int8_tArray utput_key) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + LDKTweakedPublicKey utput_key_ref; + CHECK(utput_key->arr_len == 32); + memcpy(utput_key_ref.x_coordinate, utput_key->elems, 32); FREE(utput_key); + InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this_arg_conv, utput_key_ref); +} + +void __attribute__((export_name("TS_InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp"))) TS_InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(uint64_t this_arg) { + LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceWithDerivedSigningPubkeyBuilder + + InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this_arg_conv); +} + +void __attribute__((export_name("TS_UnsignedBolt12Invoice_free"))) TS_UnsignedBolt12Invoice_free(uint64_t this_obj) { + LDKUnsignedBolt12Invoice 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); + UnsignedBolt12Invoice_free(this_obj_conv); +} + +static inline uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg) { + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_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; +int64_t __attribute__((export_name("TS_UnsignedBolt12Invoice_clone_ptr"))) TS_UnsignedBolt12Invoice_clone_ptr(uint64_t arg) { + LDKUnsignedBolt12Invoice 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); + int64_t ret_conv = UnsignedBolt12Invoice_clone_ptr(&arg_conv); return ret_conv; } -uint64_t __attribute__((export_name("TS_Quantity_clone"))) TS_Quantity_clone(uint64_t orig) { - LDKQuantity orig_conv; +uint64_t __attribute__((export_name("TS_UnsignedBolt12Invoice_clone"))) TS_UnsignedBolt12Invoice_clone(uint64_t orig) { + LDKUnsignedBolt12Invoice 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); + LDKUnsignedBolt12Invoice ret_var = UnsignedBolt12Invoice_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_Offer_from_str"))) TS_Offer_from_str(jstring s) { - LDKStr s_conv = str_ref_to_owned_c(s); - LDKCResult_OfferBolt12ParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OfferBolt12ParseErrorZ), "LDKCResult_OfferBolt12ParseErrorZ"); - *ret_conv = Offer_from_str(s_conv); - return tag_ptr(ret_conv, true); -} - -void __attribute__((export_name("TS_UnsignedBolt12Invoice_free"))) TS_UnsignedBolt12Invoice_free(uint64_t this_obj) { - LDKUnsignedBolt12Invoice 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); - UnsignedBolt12Invoice_free(this_obj_conv); +void __attribute__((export_name("TS_SignBolt12InvoiceFn_free"))) TS_SignBolt12InvoiceFn_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); + LDKSignBolt12InvoiceFn this_ptr_conv = *(LDKSignBolt12InvoiceFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignBolt12InvoiceFn_free(this_ptr_conv); } uint64_t __attribute__((export_name("TS_UnsignedBolt12Invoice_tagged_hash"))) TS_UnsignedBolt12Invoice_tagged_hash(uint64_t this_arg) { @@ -59277,10 +65822,9 @@ uint64_t __attribute__((export_name("TS_UnsignedBolt12Invoice_amount"))) TS_Uns this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = UnsignedBolt12Invoice_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); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedBolt12Invoice_amount(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59363,10 +65907,9 @@ uint64_t __attribute__((export_name("TS_UnsignedBolt12Invoice_supported_quantit this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = UnsignedBolt12Invoice_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); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = UnsignedBolt12Invoice_supported_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59537,10 +66080,9 @@ uint64_t __attribute__((export_name("TS_Bolt12Invoice_amount"))) TS_Bolt12Invoi this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = Bolt12Invoice_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); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = Bolt12Invoice_amount(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59623,10 +66165,9 @@ uint64_t __attribute__((export_name("TS_Bolt12Invoice_supported_quantity"))) TS this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = Bolt12Invoice_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); + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = Bolt12Invoice_supported_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59794,6 +66335,16 @@ uint64_t __attribute__((export_name("TS_Bolt12Invoice_verify"))) TS_Bolt12Invoi return tag_ptr(ret_conv, true); } +int64_t __attribute__((export_name("TS_Bolt12Invoice_hash"))) TS_Bolt12Invoice_hash(uint64_t o) { + LDKBolt12Invoice 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 = Bolt12Invoice_hash(&o_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_UnsignedBolt12Invoice_write"))) TS_UnsignedBolt12Invoice_write(uint64_t obj) { LDKUnsignedBolt12Invoice obj_conv; obj_conv.inner = untag_ptr(obj); @@ -60254,6 +66805,18 @@ uint64_t __attribute__((export_name("TS_InvoiceError_from_string"))) TS_Invoice return ret_ref; } +jstring __attribute__((export_name("TS_InvoiceError_to_str"))) TS_InvoiceError_to_str(uint64_t o) { + LDKInvoiceError 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; + LDKStr ret_str = InvoiceError_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_InvoiceError_write"))) TS_InvoiceError_write(uint64_t obj) { LDKInvoiceError obj_conv; obj_conv.inner = untag_ptr(obj); @@ -60277,6 +66840,142 @@ uint64_t __attribute__((export_name("TS_InvoiceError_read"))) TS_InvoiceError_r return tag_ptr(ret_conv, true); } +void __attribute__((export_name("TS_InvoiceRequestWithExplicitPayerIdBuilder_free"))) TS_InvoiceRequestWithExplicitPayerIdBuilder_free(uint64_t this_obj) { + LDKInvoiceRequestWithExplicitPayerIdBuilder 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); + InvoiceRequestWithExplicitPayerIdBuilder_free(this_obj_conv); +} + +void __attribute__((export_name("TS_InvoiceRequestWithDerivedPayerIdBuilder_free"))) TS_InvoiceRequestWithDerivedPayerIdBuilder_free(uint64_t this_obj) { + LDKInvoiceRequestWithDerivedPayerIdBuilder 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); + InvoiceRequestWithDerivedPayerIdBuilder_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithExplicitPayerIdBuilder_build"))) TS_InvoiceRequestWithExplicitPayerIdBuilder_build(uint64_t this_arg) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ), "LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithExplicitPayerIdBuilder_chain"))) TS_InvoiceRequestWithExplicitPayerIdBuilder_chain(uint64_t this_arg, uint32_t network) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_js(network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithExplicitPayerIdBuilder_amount_msats"))) TS_InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(uint64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithExplicitPayerIdBuilder_quantity"))) TS_InvoiceRequestWithExplicitPayerIdBuilder_quantity(uint64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithExplicitPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_InvoiceRequestWithExplicitPayerIdBuilder_payer_note"))) TS_InvoiceRequestWithExplicitPayerIdBuilder_payer_note(uint64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithExplicitPayerIdBuilder + + LDKStr payer_note_conv = str_ref_to_owned_c(payer_note); + InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this_arg_conv, payer_note_conv); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign"))) TS_InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(uint64_t this_arg) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestBolt12SemanticErrorZ), "LDKCResult_InvoiceRequestBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this_arg_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithDerivedPayerIdBuilder_chain"))) TS_InvoiceRequestWithDerivedPayerIdBuilder_chain(uint64_t this_arg, uint32_t network) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKNetwork network_conv = LDKNetwork_from_js(network); + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_chain(this_arg_conv, network_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithDerivedPayerIdBuilder_amount_msats"))) TS_InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(uint64_t this_arg, int64_t amount_msats) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this_arg_conv, amount_msats); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestWithDerivedPayerIdBuilder_quantity"))) TS_InvoiceRequestWithDerivedPayerIdBuilder_quantity(uint64_t this_arg, int64_t quantity) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequestWithDerivedPayerIdBuilder_quantity(this_arg_conv, quantity); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_InvoiceRequestWithDerivedPayerIdBuilder_payer_note"))) TS_InvoiceRequestWithDerivedPayerIdBuilder_payer_note(uint64_t this_arg, jstring payer_note) { + LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + // WARNING: we need a move here but no clone is available for LDKInvoiceRequestWithDerivedPayerIdBuilder + + LDKStr payer_note_conv = str_ref_to_owned_c(payer_note); + InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this_arg_conv, payer_note_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); @@ -60285,6 +66984,45 @@ void __attribute__((export_name("TS_UnsignedInvoiceRequest_free"))) TS_Unsigned UnsignedInvoiceRequest_free(this_obj_conv); } +static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_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_UnsignedInvoiceRequest_clone_ptr"))) TS_UnsignedInvoiceRequest_clone_ptr(uint64_t arg) { + LDKUnsignedInvoiceRequest 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 = UnsignedInvoiceRequest_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_UnsignedInvoiceRequest_clone"))) TS_UnsignedInvoiceRequest_clone(uint64_t orig) { + LDKUnsignedInvoiceRequest 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; + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_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_SignInvoiceRequestFn_free"))) TS_SignInvoiceRequestFn_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); + LDKSignInvoiceRequestFn this_ptr_conv = *(LDKSignInvoiceRequestFn*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignInvoiceRequestFn_free(this_ptr_conv); +} + uint64_t __attribute__((export_name("TS_UnsignedInvoiceRequest_tagged_hash"))) TS_UnsignedInvoiceRequest_tagged_hash(uint64_t this_arg) { LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -60344,6 +67082,33 @@ void __attribute__((export_name("TS_VerifiedInvoiceRequest_free"))) TS_Verified VerifiedInvoiceRequest_free(this_obj_conv); } +uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_get_offer_id"))) TS_VerifiedInvoiceRequest_get_offer_id(uint64_t this_ptr) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId ret_var = VerifiedInvoiceRequest_get_offer_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void __attribute__((export_name("TS_VerifiedInvoiceRequest_set_offer_id"))) TS_VerifiedInvoiceRequest_set_offer_id(uint64_t this_ptr, uint64_t val) { + LDKVerifiedInvoiceRequest this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId 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 = OfferId_clone(&val_conv); + VerifiedInvoiceRequest_set_offer_id(&this_ptr_conv, val_conv); +} + uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_get_keys"))) TS_VerifiedInvoiceRequest_get_keys(uint64_t this_ptr) { LDKVerifiedInvoiceRequest this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -60437,10 +67202,9 @@ uint64_t __attribute__((export_name("TS_UnsignedInvoiceRequest_amount"))) TS_Un this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = UnsignedInvoiceRequest_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); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = UnsignedInvoiceRequest_amount(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60523,10 +67287,9 @@ uint64_t __attribute__((export_name("TS_UnsignedInvoiceRequest_supported_quanti this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = UnsignedInvoiceRequest_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); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = UnsignedInvoiceRequest_supported_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60663,10 +67426,9 @@ uint64_t __attribute__((export_name("TS_InvoiceRequest_amount"))) TS_InvoiceReq this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = InvoiceRequest_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); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = InvoiceRequest_amount(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60749,10 +67511,9 @@ uint64_t __attribute__((export_name("TS_InvoiceRequest_supported_quantity"))) T this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = InvoiceRequest_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); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = InvoiceRequest_supported_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60851,15 +67612,34 @@ uint64_t __attribute__((export_name("TS_InvoiceRequest_payer_note"))) TS_Invoic return ret_ref; } -int8_tArray __attribute__((export_name("TS_InvoiceRequest_signature"))) TS_InvoiceRequest_signature(uint64_t this_arg) { +uint64_t __attribute__((export_name("TS_InvoiceRequest_respond_with_no_std"))) TS_InvoiceRequest_respond_with_no_std(uint64_t this_arg, uint64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { 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; - int8_tArray ret_arr = init_int8_tArray(64, __LINE__); - memcpy(ret_arr->elems, InvoiceRequest_signature(&this_arg_conv).compact_form, 64); - return ret_arr; + LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + uint64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + uint64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = InvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); } uint64_t __attribute__((export_name("TS_InvoiceRequest_verify"))) TS_InvoiceRequest_verify(uint64_t this_arg, uint64_t key) { @@ -60878,6 +67658,17 @@ uint64_t __attribute__((export_name("TS_InvoiceRequest_verify"))) TS_InvoiceReq return tag_ptr(ret_conv, true); } +int8_tArray __attribute__((export_name("TS_InvoiceRequest_signature"))) TS_InvoiceRequest_signature(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; + int8_tArray ret_arr = init_int8_tArray(64, __LINE__); + memcpy(ret_arr->elems, InvoiceRequest_signature(&this_arg_conv).compact_form, 64); + return ret_arr; +} + ptrArray __attribute__((export_name("TS_VerifiedInvoiceRequest_chains"))) TS_VerifiedInvoiceRequest_chains(uint64_t this_arg) { LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -60916,10 +67707,9 @@ uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_amount"))) TS_Ve this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKAmount ret_var = VerifiedInvoiceRequest_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); + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = VerifiedInvoiceRequest_amount(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61002,10 +67792,9 @@ uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_supported_quanti this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKQuantity ret_var = VerifiedInvoiceRequest_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); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = VerifiedInvoiceRequest_supported_quantity(&this_arg_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61104,6 +67893,66 @@ uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_payer_note"))) T return ret_ref; } +uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_respond_with_no_std"))) TS_VerifiedInvoiceRequest_respond_with_no_std(uint64_t this_arg, uint64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + uint64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + uint64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_with_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_VerifiedInvoiceRequest_respond_using_derived_keys_no_std"))) TS_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(uint64_t this_arg, uint64_tArray payment_paths, int8_tArray payment_hash, int64_t created_at) { + LDKVerifiedInvoiceRequest this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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_BlindedPayInfoBlindedPathZZ payment_paths_constr; + payment_paths_constr.datalen = payment_paths->arr_len; + if (payment_paths_constr.datalen > 0) + payment_paths_constr.data = MALLOC(payment_paths_constr.datalen * sizeof(LDKC2Tuple_BlindedPayInfoBlindedPathZ), "LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ Elements"); + else + payment_paths_constr.data = NULL; + uint64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + uint64_t payment_paths_conv_37 = payment_paths_vals[l]; + void* payment_paths_conv_37_ptr = untag_ptr(payment_paths_conv_37); + CHECK_ACCESS(payment_paths_conv_37_ptr); + LDKC2Tuple_BlindedPayInfoBlindedPathZ payment_paths_conv_37_conv = *(LDKC2Tuple_BlindedPayInfoBlindedPathZ*)(payment_paths_conv_37_ptr); + payment_paths_conv_37_conv = C2Tuple_BlindedPayInfoBlindedPathZ_clone((LDKC2Tuple_BlindedPayInfoBlindedPathZ*)untag_ptr(payment_paths_conv_37)); + payment_paths_constr.data[l] = payment_paths_conv_37_conv; + } + FREE(payment_paths); + LDKThirtyTwoBytes payment_hash_ref; + CHECK(payment_hash->arr_len == 32); + memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash); + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ), "LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ"); + *ret_conv = VerifiedInvoiceRequest_respond_using_derived_keys_no_std(&this_arg_conv, payment_paths_constr, payment_hash_ref, created_at); + return tag_ptr(ret_conv, true); +} + int8_tArray __attribute__((export_name("TS_UnsignedInvoiceRequest_write"))) TS_UnsignedInvoiceRequest_write(uint64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); @@ -61130,6 +67979,177 @@ int8_tArray __attribute__((export_name("TS_InvoiceRequest_write"))) TS_InvoiceR return ret_arr; } +void __attribute__((export_name("TS_InvoiceRequestFields_free"))) TS_InvoiceRequestFields_free(uint64_t this_obj) { + LDKInvoiceRequestFields 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); + InvoiceRequestFields_free(this_obj_conv); +} + +int8_tArray __attribute__((export_name("TS_InvoiceRequestFields_get_payer_id"))) TS_InvoiceRequestFields_get_payer_id(uint64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, InvoiceRequestFields_get_payer_id(&this_ptr_conv).compressed_form, 33); + return ret_arr; +} + +void __attribute__((export_name("TS_InvoiceRequestFields_set_payer_id"))) TS_InvoiceRequestFields_set_payer_id(uint64_t this_ptr, int8_tArray val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + InvoiceRequestFields_set_payer_id(&this_ptr_conv, val_ref); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestFields_get_quantity"))) TS_InvoiceRequestFields_get_quantity(uint64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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 = InvoiceRequestFields_get_quantity(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_InvoiceRequestFields_set_quantity"))) TS_InvoiceRequestFields_set_quantity(uint64_t this_ptr, uint64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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)); + InvoiceRequestFields_set_quantity(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestFields_get_payer_note_truncated"))) TS_InvoiceRequestFields_get_payer_note_truncated(uint64_t this_ptr) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString ret_var = InvoiceRequestFields_get_payer_note_truncated(&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_InvoiceRequestFields_set_payer_note_truncated"))) TS_InvoiceRequestFields_set_payer_note_truncated(uint64_t this_ptr, uint64_t val) { + LDKInvoiceRequestFields this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKUntrustedString 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 = UntrustedString_clone(&val_conv); + InvoiceRequestFields_set_payer_note_truncated(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestFields_new"))) TS_InvoiceRequestFields_new(int8_tArray payer_id_arg, uint64_t quantity_arg, uint64_t payer_note_truncated_arg) { + LDKPublicKey payer_id_arg_ref; + CHECK(payer_id_arg->arr_len == 33); + memcpy(payer_id_arg_ref.compressed_form, payer_id_arg->elems, 33); FREE(payer_id_arg); + void* quantity_arg_ptr = untag_ptr(quantity_arg); + CHECK_ACCESS(quantity_arg_ptr); + LDKCOption_u64Z quantity_arg_conv = *(LDKCOption_u64Z*)(quantity_arg_ptr); + quantity_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(quantity_arg)); + LDKUntrustedString payer_note_truncated_arg_conv; + payer_note_truncated_arg_conv.inner = untag_ptr(payer_note_truncated_arg); + payer_note_truncated_arg_conv.is_owned = ptr_is_owned(payer_note_truncated_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payer_note_truncated_arg_conv); + payer_note_truncated_arg_conv = UntrustedString_clone(&payer_note_truncated_arg_conv); + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_new(payer_id_arg_ref, quantity_arg_conv, payer_note_truncated_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 InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg) { + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_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_InvoiceRequestFields_clone_ptr"))) TS_InvoiceRequestFields_clone_ptr(uint64_t arg) { + LDKInvoiceRequestFields 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 = InvoiceRequestFields_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_InvoiceRequestFields_clone"))) TS_InvoiceRequestFields_clone(uint64_t orig) { + LDKInvoiceRequestFields 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; + LDKInvoiceRequestFields ret_var = InvoiceRequestFields_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_InvoiceRequestFields_eq"))) TS_InvoiceRequestFields_eq(uint64_t a, uint64_t b) { + LDKInvoiceRequestFields 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; + LDKInvoiceRequestFields 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 = InvoiceRequestFields_eq(&a_conv, &b_conv); + return ret_conv; +} + +int8_tArray __attribute__((export_name("TS_InvoiceRequestFields_write"))) TS_InvoiceRequestFields_write(uint64_t obj) { + LDKInvoiceRequestFields 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 = InvoiceRequestFields_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_InvoiceRequestFields_read"))) TS_InvoiceRequestFields_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceRequestFieldsDecodeErrorZ), "LDKCResult_InvoiceRequestFieldsDecodeErrorZ"); + *ret_conv = InvoiceRequestFields_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + void __attribute__((export_name("TS_TaggedHash_free"))) TS_TaggedHash_free(uint64_t this_obj) { LDKTaggedHash this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -61202,6 +68222,50 @@ int8_tArray __attribute__((export_name("TS_TaggedHash_merkle_root"))) TS_Tagged return ret_arr; } +void __attribute__((export_name("TS_SignError_free"))) TS_SignError_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); + LDKSignError this_ptr_conv = *(LDKSignError*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + SignError_free(this_ptr_conv); +} + +static inline uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg) { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_SignError_clone_ptr"))) TS_SignError_clone_ptr(uint64_t arg) { + LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); + int64_t ret_conv = SignError_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_SignError_clone"))) TS_SignError_clone(uint64_t orig) { + LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_SignError_signing"))) TS_SignError_signing() { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_signing(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_SignError_verification"))) TS_SignError_verification(uint32_t a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_verification(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + void __attribute__((export_name("TS_Bolt12ParseError_free"))) TS_Bolt12ParseError_free(uint64_t this_obj) { LDKBolt12ParseError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -61361,6 +68425,11 @@ uint32_t __attribute__((export_name("TS_Bolt12SemanticError_missing_paths"))) T return ret_conv; } +uint32_t __attribute__((export_name("TS_Bolt12SemanticError_unexpected_paths"))) TS_Bolt12SemanticError_unexpected_paths() { + uint32_t ret_conv = LDKBolt12SemanticError_to_js(Bolt12SemanticError_unexpected_paths()); + return ret_conv; +} + uint32_t __attribute__((export_name("TS_Bolt12SemanticError_invalid_pay_info"))) TS_Bolt12SemanticError_invalid_pay_info() { uint32_t ret_conv = LDKBolt12SemanticError_to_js(Bolt12SemanticError_invalid_pay_info()); return ret_conv; @@ -61381,6 +68450,164 @@ uint32_t __attribute__((export_name("TS_Bolt12SemanticError_missing_signature") return ret_conv; } +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_free"))) TS_RefundMaybeWithDerivedMetadataBuilder_free(uint64_t this_obj) { + LDKRefundMaybeWithDerivedMetadataBuilder 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); + RefundMaybeWithDerivedMetadataBuilder_free(this_obj_conv); +} + +static inline uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg) { + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_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_RefundMaybeWithDerivedMetadataBuilder_clone_ptr"))) TS_RefundMaybeWithDerivedMetadataBuilder_clone_ptr(uint64_t arg) { + LDKRefundMaybeWithDerivedMetadataBuilder 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 = RefundMaybeWithDerivedMetadataBuilder_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_clone"))) TS_RefundMaybeWithDerivedMetadataBuilder_clone(uint64_t orig) { + LDKRefundMaybeWithDerivedMetadataBuilder 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; + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = RefundMaybeWithDerivedMetadataBuilder_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_RefundMaybeWithDerivedMetadataBuilder_new"))) TS_RefundMaybeWithDerivedMetadataBuilder_new(int8_tArray metadata, int8_tArray payer_id, int64_t amount_msats) { + LDKCVec_u8Z metadata_ref; + metadata_ref.datalen = metadata->arr_len; + metadata_ref.data = MALLOC(metadata_ref.datalen, "LDKCVec_u8Z Bytes"); + memcpy(metadata_ref.data, metadata->elems, metadata_ref.datalen); FREE(metadata); + LDKPublicKey payer_id_ref; + CHECK(payer_id->arr_len == 33); + memcpy(payer_id_ref.compressed_form, payer_id->elems, 33); FREE(payer_id); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_new(metadata_ref, payer_id_ref, amount_msats); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id"))) TS_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(int8_tArray node_id, uint64_t expanded_key, uint64_t entropy_source, int64_t amount_msats, int8_tArray payment_id) { + LDKPublicKey node_id_ref; + CHECK(node_id->arr_len == 33); + memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id); + LDKExpandedKey expanded_key_conv; + expanded_key_conv.inner = untag_ptr(expanded_key); + expanded_key_conv.is_owned = ptr_is_owned(expanded_key); + CHECK_INNER_FIELD_ACCESS_OR_NULL(expanded_key_conv); + expanded_key_conv.is_owned = false; + 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); + } + LDKThirtyTwoBytes payment_id_ref; + CHECK(payment_id->arr_len == 32); + memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id); + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ), "LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(node_id_ref, &expanded_key_conv, entropy_source_conv, amount_msats, payment_id_ref); + return tag_ptr(ret_conv, true); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_description"))) TS_RefundMaybeWithDerivedMetadataBuilder_description(uint64_t this_arg, jstring description) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr description_conv = str_ref_to_owned_c(description); + RefundMaybeWithDerivedMetadataBuilder_description(this_arg_conv, description_conv); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry"))) TS_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(uint64_t this_arg, int64_t absolute_expiry) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this_arg_conv, absolute_expiry); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_issuer"))) TS_RefundMaybeWithDerivedMetadataBuilder_issuer(uint64_t this_arg, jstring issuer) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr issuer_conv = str_ref_to_owned_c(issuer); + RefundMaybeWithDerivedMetadataBuilder_issuer(this_arg_conv, issuer_conv); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_path"))) TS_RefundMaybeWithDerivedMetadataBuilder_path(uint64_t this_arg, uint64_t path) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKBlindedPath 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 = BlindedPath_clone(&path_conv); + RefundMaybeWithDerivedMetadataBuilder_path(this_arg_conv, path_conv); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_chain"))) TS_RefundMaybeWithDerivedMetadataBuilder_chain(uint64_t this_arg, uint32_t network) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKNetwork network_conv = LDKNetwork_from_js(network); + RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_quantity"))) TS_RefundMaybeWithDerivedMetadataBuilder_quantity(uint64_t this_arg, int64_t quantity) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + RefundMaybeWithDerivedMetadataBuilder_quantity(this_arg_conv, quantity); +} + +void __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_payer_note"))) TS_RefundMaybeWithDerivedMetadataBuilder_payer_note(uint64_t this_arg, jstring payer_note) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKStr payer_note_conv = str_ref_to_owned_c(payer_note); + RefundMaybeWithDerivedMetadataBuilder_payer_note(this_arg_conv, payer_note_conv); +} + +uint64_t __attribute__((export_name("TS_RefundMaybeWithDerivedMetadataBuilder_build"))) TS_RefundMaybeWithDerivedMetadataBuilder_build(uint64_t this_arg) { + LDKRefundMaybeWithDerivedMetadataBuilder this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv = RefundMaybeWithDerivedMetadataBuilder_clone(&this_arg_conv); + LDKCResult_RefundBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RefundBolt12SemanticErrorZ), "LDKCResult_RefundBolt12SemanticErrorZ"); + *ret_conv = RefundMaybeWithDerivedMetadataBuilder_build(this_arg_conv); + return tag_ptr(ret_conv, true); +} + 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); @@ -61571,6 +68798,16 @@ uint64_t __attribute__((export_name("TS_Refund_payer_note"))) TS_Refund_payer_n return ret_ref; } +int64_t __attribute__((export_name("TS_Refund_hash"))) TS_Refund_hash(uint64_t o) { + LDKRefund 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 = Refund_hash(&o_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_Refund_write"))) TS_Refund_write(uint64_t obj) { LDKRefund obj_conv; obj_conv.inner = untag_ptr(obj); @@ -61591,6 +68828,18 @@ uint64_t __attribute__((export_name("TS_Refund_from_str"))) TS_Refund_from_str( return tag_ptr(ret_conv, true); } +jstring __attribute__((export_name("TS_Refund_to_str"))) TS_Refund_to_str(uint64_t o) { + LDKRefund 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; + LDKStr ret_str = Refund_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + uint32_t __attribute__((export_name("TS_UtxoLookupError_clone"))) TS_UtxoLookupError_clone(uint64_t orig) { LDKUtxoLookupError* orig_conv = (LDKUtxoLookupError*)untag_ptr(orig); uint32_t ret_conv = LDKUtxoLookupError_to_js(UtxoLookupError_clone(orig_conv)); @@ -61802,6 +69051,16 @@ uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_p return ret_ref; } +uint64_t __attribute__((export_name("TS_NodeId_from_slice"))) TS_NodeId_from_slice(int8_tArray bytes) { + LDKu8slice bytes_ref; + bytes_ref.datalen = bytes->arr_len; + bytes_ref.data = bytes->elems; + LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ"); + *ret_conv = NodeId_from_slice(bytes_ref); + FREE(bytes); + return tag_ptr(ret_conv, true); +} + 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); @@ -61836,6 +69095,18 @@ uint64_t __attribute__((export_name("TS_NodeId_as_pubkey"))) TS_NodeId_as_pubke return tag_ptr(ret_conv, true); } +jstring __attribute__((export_name("TS_NodeId_to_str"))) TS_NodeId_to_str(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; + LDKStr ret_str = NodeId_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) { LDKNodeId o_conv; o_conv.inner = untag_ptr(o); @@ -62313,6 +69584,18 @@ jboolean __attribute__((export_name("TS_ChannelUpdateInfo_eq"))) TS_ChannelUpda return ret_conv; } +jstring __attribute__((export_name("TS_ChannelUpdateInfo_to_str"))) TS_ChannelUpdateInfo_to_str(uint64_t o) { + LDKChannelUpdateInfo 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; + LDKStr ret_str = ChannelUpdateInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) { LDKChannelUpdateInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -62589,6 +69872,18 @@ uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS return ret_ref; } +jstring __attribute__((export_name("TS_ChannelInfo_to_str"))) TS_ChannelInfo_to_str(uint64_t o) { + LDKChannelInfo 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; + LDKStr ret_str = ChannelInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) { LDKChannelInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -62675,6 +69970,32 @@ uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity" return ret_ref; } +uint64_t __attribute__((export_name("TS_DirectedChannelInfo_source"))) TS_DirectedChannelInfo_source(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; + LDKNodeId ret_var = DirectedChannelInfo_source(&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_DirectedChannelInfo_target"))) TS_DirectedChannelInfo_target(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; + LDKNodeId ret_var = DirectedChannelInfo_target(&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_EffectiveCapacity_free"))) TS_EffectiveCapacity_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -63227,6 +70548,18 @@ jboolean __attribute__((export_name("TS_NodeAlias_eq"))) TS_NodeAlias_eq(uint64 return ret_conv; } +jstring __attribute__((export_name("TS_NodeAlias_to_str"))) TS_NodeAlias_to_str(uint64_t o) { + LDKNodeAlias 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; + LDKStr ret_str = NodeAlias_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + 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); @@ -63395,6 +70728,28 @@ jboolean __attribute__((export_name("TS_NodeInfo_eq"))) TS_NodeInfo_eq(uint64_t return ret_conv; } +jboolean __attribute__((export_name("TS_NodeInfo_is_tor_only"))) TS_NodeInfo_is_tor_only(uint64_t this_arg) { + LDKNodeInfo this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = NodeInfo_is_tor_only(&this_arg_conv); + return ret_conv; +} + +jstring __attribute__((export_name("TS_NodeInfo_to_str"))) TS_NodeInfo_to_str(uint64_t o) { + LDKNodeInfo 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; + LDKStr ret_str = NodeInfo_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) { LDKNodeInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -63448,6 +70803,18 @@ uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_r return tag_ptr(ret_conv, true); } +jstring __attribute__((export_name("TS_NetworkGraph_to_str"))) TS_NetworkGraph_to_str(uint64_t o) { + LDKNetworkGraph 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; + LDKStr ret_str = NetworkGraph_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + return ret_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); @@ -64902,6 +72269,18 @@ int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_ return ret_conv; } +jstring __attribute__((export_name("TS_Route_to_str"))) TS_Route_to_str(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; + LDKStr ret_str = Route_to_str(&o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + 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); @@ -67542,7 +74921,34 @@ void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_ DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) TS_DelayedPaymentOutputDescriptor_new(uint64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, uint64_t output_arg, uint64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { +uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_transaction_parameters"))) TS_DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(uint64_t this_ptr) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters ret_var = DelayedPaymentOutputDescriptor_get_channel_transaction_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_DelayedPaymentOutputDescriptor_set_channel_transaction_parameters"))) TS_DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(uint64_t this_ptr, uint64_t val) { + LDKDelayedPaymentOutputDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKChannelTransactionParameters 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 = ChannelTransactionParameters_clone(&val_conv); + DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) TS_DelayedPaymentOutputDescriptor_new(uint64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, uint64_t output_arg, uint64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, uint64_t channel_transaction_parameters_arg) { LDKOutPoint outpoint_arg_conv; outpoint_arg_conv.inner = untag_ptr(outpoint_arg); outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg); @@ -67563,7 +74969,12 @@ uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_new"))) LDKThirtyTwoBytes channel_keys_id_arg_ref; CHECK(channel_keys_id_arg->arr_len == 32); memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg); - LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg); + LDKChannelTransactionParameters channel_transaction_parameters_arg_conv; + channel_transaction_parameters_arg_conv.inner = untag_ptr(channel_transaction_parameters_arg); + channel_transaction_parameters_arg_conv.is_owned = ptr_is_owned(channel_transaction_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_transaction_parameters_arg_conv); + channel_transaction_parameters_arg_conv = ChannelTransactionParameters_clone(&channel_transaction_parameters_arg_conv); + LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_new(outpoint_arg_conv, per_commitment_point_arg_ref, to_self_delay_arg, output_arg_conv, revocation_pubkey_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg, channel_transaction_parameters_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); @@ -68247,6 +75658,29 @@ void __attribute__((export_name("TS_HTLCDescriptor_set_channel_derivation_param HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } +int8_tArray __attribute__((export_name("TS_HTLCDescriptor_get_commitment_txid"))) TS_HTLCDescriptor_get_commitment_txid(uint64_t this_ptr) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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, *HTLCDescriptor_get_commitment_txid(&this_ptr_conv), 32); + return ret_arr; +} + +void __attribute__((export_name("TS_HTLCDescriptor_set_commitment_txid"))) TS_HTLCDescriptor_set_commitment_txid(uint64_t this_ptr, int8_tArray val) { + LDKHTLCDescriptor this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + HTLCDescriptor_set_commitment_txid(&this_ptr_conv, val_ref); +} + int64_t __attribute__((export_name("TS_HTLCDescriptor_get_per_commitment_number"))) TS_HTLCDescriptor_get_per_commitment_number(uint64_t this_ptr) { LDKHTLCDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -68383,6 +75817,37 @@ void __attribute__((export_name("TS_HTLCDescriptor_set_counterparty_sig"))) TS_ HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); } +uint64_t __attribute__((export_name("TS_HTLCDescriptor_new"))) TS_HTLCDescriptor_new(uint64_t channel_derivation_parameters_arg, int8_tArray commitment_txid_arg, int64_t per_commitment_number_arg, int8_tArray per_commitment_point_arg, int32_t feerate_per_kw_arg, uint64_t htlc_arg, uint64_t preimage_arg, int8_tArray counterparty_sig_arg) { + LDKChannelDerivationParameters channel_derivation_parameters_arg_conv; + channel_derivation_parameters_arg_conv.inner = untag_ptr(channel_derivation_parameters_arg); + channel_derivation_parameters_arg_conv.is_owned = ptr_is_owned(channel_derivation_parameters_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_derivation_parameters_arg_conv); + channel_derivation_parameters_arg_conv = ChannelDerivationParameters_clone(&channel_derivation_parameters_arg_conv); + LDKThirtyTwoBytes commitment_txid_arg_ref; + CHECK(commitment_txid_arg->arr_len == 32); + memcpy(commitment_txid_arg_ref.data, commitment_txid_arg->elems, 32); FREE(commitment_txid_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); + LDKHTLCOutputInCommitment htlc_arg_conv; + htlc_arg_conv.inner = untag_ptr(htlc_arg); + htlc_arg_conv.is_owned = ptr_is_owned(htlc_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_arg_conv); + htlc_arg_conv = HTLCOutputInCommitment_clone(&htlc_arg_conv); + void* preimage_arg_ptr = untag_ptr(preimage_arg); + CHECK_ACCESS(preimage_arg_ptr); + LDKCOption_ThirtyTwoBytesZ preimage_arg_conv = *(LDKCOption_ThirtyTwoBytesZ*)(preimage_arg_ptr); + preimage_arg_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(preimage_arg)); + LDKECDSASignature counterparty_sig_arg_ref; + CHECK(counterparty_sig_arg->arr_len == 64); + memcpy(counterparty_sig_arg_ref.compact_form, counterparty_sig_arg->elems, 64); FREE(counterparty_sig_arg); + LDKHTLCDescriptor ret_var = HTLCDescriptor_new(channel_derivation_parameters_arg_conv, commitment_txid_arg_ref, per_commitment_number_arg, per_commitment_point_arg_ref, feerate_per_kw_arg, htlc_arg_conv, preimage_arg_conv, counterparty_sig_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 HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg) { LDKHTLCDescriptor ret_var = HTLCDescriptor_clone(arg); uint64_t ret_ref = 0; @@ -68587,6 +76052,15 @@ void __attribute__((export_name("TS_NodeSigner_free"))) TS_NodeSigner_free(uint NodeSigner_free(this_ptr_conv); } +void __attribute__((export_name("TS_OutputSpender_free"))) TS_OutputSpender_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); + LDKOutputSpender this_ptr_conv = *(LDKOutputSpender*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpender_free(this_ptr_conv); +} + void __attribute__((export_name("TS_SignerProvider_free"))) TS_SignerProvider_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -68596,6 +76070,15 @@ void __attribute__((export_name("TS_SignerProvider_free"))) TS_SignerProvider_f SignerProvider_free(this_ptr_conv); } +void __attribute__((export_name("TS_ChangeDestinationSource_free"))) TS_ChangeDestinationSource_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); + LDKChangeDestinationSource this_ptr_conv = *(LDKChangeDestinationSource*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + ChangeDestinationSource_free(this_ptr_conv); +} + void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) { LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -69087,76 +76570,36 @@ uint64_t __attribute__((export_name("TS_KeysManager_sign_spendable_outputs_psbt return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_KeysManager_spend_spendable_outputs"))) TS_KeysManager_spend_spendable_outputs(uint64_t this_arg, uint64_tArray descriptors, uint64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, uint64_t locktime) { +uint64_t __attribute__((export_name("TS_KeysManager_as_EntropySource"))) TS_KeysManager_as_EntropySource(uint64_t this_arg) { LDKKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = descriptors->arr_len; - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - uint64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - uint64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - FREE(descriptors); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - uint64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - uint64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - FREE(outputs); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = change_destination_script->arr_len; - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); - void* locktime_ptr = untag_ptr(locktime); - CHECK_ACCESS(locktime_ptr); - LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); - locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); - return tag_ptr(ret_conv, true); + LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); + *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); } -uint64_t __attribute__((export_name("TS_KeysManager_as_EntropySource"))) TS_KeysManager_as_EntropySource(uint64_t this_arg) { +uint64_t __attribute__((export_name("TS_KeysManager_as_NodeSigner"))) TS_KeysManager_as_NodeSigner(uint64_t this_arg) { LDKKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKEntropySource* ret_ret = MALLOC(sizeof(LDKEntropySource), "LDKEntropySource"); - *ret_ret = KeysManager_as_EntropySource(&this_arg_conv); + LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); + *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); return tag_ptr(ret_ret, true); } -uint64_t __attribute__((export_name("TS_KeysManager_as_NodeSigner"))) TS_KeysManager_as_NodeSigner(uint64_t this_arg) { +uint64_t __attribute__((export_name("TS_KeysManager_as_OutputSpender"))) TS_KeysManager_as_OutputSpender(uint64_t this_arg) { LDKKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); this_arg_conv.is_owned = false; - LDKNodeSigner* ret_ret = MALLOC(sizeof(LDKNodeSigner), "LDKNodeSigner"); - *ret_ret = KeysManager_as_NodeSigner(&this_arg_conv); + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = KeysManager_as_OutputSpender(&this_arg_conv); return tag_ptr(ret_ret, true); } @@ -69201,6 +76644,17 @@ uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_NodeSigner"))) TS return tag_ptr(ret_ret, true); } +uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_OutputSpender"))) TS_PhantomKeysManager_as_OutputSpender(uint64_t this_arg) { + LDKPhantomKeysManager this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKOutputSpender* ret_ret = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *ret_ret = PhantomKeysManager_as_OutputSpender(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_SignerProvider"))) TS_PhantomKeysManager_as_SignerProvider(uint64_t this_arg) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -69228,57 +76682,6 @@ uint64_t __attribute__((export_name("TS_PhantomKeysManager_new"))) TS_PhantomKe return ret_ref; } -uint64_t __attribute__((export_name("TS_PhantomKeysManager_spend_spendable_outputs"))) TS_PhantomKeysManager_spend_spendable_outputs(uint64_t this_arg, uint64_tArray descriptors, uint64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, uint64_t locktime) { - LDKPhantomKeysManager this_arg_conv; - this_arg_conv.inner = untag_ptr(this_arg); - this_arg_conv.is_owned = ptr_is_owned(this_arg); - CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv.is_owned = false; - LDKCVec_SpendableOutputDescriptorZ descriptors_constr; - descriptors_constr.datalen = descriptors->arr_len; - if (descriptors_constr.datalen > 0) - descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements"); - else - descriptors_constr.data = NULL; - uint64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - uint64_t descriptors_conv_27 = descriptors_vals[b]; - void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27); - CHECK_ACCESS(descriptors_conv_27_ptr); - LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr); - descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27)); - descriptors_constr.data[b] = descriptors_conv_27_conv; - } - FREE(descriptors); - LDKCVec_TxOutZ outputs_constr; - outputs_constr.datalen = outputs->arr_len; - if (outputs_constr.datalen > 0) - outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements"); - else - outputs_constr.data = NULL; - uint64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - uint64_t outputs_conv_7 = outputs_vals[h]; - void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7); - CHECK_ACCESS(outputs_conv_7_ptr); - LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr); - outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7)); - outputs_constr.data[h] = outputs_conv_7_conv; - } - FREE(outputs); - LDKCVec_u8Z change_destination_script_ref; - change_destination_script_ref.datalen = change_destination_script->arr_len; - change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes"); - memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script); - void* locktime_ptr = untag_ptr(locktime); - CHECK_ACCESS(locktime_ptr); - LDKCOption_u32Z locktime_conv = *(LDKCOption_u32Z*)(locktime_ptr); - locktime_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(locktime)); - LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ"); - *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight, locktime_conv); - return tag_ptr(ret_conv, true); -} - uint64_t __attribute__((export_name("TS_PhantomKeysManager_derive_channel_keys"))) TS_PhantomKeysManager_derive_channel_keys(uint64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -69318,6 +76721,36 @@ int8_tArray __attribute__((export_name("TS_PhantomKeysManager_get_phantom_node_ return ret_arr; } +void __attribute__((export_name("TS_RandomBytes_free"))) TS_RandomBytes_free(uint64_t this_obj) { + LDKRandomBytes 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); + RandomBytes_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_RandomBytes_new"))) TS_RandomBytes_new(int8_tArray seed) { + LDKThirtyTwoBytes seed_ref; + CHECK(seed->arr_len == 32); + memcpy(seed_ref.data, seed->elems, 32); FREE(seed); + LDKRandomBytes ret_var = RandomBytes_new(seed_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_RandomBytes_as_EntropySource"))) TS_RandomBytes_as_EntropySource(uint64_t this_arg) { + LDKRandomBytes this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 = RandomBytes_as_EntropySource(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + void __attribute__((export_name("TS_EcdsaChannelSigner_free"))) TS_EcdsaChannelSigner_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -69638,6 +77071,29 @@ uint64_t __attribute__((export_name("TS_Destination_blinded_path"))) TS_Destina return ret_ref; } +int64_t __attribute__((export_name("TS_Destination_hash"))) TS_Destination_hash(uint64_t o) { + LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); + int64_t ret_conv = Destination_hash(o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_Destination_eq"))) TS_Destination_eq(uint64_t a, uint64_t b) { + LDKDestination* a_conv = (LDKDestination*)untag_ptr(a); + LDKDestination* b_conv = (LDKDestination*)untag_ptr(b); + jboolean ret_conv = Destination_eq(a_conv, b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_Destination_resolve"))) TS_Destination_resolve(uint64_t this_arg, uint64_t network_graph) { + LDKDestination* this_arg_conv = (LDKDestination*)untag_ptr(this_arg); + LDKReadOnlyNetworkGraph 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; + Destination_resolve(this_arg_conv, &network_graph_conv); +} + void __attribute__((export_name("TS_SendSuccess_free"))) TS_SendSuccess_free(uint64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -69684,6 +77140,12 @@ uint64_t __attribute__((export_name("TS_SendSuccess_buffered_awaiting_connectio return ret_ref; } +int64_t __attribute__((export_name("TS_SendSuccess_hash"))) TS_SendSuccess_hash(uint64_t o) { + LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); + int64_t ret_conv = SendSuccess_hash(o_conv); + return ret_conv; +} + jboolean __attribute__((export_name("TS_SendSuccess_eq"))) TS_SendSuccess_eq(uint64_t a, uint64_t b) { LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); @@ -69780,6 +77242,13 @@ uint64_t __attribute__((export_name("TS_SendError_get_node_id_failed"))) TS_Sen return ret_ref; } +uint64_t __attribute__((export_name("TS_SendError_unresolved_introduction_node"))) TS_SendError_unresolved_introduction_node() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_unresolved_introduction_node(); + 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(); @@ -69787,6 +77256,12 @@ uint64_t __attribute__((export_name("TS_SendError_blinded_path_advance_failed") return ret_ref; } +int64_t __attribute__((export_name("TS_SendError_hash"))) TS_SendError_hash(uint64_t o) { + LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); + int64_t ret_conv = SendError_hash(o_conv); + return ret_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); @@ -69832,17 +77307,18 @@ uint64_t __attribute__((export_name("TS_PeeledOnion_clone"))) TS_PeeledOnion_cl return ret_ref; } -uint64_t __attribute__((export_name("TS_PeeledOnion_forward"))) TS_PeeledOnion_forward(int8_tArray a, uint64_t b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); +uint64_t __attribute__((export_name("TS_PeeledOnion_forward"))) TS_PeeledOnion_forward(uint64_t a, uint64_t b) { + void* a_ptr = untag_ptr(a); + CHECK_ACCESS(a_ptr); + LDKNextMessageHop a_conv = *(LDKNextMessageHop*)(a_ptr); + a_conv = NextMessageHop_clone((LDKNextMessageHop*)untag_ptr(a)); LDKOnionMessage b_conv; b_conv.inner = untag_ptr(b); b_conv.is_owned = ptr_is_owned(b); CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv); b_conv = OnionMessage_clone(&b_conv); LDKPeeledOnion *ret_copy = MALLOC(sizeof(LDKPeeledOnion), "LDKPeeledOnion"); - *ret_copy = PeeledOnion_forward(a_ref, b_conv); + *ret_copy = PeeledOnion_forward(a_conv, b_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -69866,13 +77342,53 @@ uint64_t __attribute__((export_name("TS_PeeledOnion_receive"))) TS_PeeledOnion_ return ret_ref; } -uint64_t __attribute__((export_name("TS_create_onion_message"))) TS_create_onion_message(uint64_t entropy_source, uint64_t node_signer, uint64_t path, uint64_t contents, uint64_t reply_path) { +uint64_t __attribute__((export_name("TS_create_onion_message_resolving_destination"))) TS_create_onion_message_resolving_destination(uint64_t entropy_source, uint64_t node_signer, uint64_t node_id_lookup, uint64_t network_graph, uint64_t path, uint64_t contents, uint64_t reply_path) { + void* entropy_source_ptr = untag_ptr(entropy_source); + if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } + LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; + void* node_signer_ptr = untag_ptr(node_signer); + if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } + LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; + LDKReadOnlyNetworkGraph 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; + LDKOnionMessagePath 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 = OnionMessagePath_clone(&path_conv); + void* contents_ptr = untag_ptr(contents); + CHECK_ACCESS(contents_ptr); + LDKOnionMessageContents contents_conv = *(LDKOnionMessageContents*)(contents_ptr); + if (contents_conv.free == LDKOnionMessageContents_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKOnionMessageContents_JCalls_cloned(&contents_conv); + } + 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_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); + *ret_conv = create_onion_message_resolving_destination(entropy_source_conv, node_signer_conv, node_id_lookup_conv, &network_graph_conv, path_conv, contents_conv, reply_path_conv); + return tag_ptr(ret_conv, true); +} + +uint64_t __attribute__((export_name("TS_create_onion_message"))) TS_create_onion_message(uint64_t entropy_source, uint64_t node_signer, uint64_t node_id_lookup, uint64_t path, uint64_t contents, uint64_t reply_path) { void* entropy_source_ptr = untag_ptr(entropy_source); if (ptr_is_owned(entropy_source)) { CHECK_ACCESS(entropy_source_ptr); } LDKEntropySource* entropy_source_conv = (LDKEntropySource*)entropy_source_ptr; void* node_signer_ptr = untag_ptr(node_signer); if (ptr_is_owned(node_signer)) { CHECK_ACCESS(node_signer_ptr); } LDKNodeSigner* node_signer_conv = (LDKNodeSigner*)node_signer_ptr; + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + if (ptr_is_owned(node_id_lookup)) { CHECK_ACCESS(node_id_lookup_ptr); } + LDKNodeIdLookUp* node_id_lookup_conv = (LDKNodeIdLookUp*)node_id_lookup_ptr; LDKOnionMessagePath path_conv; path_conv.inner = untag_ptr(path); path_conv.is_owned = ptr_is_owned(path); @@ -69891,7 +77407,7 @@ uint64_t __attribute__((export_name("TS_create_onion_message"))) TS_create_onio CHECK_INNER_FIELD_ACCESS_OR_NULL(reply_path_conv); reply_path_conv = BlindedPath_clone(&reply_path_conv); LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ), "LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ"); - *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, path_conv, contents_conv, reply_path_conv); + *ret_conv = create_onion_message(entropy_source_conv, node_signer_conv, node_id_lookup_conv, path_conv, contents_conv, reply_path_conv); return tag_ptr(ret_conv, true); } @@ -69927,7 +77443,7 @@ uint64_t __attribute__((export_name("TS_peel_onion_message"))) TS_peel_onion_me return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t entropy_source, uint64_t node_signer, uint64_t logger, uint64_t message_router, uint64_t offers_handler, uint64_t custom_handler) { +uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenger_new(uint64_t entropy_source, uint64_t node_signer, uint64_t logger, uint64_t node_id_lookup, uint64_t message_router, uint64_t offers_handler, 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); @@ -69949,6 +77465,13 @@ uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenge // If this_arg is a JCalls struct, then we need to increment the refcnt in it. LDKLogger_JCalls_cloned(&logger_conv); } + void* node_id_lookup_ptr = untag_ptr(node_id_lookup); + CHECK_ACCESS(node_id_lookup_ptr); + LDKNodeIdLookUp node_id_lookup_conv = *(LDKNodeIdLookUp*)(node_id_lookup_ptr); + if (node_id_lookup_conv.free == LDKNodeIdLookUp_JCalls_free) { + // If this_arg is a JCalls struct, then we need to increment the refcnt in it. + LDKNodeIdLookUp_JCalls_cloned(&node_id_lookup_conv); + } void* message_router_ptr = untag_ptr(message_router); CHECK_ACCESS(message_router_ptr); LDKMessageRouter message_router_conv = *(LDKMessageRouter*)(message_router_ptr); @@ -69970,7 +77493,7 @@ uint64_t __attribute__((export_name("TS_OnionMessenger_new"))) TS_OnionMessenge // 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, message_router_conv, offers_handler_conv, custom_handler_conv); + LDKOnionMessenger ret_var = OnionMessenger_new(entropy_source_conv, node_signer_conv, logger_conv, node_id_lookup_conv, message_router_conv, offers_handler_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); @@ -70409,6 +77932,65 @@ void __attribute__((export_name("TS_OnionMessageContents_free"))) TS_OnionMessa OnionMessageContents_free(this_ptr_conv); } +void __attribute__((export_name("TS_NextMessageHop_free"))) TS_NextMessageHop_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); + LDKNextMessageHop this_ptr_conv = *(LDKNextMessageHop*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NextMessageHop_free(this_ptr_conv); +} + +static inline uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_NextMessageHop_clone_ptr"))) TS_NextMessageHop_clone_ptr(uint64_t arg) { + LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); + int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_NextMessageHop_clone"))) TS_NextMessageHop_clone(uint64_t orig) { + LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_NextMessageHop_node_id"))) TS_NextMessageHop_node_id(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_node_id(a_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_NextMessageHop_short_channel_id"))) TS_NextMessageHop_short_channel_id(int64_t a) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_short_channel_id(a); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t __attribute__((export_name("TS_NextMessageHop_hash"))) TS_NextMessageHop_hash(uint64_t o) { + LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); + int64_t ret_conv = NextMessageHop_hash(o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_NextMessageHop_eq"))) TS_NextMessageHop_eq(uint64_t a, uint64_t b) { + LDKNextMessageHop* a_conv = (LDKNextMessageHop*)untag_ptr(a); + LDKNextMessageHop* b_conv = (LDKNextMessageHop*)untag_ptr(b); + jboolean ret_conv = NextMessageHop_eq(a_conv, b_conv); + return ret_conv; +} + 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); @@ -70417,27 +77999,29 @@ void __attribute__((export_name("TS_BlindedPath_free"))) TS_BlindedPath_free(ui BlindedPath_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_BlindedPath_get_introduction_node_id"))) TS_BlindedPath_get_introduction_node_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_BlindedPath_get_introduction_node"))) TS_BlindedPath_get_introduction_node(uint64_t this_ptr) { LDKBlindedPath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, BlindedPath_get_introduction_node_id(&this_ptr_conv).compressed_form, 33); - return ret_arr; + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = BlindedPath_get_introduction_node(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void __attribute__((export_name("TS_BlindedPath_set_introduction_node_id"))) TS_BlindedPath_set_introduction_node_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_BlindedPath_set_introduction_node"))) TS_BlindedPath_set_introduction_node(uint64_t this_ptr, uint64_t val) { LDKBlindedPath this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - BlindedPath_set_introduction_node_id(&this_ptr_conv, val_ref); + void* val_ptr = untag_ptr(val); + CHECK_ACCESS(val_ptr); + LDKIntroductionNode val_conv = *(LDKIntroductionNode*)(val_ptr); + val_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(val)); + BlindedPath_set_introduction_node(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_BlindedPath_get_blinding_point"))) TS_BlindedPath_get_blinding_point(uint64_t this_ptr) { @@ -70511,10 +78095,11 @@ void __attribute__((export_name("TS_BlindedPath_set_blinded_hops"))) TS_Blinded BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); } -uint64_t __attribute__((export_name("TS_BlindedPath_new"))) TS_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArray blinding_point_arg, uint64_tArray blinded_hops_arg) { - LDKPublicKey introduction_node_id_arg_ref; - CHECK(introduction_node_id_arg->arr_len == 33); - memcpy(introduction_node_id_arg_ref.compressed_form, introduction_node_id_arg->elems, 33); FREE(introduction_node_id_arg); +uint64_t __attribute__((export_name("TS_BlindedPath_new"))) TS_BlindedPath_new(uint64_t introduction_node_arg, int8_tArray blinding_point_arg, uint64_tArray blinded_hops_arg) { + void* introduction_node_arg_ptr = untag_ptr(introduction_node_arg); + CHECK_ACCESS(introduction_node_arg_ptr); + LDKIntroductionNode introduction_node_arg_conv = *(LDKIntroductionNode*)(introduction_node_arg_ptr); + introduction_node_arg_conv = IntroductionNode_clone((LDKIntroductionNode*)untag_ptr(introduction_node_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); @@ -70535,7 +78120,7 @@ uint64_t __attribute__((export_name("TS_BlindedPath_new"))) TS_BlindedPath_new( blinded_hops_arg_constr.data[m] = blinded_hops_arg_conv_12_conv; } FREE(blinded_hops_arg); - LDKBlindedPath ret_var = BlindedPath_new(introduction_node_id_arg_ref, blinding_point_arg_ref, blinded_hops_arg_constr); + LDKBlindedPath ret_var = BlindedPath_new(introduction_node_arg_conv, blinding_point_arg_ref, blinded_hops_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); @@ -70597,6 +78182,131 @@ jboolean __attribute__((export_name("TS_BlindedPath_eq"))) TS_BlindedPath_eq(ui return ret_conv; } +void __attribute__((export_name("TS_IntroductionNode_free"))) TS_IntroductionNode_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); + LDKIntroductionNode this_ptr_conv = *(LDKIntroductionNode*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + IntroductionNode_free(this_ptr_conv); +} + +static inline uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg) { + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_IntroductionNode_clone_ptr"))) TS_IntroductionNode_clone_ptr(uint64_t arg) { + LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); + int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_IntroductionNode_clone"))) TS_IntroductionNode_clone(uint64_t orig) { + LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_IntroductionNode_node_id"))) TS_IntroductionNode_node_id(int8_tArray a) { + LDKPublicKey a_ref; + CHECK(a->arr_len == 33); + memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_node_id(a_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_IntroductionNode_directed_short_channel_id"))) TS_IntroductionNode_directed_short_channel_id(uint32_t a, int64_t b) { + LDKDirection a_conv = LDKDirection_from_js(a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t __attribute__((export_name("TS_IntroductionNode_hash"))) TS_IntroductionNode_hash(uint64_t o) { + LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); + int64_t ret_conv = IntroductionNode_hash(o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_IntroductionNode_eq"))) TS_IntroductionNode_eq(uint64_t a, uint64_t b) { + LDKIntroductionNode* a_conv = (LDKIntroductionNode*)untag_ptr(a); + LDKIntroductionNode* b_conv = (LDKIntroductionNode*)untag_ptr(b); + jboolean ret_conv = IntroductionNode_eq(a_conv, b_conv); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Direction_clone"))) TS_Direction_clone(uint64_t orig) { + LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); + uint32_t ret_conv = LDKDirection_to_js(Direction_clone(orig_conv)); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Direction_node_one"))) TS_Direction_node_one() { + uint32_t ret_conv = LDKDirection_to_js(Direction_node_one()); + return ret_conv; +} + +uint32_t __attribute__((export_name("TS_Direction_node_two"))) TS_Direction_node_two() { + uint32_t ret_conv = LDKDirection_to_js(Direction_node_two()); + return ret_conv; +} + +int64_t __attribute__((export_name("TS_Direction_hash"))) TS_Direction_hash(uint64_t o) { + LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); + int64_t ret_conv = Direction_hash(o_conv); + return ret_conv; +} + +jboolean __attribute__((export_name("TS_Direction_eq"))) TS_Direction_eq(uint64_t a, uint64_t b) { + LDKDirection* a_conv = (LDKDirection*)untag_ptr(a); + LDKDirection* b_conv = (LDKDirection*)untag_ptr(b); + jboolean ret_conv = Direction_eq(a_conv, b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_NodeIdLookUp_free"))) TS_NodeIdLookUp_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); + LDKNodeIdLookUp this_ptr_conv = *(LDKNodeIdLookUp*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + NodeIdLookUp_free(this_ptr_conv); +} + +void __attribute__((export_name("TS_EmptyNodeIdLookUp_free"))) TS_EmptyNodeIdLookUp_free(uint64_t this_obj) { + LDKEmptyNodeIdLookUp 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); + EmptyNodeIdLookUp_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_EmptyNodeIdLookUp_new"))) TS_EmptyNodeIdLookUp_new() { + LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_EmptyNodeIdLookUp_as_NodeIdLookUp"))) TS_EmptyNodeIdLookUp_as_NodeIdLookUp(uint64_t this_arg) { + LDKEmptyNodeIdLookUp this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_arg_conv.is_owned = ptr_is_owned(this_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); + this_arg_conv.is_owned = false; + LDKNodeIdLookUp* ret_ret = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *ret_ret = EmptyNodeIdLookUp_as_NodeIdLookUp(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + 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); @@ -70729,8 +78439,12 @@ uint64_t __attribute__((export_name("TS_BlindedPath_one_hop_for_message"))) TS_ CHECK(recipient_node_id->arr_len == 33); memcpy(recipient_node_id_ref.compressed_form, recipient_node_id->elems, 33); FREE(recipient_node_id); 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; + 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); + } LDKCResult_BlindedPathNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_BlindedPathNoneZ), "LDKCResult_BlindedPathNoneZ"); *ret_conv = BlindedPath_one_hop_for_message(recipient_node_id_ref, entropy_source_conv); return tag_ptr(ret_conv, true); @@ -70753,14 +78467,18 @@ uint64_t __attribute__((export_name("TS_BlindedPath_new_for_message"))) TS_Blin } 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; + 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); + } 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); } -uint64_t __attribute__((export_name("TS_BlindedPath_one_hop_for_payment"))) TS_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, uint64_t payee_tlvs, uint64_t entropy_source) { +uint64_t __attribute__((export_name("TS_BlindedPath_one_hop_for_payment"))) TS_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, uint64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, uint64_t entropy_source) { LDKPublicKey payee_node_id_ref; CHECK(payee_node_id->arr_len == 33); memcpy(payee_node_id_ref.compressed_form, payee_node_id->elems, 33); FREE(payee_node_id); @@ -70770,14 +78488,18 @@ uint64_t __attribute__((export_name("TS_BlindedPath_one_hop_for_payment"))) TS_ CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); 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; + 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); + } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_one_hop_for_payment(payee_node_id_ref, payee_tlvs_conv, entropy_source_conv); + *ret_conv = BlindedPath_one_hop_for_payment(payee_node_id_ref, payee_tlvs_conv, min_final_cltv_expiry_delta, entropy_source_conv); return tag_ptr(ret_conv, true); } -uint64_t __attribute__((export_name("TS_BlindedPath_new_for_payment"))) TS_BlindedPath_new_for_payment(uint64_tArray intermediate_nodes, int8_tArray payee_node_id, uint64_t payee_tlvs, int64_t htlc_maximum_msat, uint64_t entropy_source) { +uint64_t __attribute__((export_name("TS_BlindedPath_new_for_payment"))) TS_BlindedPath_new_for_payment(uint64_tArray intermediate_nodes, int8_tArray payee_node_id, uint64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, uint64_t entropy_source) { LDKCVec_ForwardNodeZ intermediate_nodes_constr; intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; if (intermediate_nodes_constr.datalen > 0) @@ -70804,13 +78526,35 @@ uint64_t __attribute__((export_name("TS_BlindedPath_new_for_payment"))) TS_Blin CHECK_INNER_FIELD_ACCESS_OR_NULL(payee_tlvs_conv); payee_tlvs_conv = ReceiveTlvs_clone(&payee_tlvs_conv); 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; + 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); + } LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ), "LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ"); - *ret_conv = BlindedPath_new_for_payment(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, entropy_source_conv); + *ret_conv = BlindedPath_new_for_payment(intermediate_nodes_constr, payee_node_id_ref, payee_tlvs_conv, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source_conv); return tag_ptr(ret_conv, true); } +uint64_t __attribute__((export_name("TS_BlindedPath_public_introduction_node_id"))) TS_BlindedPath_public_introduction_node_id(uint64_t this_arg, uint64_t network_graph) { + LDKBlindedPath this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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 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; + LDKNodeId ret_var = BlindedPath_public_introduction_node_id(&this_arg_conv, &network_graph_conv); + uint64_t ret_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_BlindedPath_write"))) TS_BlindedPath_write(uint64_t obj) { LDKBlindedPath obj_conv; obj_conv.inner = untag_ptr(obj); @@ -71199,7 +78943,32 @@ void __attribute__((export_name("TS_ReceiveTlvs_set_payment_constraints"))) TS_ ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -uint64_t __attribute__((export_name("TS_ReceiveTlvs_new"))) TS_ReceiveTlvs_new(int8_tArray payment_secret_arg, uint64_t payment_constraints_arg) { +uint64_t __attribute__((export_name("TS_ReceiveTlvs_get_payment_context"))) TS_ReceiveTlvs_get_payment_context(uint64_t this_ptr) { + LDKReceiveTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = ReceiveTlvs_get_payment_context(&this_ptr_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void __attribute__((export_name("TS_ReceiveTlvs_set_payment_context"))) TS_ReceiveTlvs_set_payment_context(uint64_t this_ptr, uint64_t val) { + LDKReceiveTlvs this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_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); + LDKPaymentContext val_conv = *(LDKPaymentContext*)(val_ptr); + val_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(val)); + ReceiveTlvs_set_payment_context(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_ReceiveTlvs_new"))) TS_ReceiveTlvs_new(int8_tArray payment_secret_arg, uint64_t payment_constraints_arg, uint64_t payment_context_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); @@ -71208,7 +78977,11 @@ uint64_t __attribute__((export_name("TS_ReceiveTlvs_new"))) TS_ReceiveTlvs_new( payment_constraints_arg_conv.is_owned = ptr_is_owned(payment_constraints_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_constraints_arg_conv); payment_constraints_arg_conv = PaymentConstraints_clone(&payment_constraints_arg_conv); - LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv); + void* payment_context_arg_ptr = untag_ptr(payment_context_arg); + CHECK_ACCESS(payment_context_arg_ptr); + LDKPaymentContext payment_context_arg_conv = *(LDKPaymentContext*)(payment_context_arg_ptr); + payment_context_arg_conv = PaymentContext_clone((LDKPaymentContext*)untag_ptr(payment_context_arg)); + LDKReceiveTlvs ret_var = ReceiveTlvs_new(payment_secret_arg_ref, payment_constraints_arg_conv, payment_context_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); @@ -71432,6 +79205,317 @@ uint64_t __attribute__((export_name("TS_PaymentConstraints_clone"))) TS_Payment return ret_ref; } +void __attribute__((export_name("TS_PaymentContext_free"))) TS_PaymentContext_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); + LDKPaymentContext this_ptr_conv = *(LDKPaymentContext*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + PaymentContext_free(this_ptr_conv); +} + +static inline uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg) { + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(arg); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t __attribute__((export_name("TS_PaymentContext_clone_ptr"))) TS_PaymentContext_clone_ptr(uint64_t arg) { + LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); + int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_PaymentContext_clone"))) TS_PaymentContext_clone(uint64_t orig) { + LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(orig_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PaymentContext_unknown"))) TS_PaymentContext_unknown(uint64_t a) { + LDKUnknownPaymentContext 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 = UnknownPaymentContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_unknown(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PaymentContext_bolt12_offer"))) TS_PaymentContext_bolt12_offer(uint64_t a) { + LDKBolt12OfferContext 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 = Bolt12OfferContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_offer(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PaymentContext_bolt12_refund"))) TS_PaymentContext_bolt12_refund(uint64_t a) { + LDKBolt12RefundContext 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 = Bolt12RefundContext_clone(&a_conv); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_bolt12_refund(a_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean __attribute__((export_name("TS_PaymentContext_eq"))) TS_PaymentContext_eq(uint64_t a, uint64_t b) { + LDKPaymentContext* a_conv = (LDKPaymentContext*)untag_ptr(a); + LDKPaymentContext* b_conv = (LDKPaymentContext*)untag_ptr(b); + jboolean ret_conv = PaymentContext_eq(a_conv, b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_UnknownPaymentContext_free"))) TS_UnknownPaymentContext_free(uint64_t this_obj) { + LDKUnknownPaymentContext 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); + UnknownPaymentContext_free(this_obj_conv); +} + +static inline uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg) { + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_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_UnknownPaymentContext_clone_ptr"))) TS_UnknownPaymentContext_clone_ptr(uint64_t arg) { + LDKUnknownPaymentContext 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 = UnknownPaymentContext_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_UnknownPaymentContext_clone"))) TS_UnknownPaymentContext_clone(uint64_t orig) { + LDKUnknownPaymentContext 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; + LDKUnknownPaymentContext ret_var = UnknownPaymentContext_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_UnknownPaymentContext_eq"))) TS_UnknownPaymentContext_eq(uint64_t a, uint64_t b) { + LDKUnknownPaymentContext 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; + LDKUnknownPaymentContext 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 = UnknownPaymentContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_Bolt12OfferContext_free"))) TS_Bolt12OfferContext_free(uint64_t this_obj) { + LDKBolt12OfferContext 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); + Bolt12OfferContext_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_Bolt12OfferContext_get_offer_id"))) TS_Bolt12OfferContext_get_offer_id(uint64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId ret_var = Bolt12OfferContext_get_offer_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + +void __attribute__((export_name("TS_Bolt12OfferContext_set_offer_id"))) TS_Bolt12OfferContext_set_offer_id(uint64_t this_ptr, uint64_t val) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKOfferId 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 = OfferId_clone(&val_conv); + Bolt12OfferContext_set_offer_id(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_Bolt12OfferContext_get_invoice_request"))) TS_Bolt12OfferContext_get_invoice_request(uint64_t this_ptr) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInvoiceRequestFields ret_var = Bolt12OfferContext_get_invoice_request(&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_Bolt12OfferContext_set_invoice_request"))) TS_Bolt12OfferContext_set_invoice_request(uint64_t this_ptr, uint64_t val) { + LDKBolt12OfferContext this_ptr_conv; + this_ptr_conv.inner = untag_ptr(this_ptr); + this_ptr_conv.is_owned = ptr_is_owned(this_ptr); + CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv); + this_ptr_conv.is_owned = false; + LDKInvoiceRequestFields 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 = InvoiceRequestFields_clone(&val_conv); + Bolt12OfferContext_set_invoice_request(&this_ptr_conv, val_conv); +} + +uint64_t __attribute__((export_name("TS_Bolt12OfferContext_new"))) TS_Bolt12OfferContext_new(uint64_t offer_id_arg, uint64_t invoice_request_arg) { + LDKOfferId offer_id_arg_conv; + offer_id_arg_conv.inner = untag_ptr(offer_id_arg); + offer_id_arg_conv.is_owned = ptr_is_owned(offer_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(offer_id_arg_conv); + offer_id_arg_conv = OfferId_clone(&offer_id_arg_conv); + LDKInvoiceRequestFields invoice_request_arg_conv; + invoice_request_arg_conv.inner = untag_ptr(invoice_request_arg); + invoice_request_arg_conv.is_owned = ptr_is_owned(invoice_request_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_request_arg_conv); + invoice_request_arg_conv = InvoiceRequestFields_clone(&invoice_request_arg_conv); + LDKBolt12OfferContext ret_var = Bolt12OfferContext_new(offer_id_arg_conv, invoice_request_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 Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg) { + LDKBolt12OfferContext ret_var = Bolt12OfferContext_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_Bolt12OfferContext_clone_ptr"))) TS_Bolt12OfferContext_clone_ptr(uint64_t arg) { + LDKBolt12OfferContext 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 = Bolt12OfferContext_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Bolt12OfferContext_clone"))) TS_Bolt12OfferContext_clone(uint64_t orig) { + LDKBolt12OfferContext 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; + LDKBolt12OfferContext ret_var = Bolt12OfferContext_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_Bolt12OfferContext_eq"))) TS_Bolt12OfferContext_eq(uint64_t a, uint64_t b) { + LDKBolt12OfferContext 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; + LDKBolt12OfferContext 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 = Bolt12OfferContext_eq(&a_conv, &b_conv); + return ret_conv; +} + +void __attribute__((export_name("TS_Bolt12RefundContext_free"))) TS_Bolt12RefundContext_free(uint64_t this_obj) { + LDKBolt12RefundContext 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); + Bolt12RefundContext_free(this_obj_conv); +} + +uint64_t __attribute__((export_name("TS_Bolt12RefundContext_new"))) TS_Bolt12RefundContext_new() { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_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; +} + +static inline uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg) { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_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_Bolt12RefundContext_clone_ptr"))) TS_Bolt12RefundContext_clone_ptr(uint64_t arg) { + LDKBolt12RefundContext 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 = Bolt12RefundContext_clone_ptr(&arg_conv); + return ret_conv; +} + +uint64_t __attribute__((export_name("TS_Bolt12RefundContext_clone"))) TS_Bolt12RefundContext_clone(uint64_t orig) { + LDKBolt12RefundContext 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; + LDKBolt12RefundContext ret_var = Bolt12RefundContext_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_Bolt12RefundContext_eq"))) TS_Bolt12RefundContext_eq(uint64_t a, uint64_t b) { + LDKBolt12RefundContext 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; + LDKBolt12RefundContext 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 = Bolt12RefundContext_eq(&a_conv, &b_conv); + return ret_conv; +} + int8_tArray __attribute__((export_name("TS_ForwardTlvs_write"))) TS_ForwardTlvs_write(uint64_t obj) { LDKForwardTlvs obj_conv; obj_conv.inner = untag_ptr(obj); @@ -71504,6 +79588,94 @@ uint64_t __attribute__((export_name("TS_PaymentConstraints_read"))) TS_PaymentC return tag_ptr(ret_conv, true); } +int8_tArray __attribute__((export_name("TS_PaymentContext_write"))) TS_PaymentContext_write(uint64_t obj) { + LDKPaymentContext* obj_conv = (LDKPaymentContext*)untag_ptr(obj); + LDKCVec_u8Z ret_var = PaymentContext_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_PaymentContext_read"))) TS_PaymentContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = PaymentContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_UnknownPaymentContext_write"))) TS_UnknownPaymentContext_write(uint64_t obj) { + LDKUnknownPaymentContext 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 = UnknownPaymentContext_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_UnknownPaymentContext_read"))) TS_UnknownPaymentContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = UnknownPaymentContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_Bolt12OfferContext_write"))) TS_Bolt12OfferContext_write(uint64_t obj) { + LDKBolt12OfferContext 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 = Bolt12OfferContext_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_Bolt12OfferContext_read"))) TS_Bolt12OfferContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = Bolt12OfferContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + +int8_tArray __attribute__((export_name("TS_Bolt12RefundContext_write"))) TS_Bolt12RefundContext_write(uint64_t obj) { + LDKBolt12RefundContext 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 = Bolt12RefundContext_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_Bolt12RefundContext_read"))) TS_Bolt12RefundContext_read(int8_tArray ser) { + LDKu8slice ser_ref; + ser_ref.datalen = ser->arr_len; + ser_ref.data = ser->elems; + LDKCResult_Bolt12RefundContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12RefundContextDecodeErrorZ), "LDKCResult_Bolt12RefundContextDecodeErrorZ"); + *ret_conv = Bolt12RefundContext_read(ser_ref); + FREE(ser); + return tag_ptr(ret_conv, true); +} + 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); @@ -71533,7 +79705,21 @@ uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurp return ret_ref; } -uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(uint64_t payment_preimage, int8_tArray payment_secret) { +uint64_t __attribute__((export_name("TS_PaymentPurpose_bolt11_invoice_payment"))) TS_PaymentPurpose_bolt11_invoice_payment(uint64_t payment_preimage, int8_tArray payment_secret) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(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_bolt11_invoice_payment(payment_preimage_conv, payment_secret_ref); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PaymentPurpose_bolt12_offer_payment"))) TS_PaymentPurpose_bolt12_offer_payment(uint64_t payment_preimage, int8_tArray payment_secret, uint64_t payment_context) { void* payment_preimage_ptr = untag_ptr(payment_preimage); CHECK_ACCESS(payment_preimage_ptr); LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); @@ -71541,8 +79727,32 @@ uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_P LDKThirtyTwoBytes payment_secret_ref; CHECK(payment_secret->arr_len == 32); memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKBolt12OfferContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12OfferContext_clone(&payment_context_conv); LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); - *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_conv, payment_secret_ref); + *ret_copy = PaymentPurpose_bolt12_offer_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_PaymentPurpose_bolt12_refund_payment"))) TS_PaymentPurpose_bolt12_refund_payment(uint64_t payment_preimage, int8_tArray payment_secret, uint64_t payment_context) { + void* payment_preimage_ptr = untag_ptr(payment_preimage); + CHECK_ACCESS(payment_preimage_ptr); + LDKCOption_ThirtyTwoBytesZ payment_preimage_conv = *(LDKCOption_ThirtyTwoBytesZ*)(payment_preimage_ptr); + payment_preimage_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(payment_preimage)); + LDKThirtyTwoBytes payment_secret_ref; + CHECK(payment_secret->arr_len == 32); + memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret); + LDKBolt12RefundContext payment_context_conv; + payment_context_conv.inner = untag_ptr(payment_context); + payment_context_conv.is_owned = ptr_is_owned(payment_context); + CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_context_conv); + payment_context_conv = Bolt12RefundContext_clone(&payment_context_conv); + LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose"); + *ret_copy = PaymentPurpose_bolt12_refund_payment(payment_preimage_conv, payment_secret_ref, payment_context_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -71599,27 +79809,31 @@ void __attribute__((export_name("TS_ClaimedHTLC_free"))) TS_ClaimedHTLC_free(ui ClaimedHTLC_free(this_obj_conv); } -int8_tArray __attribute__((export_name("TS_ClaimedHTLC_get_channel_id"))) TS_ClaimedHTLC_get_channel_id(uint64_t this_ptr) { +uint64_t __attribute__((export_name("TS_ClaimedHTLC_get_channel_id"))) TS_ClaimedHTLC_get_channel_id(uint64_t this_ptr) { LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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, *ClaimedHTLC_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ClaimedHTLC_get_channel_id(&this_ptr_conv); + uint64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -void __attribute__((export_name("TS_ClaimedHTLC_set_channel_id"))) TS_ClaimedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) { +void __attribute__((export_name("TS_ClaimedHTLC_set_channel_id"))) TS_ClaimedHTLC_set_channel_id(uint64_t this_ptr, uint64_t val) { LDKClaimedHTLC this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); this_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); - ClaimedHTLC_set_channel_id(&this_ptr_conv, val_ref); + LDKChannelId 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 = ChannelId_clone(&val_conv); + ClaimedHTLC_set_channel_id(&this_ptr_conv, val_conv); } int8_tArray __attribute__((export_name("TS_ClaimedHTLC_get_user_channel_id"))) TS_ClaimedHTLC_get_user_channel_id(uint64_t this_ptr) { @@ -71702,14 +79916,16 @@ void __attribute__((export_name("TS_ClaimedHTLC_set_counterparty_skimmed_fee_ms ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -uint64_t __attribute__((export_name("TS_ClaimedHTLC_new"))) TS_ClaimedHTLC_new(int8_tArray channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_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); +uint64_t __attribute__((export_name("TS_ClaimedHTLC_new"))) TS_ClaimedHTLC_new(uint64_t channel_id_arg, int8_tArray user_channel_id_arg, int32_t cltv_expiry_arg, int64_t value_msat_arg, int64_t counterparty_skimmed_fee_msat_arg) { + LDKChannelId channel_id_arg_conv; + channel_id_arg_conv.inner = untag_ptr(channel_id_arg); + channel_id_arg_conv.is_owned = ptr_is_owned(channel_id_arg); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_arg_conv); + channel_id_arg_conv = ChannelId_clone(&channel_id_arg_conv); 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); - LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_ref, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); + LDKClaimedHTLC ret_var = ClaimedHTLC_new(channel_id_arg_conv, user_channel_id_arg_ref, cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_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); @@ -71909,9 +80125,23 @@ uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) T return ret_ref; } -uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() { +uint64_t __attribute__((export_name("TS_ClosureReason_legacy_cooperative_closure"))) TS_ClosureReason_legacy_cooperative_closure() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_cooperative_closure(); + *ret_copy = ClosureReason_legacy_cooperative_closure(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_initiated_cooperative_closure"))) TS_ClosureReason_counterparty_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +uint64_t __attribute__((export_name("TS_ClosureReason_locally_initiated_cooperative_closure"))) TS_ClosureReason_locally_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -71966,6 +80196,13 @@ uint64_t __attribute__((export_name("TS_ClosureReason_funding_batch_closure"))) return ret_ref; } +uint64_t __attribute__((export_name("TS_ClosureReason_htlcs_timed_out"))) TS_ClosureReason_htlcs_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_htlcs_timed_out(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + jboolean __attribute__((export_name("TS_ClosureReason_eq"))) TS_ClosureReason_eq(uint64_t a, uint64_t b) { LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); @@ -71973,6 +80210,14 @@ jboolean __attribute__((export_name("TS_ClosureReason_eq"))) TS_ClosureReason_e return ret_conv; } +jstring __attribute__((export_name("TS_ClosureReason_to_str"))) TS_ClosureReason_to_str(uint64_t o) { + LDKClosureReason* o_conv = (LDKClosureReason*)untag_ptr(o); + LDKStr ret_str = ClosureReason_to_str(o_conv); + jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len); + Str_free(ret_str); + 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); @@ -72021,15 +80266,17 @@ uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestin return ret_ref; } -uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) { +uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, uint64_t 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); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); - *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref); + *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72048,6 +80295,13 @@ uint64_t __attribute__((export_name("TS_HTLCDestination_invalid_forward"))) TS_ return ret_ref; } +uint64_t __attribute__((export_name("TS_HTLCDestination_invalid_onion"))) TS_HTLCDestination_invalid_onion() { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_onion(); + uint64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); @@ -72175,10 +80429,12 @@ uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t return ret_ref; } -uint64_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, 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); +uint64_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_Event_funding_generation_ready(uint64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t channel_value_satoshis, int8_tArray output_script, int8_tArray user_channel_id) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); 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); @@ -72190,7 +80446,7 @@ uint64_t __attribute__((export_name("TS_Event_funding_generation_ready"))) TS_E 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); + *ret_copy = Event_funding_generation_ready(temporary_channel_id_conv, 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; } @@ -72211,10 +80467,11 @@ uint64_t __attribute__((export_name("TS_Event_payment_claimable"))) TS_Event_pa CHECK_ACCESS(purpose_ptr); LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr); purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose)); - void* via_channel_id_ptr = untag_ptr(via_channel_id); - CHECK_ACCESS(via_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ via_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(via_channel_id_ptr); - via_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(via_channel_id)); + LDKChannelId via_channel_id_conv; + via_channel_id_conv.inner = untag_ptr(via_channel_id); + via_channel_id_conv.is_owned = ptr_is_owned(via_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(via_channel_id_conv); + via_channel_id_conv = ChannelId_clone(&via_channel_id_conv); 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); @@ -72463,50 +80720,68 @@ uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_sp outputs_constr.data[b] = outputs_conv_27_conv; } FREE(outputs); - void* channel_id_ptr = untag_ptr(channel_id); - CHECK_ACCESS(channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(channel_id_ptr); - channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(channel_id)); + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *ret_copy = Event_spendable_outputs(outputs_constr, channel_id_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(uint64_t prev_channel_id, uint64_t next_channel_id, uint64_t fee_earned_msat, jboolean claim_from_onchain_tx, uint64_t outbound_amount_forwarded_msat) { - void* prev_channel_id_ptr = untag_ptr(prev_channel_id); - CHECK_ACCESS(prev_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ prev_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(prev_channel_id_ptr); - prev_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(prev_channel_id)); - void* next_channel_id_ptr = untag_ptr(next_channel_id); - CHECK_ACCESS(next_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ next_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(next_channel_id_ptr); - next_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(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)); +uint64_t __attribute__((export_name("TS_Event_payment_forwarded"))) TS_Event_payment_forwarded(uint64_t prev_channel_id, uint64_t next_channel_id, uint64_t prev_user_channel_id, uint64_t next_user_channel_id, uint64_t total_fee_earned_msat, uint64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, uint64_t outbound_amount_forwarded_msat) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); + LDKChannelId next_channel_id_conv; + next_channel_id_conv.inner = untag_ptr(next_channel_id); + next_channel_id_conv.is_owned = ptr_is_owned(next_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(next_channel_id_conv); + next_channel_id_conv = ChannelId_clone(&next_channel_id_conv); + void* prev_user_channel_id_ptr = untag_ptr(prev_user_channel_id); + CHECK_ACCESS(prev_user_channel_id_ptr); + LDKCOption_U128Z prev_user_channel_id_conv = *(LDKCOption_U128Z*)(prev_user_channel_id_ptr); + prev_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(prev_user_channel_id)); + void* next_user_channel_id_ptr = untag_ptr(next_user_channel_id); + CHECK_ACCESS(next_user_channel_id_ptr); + LDKCOption_U128Z next_user_channel_id_conv = *(LDKCOption_U128Z*)(next_user_channel_id_ptr); + next_user_channel_id_conv = COption_U128Z_clone((LDKCOption_U128Z*)untag_ptr(next_user_channel_id)); + void* total_fee_earned_msat_ptr = untag_ptr(total_fee_earned_msat); + CHECK_ACCESS(total_fee_earned_msat_ptr); + LDKCOption_u64Z total_fee_earned_msat_conv = *(LDKCOption_u64Z*)(total_fee_earned_msat_ptr); + total_fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(total_fee_earned_msat)); + void* skimmed_fee_msat_ptr = untag_ptr(skimmed_fee_msat); + CHECK_ACCESS(skimmed_fee_msat_ptr); + LDKCOption_u64Z skimmed_fee_msat_conv = *(LDKCOption_u64Z*)(skimmed_fee_msat_ptr); + skimmed_fee_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(skimmed_fee_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_conv, next_channel_id_conv, fee_earned_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); + *ret_copy = Event_payment_forwarded(prev_channel_id_conv, next_channel_id_conv, prev_user_channel_id_conv, next_user_channel_id_conv, total_fee_earned_msat_conv, skimmed_fee_msat_conv, claim_from_onchain_tx, outbound_amount_forwarded_msat_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_Event_channel_pending"))) TS_Event_channel_pending(int8_tArray channel_id, int8_tArray user_channel_id, uint64_t 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); +uint64_t __attribute__((export_name("TS_Event_channel_pending"))) TS_Event_channel_pending(uint64_t channel_id, int8_tArray user_channel_id, uint64_t former_temporary_channel_id, int8_tArray counterparty_node_id, uint64_t funding_txo, uint64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); 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* former_temporary_channel_id_ptr = untag_ptr(former_temporary_channel_id); - CHECK_ACCESS(former_temporary_channel_id_ptr); - LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id_conv = *(LDKCOption_ThirtyTwoBytesZ*)(former_temporary_channel_id_ptr); - former_temporary_channel_id_conv = COption_ThirtyTwoBytesZ_clone((LDKCOption_ThirtyTwoBytesZ*)untag_ptr(former_temporary_channel_id)); + LDKChannelId former_temporary_channel_id_conv; + former_temporary_channel_id_conv.inner = untag_ptr(former_temporary_channel_id); + former_temporary_channel_id_conv.is_owned = ptr_is_owned(former_temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(former_temporary_channel_id_conv); + former_temporary_channel_id_conv = ChannelId_clone(&former_temporary_channel_id_conv); 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); @@ -72515,16 +80790,23 @@ uint64_t __attribute__((export_name("TS_Event_channel_pending"))) TS_Event_chan 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); + 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_pending(channel_id_ref, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv); + *ret_copy = Event_channel_pending(channel_id_conv, user_channel_id_ref, former_temporary_channel_id_conv, counterparty_node_id_ref, funding_txo_conv, channel_type_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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); +uint64_t __attribute__((export_name("TS_Event_channel_ready"))) TS_Event_channel_ready(uint64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, uint64_t channel_type) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); 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); @@ -72537,15 +80819,17 @@ uint64_t __attribute__((export_name("TS_Event_channel_ready"))) TS_Event_channe 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); + *ret_copy = Event_channel_ready(channel_id_conv, user_channel_id_ref, counterparty_node_id_ref, channel_type_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(int8_tArray channel_id, int8_tArray user_channel_id, uint64_t reason, int8_tArray counterparty_node_id, uint64_t channel_capacity_sats, uint64_t channel_funding_txo) { - LDKThirtyTwoBytes channel_id_ref; - CHECK(channel_id->arr_len == 32); - memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id); +uint64_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_channel_closed(uint64_t channel_id, int8_tArray user_channel_id, uint64_t reason, int8_tArray counterparty_node_id, uint64_t channel_capacity_sats, uint64_t channel_funding_txo) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); 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); @@ -72566,30 +80850,34 @@ uint64_t __attribute__((export_name("TS_Event_channel_closed"))) TS_Event_chann CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_funding_txo_conv); channel_funding_txo_conv = OutPoint_clone(&channel_funding_txo_conv); LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); - *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); + *ret_copy = Event_channel_closed(channel_id_conv, user_channel_id_ref, reason_conv, counterparty_node_id_ref, channel_capacity_sats_conv, channel_funding_txo_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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); +uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(uint64_t channel_id, int8_tArray transaction) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); 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); + *ret_copy = Event_discard_funding(channel_id_conv, transaction_ref); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -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); +uint64_t __attribute__((export_name("TS_Event_open_channel_request"))) TS_Event_open_channel_request(uint64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, uint64_t channel_type) { + LDKChannelId temporary_channel_id_conv; + temporary_channel_id_conv.inner = untag_ptr(temporary_channel_id); + temporary_channel_id_conv.is_owned = ptr_is_owned(temporary_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(temporary_channel_id_conv); + temporary_channel_id_conv = ChannelId_clone(&temporary_channel_id_conv); 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); @@ -72599,21 +80887,23 @@ uint64_t __attribute__((export_name("TS_Event_open_channel_request"))) TS_Event 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); + *ret_copy = Event_open_channel_request(temporary_channel_id_conv, 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_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); +uint64_t __attribute__((export_name("TS_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(uint64_t prev_channel_id, uint64_t failed_next_destination) { + LDKChannelId prev_channel_id_conv; + prev_channel_id_conv.inner = untag_ptr(prev_channel_id); + prev_channel_id_conv.is_owned = ptr_is_owned(prev_channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(prev_channel_id_conv); + prev_channel_id_conv = ChannelId_clone(&prev_channel_id_conv); 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); + *ret_copy = Event_htlchandling_failed(prev_channel_id_conv, failed_next_destination_conv); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -73470,7 +81760,15 @@ uint64_t __attribute__((export_name("TS_BumpTransactionEvent_clone"))) TS_BumpT return ret_ref; } -uint64_t __attribute__((export_name("TS_BumpTransactionEvent_channel_close"))) TS_BumpTransactionEvent_channel_close(int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, uint64_t anchor_descriptor, uint64_tArray pending_htlcs) { +uint64_t __attribute__((export_name("TS_BumpTransactionEvent_channel_close"))) TS_BumpTransactionEvent_channel_close(uint64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t package_target_feerate_sat_per_1000_weight, int8_tArray commitment_tx, int64_t commitment_tx_fee_satoshis, uint64_t anchor_descriptor, uint64_tArray pending_htlcs) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + 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); LDKThirtyTwoBytes claim_id_ref; CHECK(claim_id->arr_len == 32); memcpy(claim_id_ref.data, claim_id->elems, 32); FREE(claim_id); @@ -73502,12 +81800,20 @@ uint64_t __attribute__((export_name("TS_BumpTransactionEvent_channel_close"))) } FREE(pending_htlcs); LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_channel_close(claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); + *ret_copy = BumpTransactionEvent_channel_close(channel_id_conv, counterparty_node_id_ref, claim_id_ref, package_target_feerate_sat_per_1000_weight, commitment_tx_ref, commitment_tx_fee_satoshis, anchor_descriptor_conv, pending_htlcs_constr); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -uint64_t __attribute__((export_name("TS_BumpTransactionEvent_htlcresolution"))) TS_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, uint64_tArray htlc_descriptors, int32_t tx_lock_time) { +uint64_t __attribute__((export_name("TS_BumpTransactionEvent_htlcresolution"))) TS_BumpTransactionEvent_htlcresolution(uint64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, uint64_tArray htlc_descriptors, int32_t tx_lock_time) { + LDKChannelId channel_id_conv; + channel_id_conv.inner = untag_ptr(channel_id); + channel_id_conv.is_owned = ptr_is_owned(channel_id); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv); + channel_id_conv = ChannelId_clone(&channel_id_conv); + 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); LDKThirtyTwoBytes claim_id_ref; CHECK(claim_id->arr_len == 32); memcpy(claim_id_ref.data, claim_id->elems, 32); FREE(claim_id); @@ -73529,7 +81835,7 @@ uint64_t __attribute__((export_name("TS_BumpTransactionEvent_htlcresolution"))) } FREE(htlc_descriptors); LDKBumpTransactionEvent *ret_copy = MALLOC(sizeof(LDKBumpTransactionEvent), "LDKBumpTransactionEvent"); - *ret_copy = BumpTransactionEvent_htlcresolution(claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); + *ret_copy = BumpTransactionEvent_htlcresolution(channel_id_conv, counterparty_node_id_ref, claim_id_ref, target_feerate_sat_per_1000_weight, htlc_descriptors_constr, tx_lock_time); uint64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -75927,6 +84233,17 @@ int8_tArray __attribute__((export_name("TS_Bolt11Invoice_recover_payee_pub_key" return ret_arr; } +int8_tArray __attribute__((export_name("TS_Bolt11Invoice_get_payee_pub_key"))) TS_Bolt11Invoice_get_payee_pub_key(uint64_t this_arg) { + LDKBolt11Invoice this_arg_conv; + this_arg_conv.inner = untag_ptr(this_arg); + this_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, Bolt11Invoice_get_payee_pub_key(&this_arg_conv).compressed_form, 33); + return ret_arr; +} + uint64_t __attribute__((export_name("TS_Bolt11Invoice_expires_at"))) TS_Bolt11Invoice_expires_at(uint64_t this_arg) { LDKBolt11Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg);