From: Matt Corallo Date: Mon, 13 May 2024 17:31:12 +0000 (+0000) Subject: [C#] Update auto-generated bindings to LDK 0.0.123 X-Git-Tag: v0.0.123.0^2~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=592c64eb658d92e314a2b983cea16cecf3882474;p=ldk-java [C#] Update auto-generated bindings to LDK 0.0.123 --- diff --git a/c_sharp/bindings.c b/c_sharp/bindings.c index aa2a9f13..2284cefa 100644 --- a/c_sharp/bindings.c +++ b/c_sharp/bindings.c @@ -225,6 +225,13 @@ int CS_LDK_register_l_lllb_invoker(invoker_l_lllb invoker) { return 0; } +typedef int64_t (*invoker_l_lllil)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c, int32_t d, int64_t e); +static invoker_l_lllil js_invoke_function_l_lllil; +int CS_LDK_register_l_lllil_invoker(invoker_l_lllil invoker) { + js_invoke_function_l_lllil = invoker; + return 0; +} + typedef int32_t (*invoker_ChannelMonitorUpdateStatus_lll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c); static invoker_ChannelMonitorUpdateStatus_lll js_invoke_function_ChannelMonitorUpdateStatus_lll; int CS_LDK_register_ChannelMonitorUpdateStatus_lll_invoker(invoker_ChannelMonitorUpdateStatus_lll invoker) { @@ -239,13 +246,6 @@ int CS_LDK_register_ChannelMonitorUpdateStatus_llll_invoker(invoker_ChannelMonit return 0; } -typedef void (*invoker_void_)(int obj_ptr, int fn_id); -static invoker_void_ js_invoke_function_void_; -int CS_LDK_register_void__invoker(invoker_void_ invoker) { - js_invoke_function_void_ = invoker; - return 0; -} - typedef void (*invoker_void_lli)(int obj_ptr, int fn_id, int64_t a, int64_t b, int32_t c); static invoker_void_lli js_invoke_function_void_lli; int CS_LDK_register_void_lli_invoker(invoker_void_lli invoker) { @@ -260,6 +260,13 @@ int CS_LDK_register_void_li_invoker(invoker_void_li invoker) { return 0; } +typedef void (*invoker_void_)(int obj_ptr, int fn_id); +static invoker_void_ js_invoke_function_void_; +int CS_LDK_register_void__invoker(invoker_void_ invoker) { + js_invoke_function_void_ = invoker; + return 0; +} + typedef int64_t (*invoker_l_llb)(int obj_ptr, int fn_id, int64_t a, int64_t b, jboolean c); static invoker_l_llb js_invoke_function_l_llb; int CS_LDK_register_l_llb_invoker(invoker_l_llb invoker) { @@ -427,10 +434,11 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(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; default: abort(); } } @@ -459,10 +467,11 @@ static inline int32_t LDKBolt12SemanticError_to_cs(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(); } } @@ -524,6 +533,7 @@ static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { case 3: return LDKConfirmationTarget_AnchorChannelFee; case 4: return LDKConfirmationTarget_NonAnchorChannelFee; case 5: return LDKConfirmationTarget_ChannelCloseMinimum; + case 6: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } @@ -535,6 +545,7 @@ static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { case LDKConfirmationTarget_AnchorChannelFee: return 3; case LDKConfirmationTarget_NonAnchorChannelFee: return 4; case LDKConfirmationTarget_ChannelCloseMinimum: return 5; + case LDKConfirmationTarget_OutputSpendingFee: return 6; default: abort(); } } @@ -580,6 +591,20 @@ static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { default: abort(); } } +static inline LDKDirection LDKDirection_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKDirection_NodeOne; + case 1: return LDKDirection_NodeTwo; + default: abort(); + } +} +static inline int32_t LDKDirection_to_cs(LDKDirection val) { + switch (val) { + case LDKDirection_NodeOne: return 0; + case LDKDirection_NodeTwo: return 1; + default: abort(); + } +} static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { switch (ord) { case 0: return LDKHTLCClaim_OfferedTimeout; @@ -770,6 +795,22 @@ static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { default: abort(); } } +static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKShortChannelIdError_BlockOverflow; + case 1: return LDKShortChannelIdError_TxIndexOverflow; + case 2: return LDKShortChannelIdError_VoutIndexOverflow; + default: abort(); + } +} +static inline int32_t LDKShortChannelIdError_to_cs(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_cs(int32_t ord) { switch (ord) { case 0: return LDKSiPrefix_Milli; @@ -871,6 +912,54 @@ int8_t CS_LDK_LDKBech32Error_InvalidData_get_invalid_data(int64_t ptr) { 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; +} +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_RefundBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_u64Z_ty_from_ptr(int64_t ptr) { LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr); switch(obj->tag) { @@ -950,6 +1039,7 @@ uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { case LDKDecodeError_BadLengthDescriptor: return 4; case LDKDecodeError_Io: return 5; case LDKDecodeError_UnsupportedCompression: return 6; + case LDKDecodeError_DangerousValue: return 7; default: abort(); } } @@ -1181,6 +1271,74 @@ void CS_LDK_CResult_RecipientOnionFieldsNoneZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_err(int64_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++) { @@ -1211,6 +1369,76 @@ ptrArray CS_LDK_LDKCOption_CVec_ThirtyTwoBytesZZ_Some_get_some(int64_t ptr) { return some_arr; } +uint32_t CS_LDK_LDKAmount_ty_from_ptr(int64_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 CS_LDK_LDKAmount_Bitcoin_get_amount_msats(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Bitcoin); + int64_t amount_msats_conv = obj->bitcoin.amount_msats; + return amount_msats_conv; +} +int8_tArray CS_LDK_LDKAmount_Currency_get_iso4217_code(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKAmount_Currency_get_amount(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Currency); + int64_t amount_conv = obj->currency.amount; + return amount_conv; +} +uint32_t CS_LDK_LDKCOption_AmountZ_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKCOption_AmountZ_Some_get_some(int64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_AmountZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} +uint32_t CS_LDK_LDKQuantity_ty_from_ptr(int64_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 CS_LDK_LDKQuantity_Bounded_get_bounded(int64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + CHECK(obj->tag == LDKQuantity_Bounded); + int64_t bounded_conv = obj->bounded; + return bounded_conv; +} +uint32_t CS_LDK_LDKCOption_QuantityZ_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKCOption_QuantityZ_Some_get_some(int64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_QuantityZ_Some); + int64_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); @@ -1575,44 +1803,45 @@ void CS_LDK_CResult_RecoverableSignatureNoneZ_get_err(int64_t owner) { 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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok(int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); +int8_tArray CS_LDK_CResult_ECDSASignatureNoneZ_get_ok(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_err(int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +void CS_LDK_CResult_ECDSASignatureNoneZ_get_err(int64_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 CS_LDK_CResult_ECDSASignatureNoneZ_get_ok(int64_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 CS_LDK_CResult_TransactionNoneZ_get_ok(int64_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 CS_LDK_CResult_ECDSASignatureNoneZ_get_err(int64_t owner) { - LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); - CResult_ECDSASignatureNoneZ_get_err(owner_conv); +void CS_LDK_CResult_TransactionNoneZ_get_err(int64_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){ @@ -2485,27 +2714,6 @@ int64_t CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_err(int64_t owner) { 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 CS_LDK_CResult_TransactionNoneZ_get_ok(int64_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 CS_LDK_CResult_TransactionNoneZ_get_err(int64_t owner) { - LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); - CResult_TransactionNoneZ_get_err(owner_conv); -} - uint32_t CS_LDK_LDKCandidateRouteHop_ty_from_ptr(int64_t ptr) { LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); switch(obj->tag) { @@ -3537,6 +3745,32 @@ int64_t CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BestBlockDecodeErrorZ* owner_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(owner); + LDKBestBlock ret_var = CResult_BestBlockDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_get_err(int64_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); + int64_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; } @@ -3620,12 +3854,48 @@ void CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_get_err(int64_t owner) { CResult_ChannelMonitorUpdateStatusNoneZ_get_err(owner_conv); } +uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_CounterpartyForceClosed); + LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; + int64_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 CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_ProcessingError); + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); + return err_conv; +} uint32_t CS_LDK_LDKMonitorEvent_ty_from_ptr(int64_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(); } } @@ -3638,6 +3908,30 @@ int64_t CS_LDK_LDKMonitorEvent_HTLCEvent_get_htlc_event(int64_t ptr) { htlc_event_ref = tag_ptr(htlc_event_var.inner, false); return htlc_event_ref; } +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_reason(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + int64_t reason_ref = tag_ptr(&obj->holder_force_closed_with_info.reason, false); + return reason_ref; +} +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKOutPoint outpoint_var = obj->holder_force_closed_with_info.outpoint; + int64_t outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); + outpoint_ref = tag_ptr(outpoint_var.inner, false); + return outpoint_ref; +} +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKChannelId channel_id_var = obj->holder_force_closed_with_info.channel_id; + int64_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 CS_LDK_LDKMonitorEvent_HolderForceClosed_get_holder_force_closed(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMonitorEvent_HolderForceClosed); @@ -3656,6 +3950,15 @@ int64_t CS_LDK_LDKMonitorEvent_Completed_get_funding_txo(int64_t ptr) { funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } +int64_t CS_LDK_LDKMonitorEvent_Completed_get_channel_id(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_Completed); + LDKChannelId channel_id_var = obj->completed.channel_id; + int64_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 CS_LDK_LDKMonitorEvent_Completed_get_monitor_update_id(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMonitorEvent_Completed); @@ -3669,26 +3972,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; } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKOutPoint ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); + int64_t ret_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; +} +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(owner_conv); int64_t ret_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); } -int64_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv); +int64_tArray CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKCVec_MonitorEventZ ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(owner_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); @@ -3703,20 +4020,20 @@ int64_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(int64_t 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 CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); +int8_tArray CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(int64_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; } @@ -3902,6 +4219,123 @@ int64_t CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferIdDecodeErrorZ* owner_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(owner); + LDKOfferId ret_var = CResult_OfferIdDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_get_err(int64_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); + int64_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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok(int64_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); +} +int32_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithDerivedPayerIdBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithExplicitPayerIdBuilder ret_var = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; @@ -3930,27 +4364,6 @@ int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_get_err(int64_t owner) { 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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok(int64_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; -} -int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { - LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKSecp256k1Error_to_cs(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; @@ -3977,6 +4390,27 @@ int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_get_err(int64_t owner) { 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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok(int64_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; +} +int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { + LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKSecp256k1Error_to_cs(CResult_PublicKeySecp256k1ErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKNetworkUpdate_ty_from_ptr(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { @@ -5261,6 +5695,26 @@ int64_tArray CS_LDK_LDKCOption_CVec_SocketAddressZZ_Some_get_some(int64_t ptr) { 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 CS_LDK_CResult_u64ShortChannelIdErrorZ_get_ok(int64_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); +} +int32_t CS_LDK_CResult_u64ShortChannelIdErrorZ_get_err(int64_t owner) { + LDKCResult_u64ShortChannelIdErrorZ* owner_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKShortChannelIdError_to_cs(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; @@ -5385,6 +5839,56 @@ void CS_LDK_CResult_CVec_UtxoZNoneZ_get_err(int64_t owner) { CResult_CVec_UtxoZNoneZ_get_err(owner_conv); } +uint32_t CS_LDK_LDKPaymentContext_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKPaymentContext_Unknown_get_unknown(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Unknown); + LDKUnknownPaymentContext unknown_var = obj->unknown; + int64_t unknown_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(unknown_var); + unknown_ref = tag_ptr(unknown_var.inner, false); + return unknown_ref; +} +int64_t CS_LDK_LDKPaymentContext_Bolt12Offer_get_bolt12_offer(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Bolt12Offer); + LDKBolt12OfferContext bolt12_offer_var = obj->bolt12_offer; + int64_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; +} +int64_t CS_LDK_LDKPaymentContext_Bolt12Refund_get_bolt12_refund(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Bolt12Refund); + LDKBolt12RefundContext bolt12_refund_var = obj->bolt12_refund; + int64_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 CS_LDK_LDKCOption_PaymentContextZ_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKCOption_PaymentContextZ_Some_get_some(int64_t ptr) { + LDKCOption_PaymentContextZ *obj = (LDKCOption_PaymentContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_PaymentContextZ_Some); + int64_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; } @@ -5433,25 +5937,28 @@ int32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some(int64_t ptr) { int32_t some_conv = LDKChannelShutdownState_to_cs(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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(int64_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; +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelIdAPIErrorZ* owner_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdAPIErrorZ_get_ok(owner_conv); + int64_t ret_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); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_t owner) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_get_err(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5786,33 +6293,68 @@ int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFail 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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(int64_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; +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_a(int64_t owner) { + LDKC2Tuple_ChannelIdPublicKeyZ* owner_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_ChannelIdPublicKeyZ_get_a(owner_conv); + int64_t ret_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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(int64_t owner) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(owner); +int8_tArray CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_b(int64_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_ThirtyTwoBytesPublicKeyZ_clone(&orig->data[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] = 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; +} +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOfferWithDerivedMetadataBuilder ret_var = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_StrZ_ty_from_ptr(int64_t ptr) { LDKCOption_StrZ *obj = (LDKCOption_StrZ*)untag_ptr(ptr); switch(obj->tag) { @@ -5828,25 +6370,6 @@ jstring CS_LDK_LDKCOption_StrZ_Some_get_some(int64_t ptr) { jstring some_conv = str_ref_to_cs(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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok(int64_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); -} -int32_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err(int64_t owner) { - LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKBolt12SemanticError_to_cs(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); @@ -5867,6 +6390,29 @@ void CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(int64_t 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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(int64_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); +} +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t CS_LDK_LDKOffersMessage_ty_from_ptr(int64_t ptr) { LDKOffersMessage *obj = (LDKOffersMessage*)untag_ptr(ptr); switch(obj->tag) { @@ -6162,6 +6708,12 @@ int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_metadata(int64_t ptr) { int64_t payment_metadata_ref = tag_ptr(&obj->receive.payment_metadata, false); return payment_metadata_ref; } +int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_context(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + int64_t payment_context_ref = tag_ptr(&obj->receive.payment_context, false); + return payment_context_ref; +} int32_t CS_LDK_LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry(int64_t ptr) { LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); CHECK(obj->tag == LDKPendingHTLCRouting_Receive); @@ -6241,6 +6793,12 @@ int64_tArray CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_custom_tlvs(int64_t return custom_tlvs_arr; } +jboolean CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(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); @@ -6384,23 +6942,23 @@ LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(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; int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 29); - 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; int64_t* ret_vals = ret->elems; - for (size_t x = 0; x < ret_constr.datalen; x++) { - int64_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++) { + int64_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; @@ -6469,14 +7027,14 @@ int64_tArray CS_LDK_Watch_release_pending_monitor_events(int64_t this_arg) { 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); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t 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); @@ -6709,7 +7267,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedInvoiceRequest invoice_request_var = *invoice_request; int64_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_l_l(j_calls->instance_ptr, 36, invoice_request_ref); @@ -6723,7 +7281,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const v LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedBolt12Invoice invoice_var = *invoice; int64_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_l_l(j_calls->instance_ptr, 37, invoice_ref); @@ -8408,34 +8966,6 @@ int64_t CS_LDK_LDKCOption_SocketAddressZ_Some_get_some(int64_t ptr) { int64_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 CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(int64_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); -} -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(int64_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); - int64_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); @@ -8665,6 +9195,54 @@ int32_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(in 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; +} +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedInvoiceRequest ret_var = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequest ret_var = CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_SecretKeyZ_ty_from_ptr(int64_t ptr) { LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); switch(obj->tag) { @@ -8680,6 +9258,30 @@ int8_tArray CS_LDK_LDKCOption_SecretKeyZ_Some_get_some(int64_t ptr) { 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; +} +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithExplicitSigningPubkeyBuilder ret_var = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; @@ -8703,6 +9305,56 @@ void CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithDerivedSigningPubkeyBuilder ret_var = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequestFields ret_var = CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(int64_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); + int64_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++) { @@ -8710,6 +9362,21 @@ static inline LDKCVec_WitnessZ CVec_WitnessZ_clone(const LDKCVec_WitnessZ *orig) } return ret; } +uint32_t CS_LDK_LDKCOption_ECDSASignatureZ_ty_from_ptr(int64_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 CS_LDK_LDKCOption_ECDSASignatureZ_Some_get_some(int64_t ptr) { + LDKCOption_ECDSASignatureZ *obj = (LDKCOption_ECDSASignatureZ*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKCOption_i64Z_ty_from_ptr(int64_t ptr) { LDKCOption_i64Z *obj = (LDKCOption_i64Z*)untag_ptr(ptr); switch(obj->tag) { @@ -10171,13 +10838,6 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) return ret_ref; } -static inline LDKCVec_FutureZ CVec_FutureZ_clone(const LDKCVec_FutureZ *orig) { - LDKCVec_FutureZ ret = { .data = MALLOC(sizeof(LDKFuture) * orig->datalen, "LDKCVec_FutureZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = Future_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -10595,24 +11255,70 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(int64_t own uint32_t CS_LDK_LDKPaymentPurpose_ty_from_ptr(int64_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(); } } -int64_t CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(int64_t ptr) { +int64_t CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt11_invoice_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->bolt11_invoice_payment.payment_secret.data, 32); + return payment_secret_arr; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt12_offer_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(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; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + LDKBolt12OfferContext payment_context_var = obj->bolt12_offer_payment.payment_context; + int64_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; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentPurpose_InvoicePayment); - int64_t payment_preimage_ref = tag_ptr(&obj->invoice_payment.payment_preimage, false); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt12_refund_payment.payment_preimage, false); return payment_preimage_ref; } -int8_tArray CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_secret(int64_t ptr) { +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentPurpose_InvoicePayment); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); 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->bolt12_refund_payment.payment_secret.data, 32); return payment_secret_arr; } +int64_t CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + LDKBolt12RefundContext payment_context_var = obj->bolt12_refund_payment.payment_context; + int64_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 CS_LDK_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); CHECK(obj->tag == LDKPaymentPurpose_SpontaneousPayment); @@ -10728,38 +11434,6 @@ int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_err(int64_t owner) return ret_ref; } -uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_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(); - } -} -int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - CHECK(obj->tag == LDKClosureReason_CounterpartyForceClosed); - LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; - int64_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 CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - CHECK(obj->tag == LDKClosureReason_ProcessingError); - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); - return err_conv; -} uint32_t CS_LDK_LDKCOption_ClosureReasonZ_ty_from_ptr(int64_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr); switch(obj->tag) { @@ -10804,7 +11478,8 @@ uint32_t CS_LDK_LDKHTLCDestination_ty_from_ptr(int64_t ptr) { 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(); } } @@ -10815,12 +11490,14 @@ int8_tArray CS_LDK_LDKHTLCDestination_NextHopChannel_get_node_id(int64_t ptr) { memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33); return node_id_arr; } -int8_tArray CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id(int64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(int64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); @@ -10945,6 +11622,22 @@ uint32_t CS_LDK_LDKBumpTransactionEvent_ty_from_ptr(int64_t ptr) { default: abort(); } } +int64_t CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_channel_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); + LDKChannelId channel_id_var = obj->channel_close.channel_id; + int64_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 CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_claim_id(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); @@ -10998,6 +11691,22 @@ int64_tArray CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs(int64 return pending_htlcs_arr; } +int64_t CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_channel_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); + LDKChannelId channel_id_var = obj->htlc_resolution.channel_id; + int64_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 CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_claim_id(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); @@ -11062,12 +11771,14 @@ uint32_t CS_LDK_LDKEvent_ty_from_ptr(int64_t ptr) { default: abort(); } } -int8_tArray CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_FundingGenerationReady_get_counterparty_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11141,7 +11852,10 @@ int64_t CS_LDK_LDKEvent_PaymentClaimable_get_purpose(int64_t ptr) { int64_t CS_LDK_LDKEvent_PaymentClaimable_get_via_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentClaimable); - int64_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; + int64_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; } int64_t CS_LDK_LDKEvent_PaymentClaimable_get_via_user_channel_id(int64_t ptr) { @@ -11448,26 +12162,53 @@ int64_tArray CS_LDK_LDKEvent_SpendableOutputs_get_outputs(int64_t ptr) { int64_t CS_LDK_LDKEvent_SpendableOutputs_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_SpendableOutputs); - int64_t channel_id_ref = tag_ptr(&obj->spendable_outputs.channel_id, false); + LDKChannelId channel_id_var = obj->spendable_outputs.channel_id; + int64_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 CS_LDK_LDKEvent_PaymentForwarded_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_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; + int64_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; } int64_t CS_LDK_LDKEvent_PaymentForwarded_get_next_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_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; + int64_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; } -int64_t CS_LDK_LDKEvent_PaymentForwarded_get_fee_earned_msat(int64_t ptr) { +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_prev_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t prev_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_user_channel_id, false); + return prev_user_channel_id_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_next_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t next_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_user_channel_id, false); + return next_user_channel_id_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_total_fee_earned_msat(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false); - return fee_earned_msat_ref; + int64_t total_fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.total_fee_earned_msat, false); + return total_fee_earned_msat_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_skimmed_fee_msat(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t skimmed_fee_msat_ref = tag_ptr(&obj->payment_forwarded.skimmed_fee_msat, false); + return skimmed_fee_msat_ref; } jboolean CS_LDK_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11481,12 +12222,14 @@ int64_t CS_LDK_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(int6 int64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false); return outbound_amount_forwarded_msat_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelPending_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelPending_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_ChannelPending_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11498,7 +12241,10 @@ int8_tArray CS_LDK_LDKEvent_ChannelPending_get_user_channel_id(int64_t ptr) { int64_t CS_LDK_LDKEvent_ChannelPending_get_former_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ChannelPending); - int64_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; + int64_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 CS_LDK_LDKEvent_ChannelPending_get_counterparty_node_id(int64_t ptr) { @@ -11517,12 +12263,23 @@ int64_t CS_LDK_LDKEvent_ChannelPending_get_funding_txo(int64_t ptr) { funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelReady_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelPending_get_channel_type(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_ChannelPending); + LDKChannelTypeFeatures channel_type_var = obj->channel_pending.channel_type; + int64_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; +} +int64_t CS_LDK_LDKEvent_ChannelReady_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_ChannelReady_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11547,12 +12304,14 @@ int64_t CS_LDK_LDKEvent_ChannelReady_get_channel_type(int64_t ptr) { channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelClosed_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_ChannelClosed_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11589,12 +12348,14 @@ int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_funding_txo(int64_t ptr) { channel_funding_txo_ref = tag_ptr(channel_funding_txo_var.inner, false); return channel_funding_txo_ref; } -int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_DiscardFunding_get_transaction(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11604,12 +12365,14 @@ int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_transaction(int64_t ptr) { memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); return transaction_arr; } -int8_tArray CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_OpenChannelRequest_get_counterparty_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11639,12 +12402,14 @@ int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_channel_type(int64_t ptr) { channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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; } int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -12182,6 +12947,32 @@ int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelIdDecodeErrorZ* owner_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_get_err(int64_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); + int64_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); } @@ -12253,6 +13044,129 @@ int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_get_err(int64_t owner) { 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); +} +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_get_ok(int64_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); + int64_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); +} +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKUnknownPaymentContext ret_var = CResult_UnknownPaymentContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12OfferContext ret_var = CResult_Bolt12OfferContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12RefundContext ret_var = CResult_Bolt12RefundContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_err(int64_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); + int64_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 CS_LDK_CResult_StrSecp256k1ErrorZ_get_ok(int64_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_cs(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; +} +int32_t CS_LDK_CResult_StrSecp256k1ErrorZ_get_err(int64_t owner) { + LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKSecp256k1Error_to_cs(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); } @@ -12311,27 +13225,6 @@ void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZN 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 CS_LDK_CResult_StrSecp256k1ErrorZ_get_ok(int64_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_cs(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; -} -int32_t CS_LDK_CResult_StrSecp256k1ErrorZ_get_err(int64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKSecp256k1Error_to_cs(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; } @@ -12378,7 +13271,8 @@ uint32_t CS_LDK_LDKSendError_ty_from_ptr(int64_t ptr) { 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(); } } @@ -12418,6 +13312,27 @@ int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZ return ret_ref; } +uint32_t CS_LDK_LDKNextMessageHop_ty_from_ptr(int64_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 CS_LDK_LDKNextMessageHop_NodeId_get_node_id(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKNextMessageHop_ShortChannelId_get_short_channel_id(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKNextMessageHop_ShortChannelId); + int64_t short_channel_id_conv = obj->short_channel_id; + return short_channel_id_conv; +} uint32_t CS_LDK_LDKParsedOnionMessageContents_ty_from_ptr(int64_t ptr) { LDKParsedOnionMessageContents *obj = (LDKParsedOnionMessageContents*)untag_ptr(ptr); switch(obj->tag) { @@ -12447,12 +13362,11 @@ uint32_t CS_LDK_LDKPeeledOnion_ty_from_ptr(int64_t ptr) { default: abort(); } } -int8_tArray CS_LDK_LDKPeeledOnion_Forward_get__0(int64_t ptr) { +int64_t CS_LDK_LDKPeeledOnion_Forward_get__0(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(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; + int64_t _0_ref = tag_ptr(&obj->forward._0, false); + return _0_ref; } int64_t CS_LDK_LDKPeeledOnion_Forward_get__1(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); @@ -12673,158 +13587,122 @@ int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_err(int64_t owner) { 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; -} -int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); - LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); -} -int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(int64_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); - int64_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; -} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); - LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); -} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(int64_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); - int64_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; +static inline struct LDKTrackedSpendableOutput CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ + LDKTrackedSpendableOutput ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); - LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); + LDKTrackedSpendableOutput ret_var = CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(owner_conv); int64_t ret_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){ +static inline struct LDKDecodeError CResult_TrackedSpendableOutputDecodeErrorZ_get_err(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_HtlcBasepointDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_TrackedSpendableOutputDecodeErrorZ_get_err(owner_conv); int64_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; -} -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); - LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); -} -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err(int64_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); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint32_t CS_LDK_LDKOutputSpendStatus_ty_from_ptr(int64_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; +int64_t CS_LDK_LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingInitialBroadcast); + int64_t delayed_until_height_ref = tag_ptr(&obj->pending_initial_broadcast.delayed_until_height, false); + return delayed_until_height_ref; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + int32_t latest_broadcast_height_conv = obj->pending_first_confirmation.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t latest_broadcast_height_conv = obj->pending_threshold_confirmations.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t confirmation_height_conv = obj->pending_threshold_confirmations.confirmation_height; + return confirmation_height_conv; } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); - LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err(int64_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); +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_ok(int64_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); int64_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; -} -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); - LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); } -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_err(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -12925,85 +13803,62 @@ int64_t CS_LDK_LDKCOption_FilterZ_Some_get_some(int64_t ptr) { } 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; -} -int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok(int64_t owner) { - LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); - LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); - int64_t ret_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 CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err(int64_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_l_(j_calls->instance_ptr, 58); + 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; } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); - int64_t ret_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 (int64_t 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; } -int64_tArray CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; - int64_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 CS_LDK_LDKChangeDestinationSource_new(int32_t 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; +int64_t CS_LDK_ChangeDestinationSource_get_change_destination_script(int64_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; @@ -13025,7 +13880,7 @@ LDKCResult_CVec_u8ZIOErrorZ read_LDKKVStore_jcall(const void* this_arg, LDKStr p LDKStr key_str = key; jstring key_conv = str_ref_to_cs(key_str.chars, key_str.len); Str_free(key_str); - uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 58, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 59, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZIOErrorZ ret_conv = *(LDKCResult_CVec_u8ZIOErrorZ*)(ret_ptr); @@ -13046,7 +13901,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_l_llll(j_calls->instance_ptr, 59, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, (int64_t)buf_arr); + uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 60, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, (int64_t)buf_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -13065,7 +13920,7 @@ LDKCResult_NoneIOErrorZ remove_LDKKVStore_jcall(const void* this_arg, LDKStr pri jstring key_conv = str_ref_to_cs(key_str.chars, key_str.len); Str_free(key_str); jboolean lazy_conv = lazy; - uint64_t ret = js_invoke_function_l_lllb(j_calls->instance_ptr, 60, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, lazy_conv); + uint64_t ret = js_invoke_function_l_lllb(j_calls->instance_ptr, 61, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, lazy_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -13080,7 +13935,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_cs(secondary_namespace_str.chars, secondary_namespace_str.len); Str_free(secondary_namespace_str); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 61, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 62, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_StrZIOErrorZ ret_conv = *(LDKCResult_CVec_StrZIOErrorZ*)(ret_ptr); @@ -13162,283 +14017,721 @@ int64_t CS_LDK_KVStore_list(int64_t this_arg, jstring primary_namespace, jstrin return tag_ptr(ret_conv, true); } -typedef struct LDKPersister_JCalls { +typedef struct LDKOutputSpender_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; -} LDKPersister_JCalls; -static void LDKPersister_JCalls_free(void* this_arg) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; +} 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_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; - LDKChannelManager channel_manager_var = *channel_manager; - int64_t channel_manager_ref = 0; - // 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_l_l(j_calls->instance_ptr, 62, channel_manager_ref); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; -} -LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; - LDKNetworkGraph network_graph_var = *network_graph; - int64_t network_graph_ref = 0; - // 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_l_l(j_calls->instance_ptr, 63, network_graph_ref); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; -} -LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_scorer = tag_ptr(scorer, false); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 64, ret_scorer); +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; + int64_tArray descriptors_arr = NULL; + descriptors_arr = init_int64_tArray(descriptors_var.datalen, __LINE__); + int64_t *descriptors_arr_ptr = (int64_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]; + int64_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; + int64_tArray outputs_arr = NULL; + outputs_arr = init_int64_tArray(outputs_var.datalen, __LINE__); + int64_t *outputs_arr_ptr = (int64_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; + int64_t locktime_ref = tag_ptr(locktime_copy, true); + uint64_t ret = js_invoke_function_l_lllil(j_calls->instance_ptr, 63, (int64_t)descriptors_arr, (int64_t)outputs_arr, (int64_t)change_destination_script_arr, feerate_sat_per_1000_weight_conv, locktime_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; +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 LDKPersister LDKPersister_init (int64_t o) { - LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); +static inline LDKOutputSpender LDKOutputSpender_init (int64_t o) { + LDKOutputSpender_JCalls *calls = MALLOC(sizeof(LDKOutputSpender_JCalls), "LDKOutputSpender_JCalls"); atomic_init(&calls->refcnt, 1); calls->instance_ptr = o; - LDKPersister ret = { + LDKOutputSpender ret = { .this_arg = (void*) calls, - .persist_manager = persist_manager_LDKPersister_jcall, - .persist_graph = persist_graph_LDKPersister_jcall, - .persist_scorer = persist_scorer_LDKPersister_jcall, - .free = LDKPersister_JCalls_free, + .spend_spendable_outputs = spend_spendable_outputs_LDKOutputSpender_jcall, + .free = LDKOutputSpender_JCalls_free, }; return ret; } -uint64_t CS_LDK_LDKPersister_new(int32_t o) { - LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); - *res_ptr = LDKPersister_init(o); +uint64_t CS_LDK_LDKOutputSpender_new(int32_t o) { + LDKOutputSpender *res_ptr = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *res_ptr = LDKOutputSpender_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_Persister_persist_manager(int64_t this_arg, int64_t channel_manager) { +int64_t CS_LDK_OutputSpender_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKChannelManager channel_manager_conv; - channel_manager_conv.inner = untag_ptr(channel_manager); - channel_manager_conv.is_owned = ptr_is_owned(channel_manager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); - channel_manager_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); + 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; + int64_t* descriptors_vals = descriptors->elems; + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_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; + int64_t* outputs_vals = outputs->elems; + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_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); } -int64_t CS_LDK_Persister_persist_graph(int64_t this_arg, int64_t network_graph) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_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; } - -int64_t CS_LDK_Persister_persist_scorer(int64_t this_arg, int64_t scorer) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - void* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OutputSweeperDecodeErrorZ* owner_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = CResult_OutputSweeperDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -typedef struct LDKPersist_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKPersist_JCalls; -static void LDKPersist_JCalls_free(void* this_arg) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } +static inline struct LDKDecodeError CResult_OutputSweeperDecodeErrorZ_get_err(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - int64_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); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_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_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 65, channel_id_ref, data_ref, update_id_ref); - LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); - return ret_conv; +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_err(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - int64_t channel_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned); - LDKChannelMonitorUpdate update_var = update; - int64_t update_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = tag_ptr(update_var.inner, update_var.is_owned); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_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_ChannelMonitorUpdateStatus_llll(j_calls->instance_ptr, 66, channel_id_ref, update_ref, data_ref, update_id_ref); - LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); - return ret_conv; + +static inline struct LDKBestBlock C2Tuple_BestBlockOutputSweeperZ_get_a(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner){ + LDKBestBlock ret = owner->a; + ret.is_owned = false; + return ret; } -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); +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_a(int64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKBestBlock ret_var = C2Tuple_BestBlockOutputSweeperZ_get_a(owner_conv); + int64_t ret_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 LDKPersist LDKPersist_init (int64_t o) { - LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - LDKPersist ret = { - .this_arg = (void*) calls, - .persist_new_channel = persist_new_channel_LDKPersist_jcall, - .update_persisted_channel = update_persisted_channel_LDKPersist_jcall, - .free = LDKPersist_JCalls_free, - }; +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 CS_LDK_LDKPersist_new(int32_t o) { - LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *res_ptr = LDKPersist_init(o); - return tag_ptr(res_ptr, true); -} -int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_id, int64_t data, int64_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); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - 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); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv)); - return ret_conv; +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_b(int64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = C2Tuple_BestBlockOutputSweeperZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_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); - 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 = ChannelMonitorUpdate_clone(&update_conv); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - 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); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, update_conv, &data_conv, update_id_conv)); - return ret_conv; +static inline struct LDKC2Tuple_BestBlockOutputSweeperZ *CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return &*owner->contents.result; } - -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); - } +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(owner); + int64_t ret_ret = tag_ptr(CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(owner_conv), false); + return ret_ret; } -void call_LDKFutureCallback_jcall(const void* this_arg) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 67); + +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); } -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); +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline LDKFutureCallback LDKFutureCallback_init (int64_t o) { - LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls"); + +static inline struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKDelayedPaymentBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); + LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); + LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); + LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); + LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok(int64_t owner) { + LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); + LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); + int64_t ret_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 CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err(int64_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; +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointChannelIdZ_get_a(owner_conv); + int64_t ret_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; +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_OutPointChannelIdZ_get_b(owner_conv); + int64_t ret_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; +} +int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); + int64_t ret_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); +} +int64_tArray CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t r = 0; r < ret_var.datalen; r++) { + LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; + int64_t ret_conv_17_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); + ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); + ret_arr_ptr[r] = ret_conv_17_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + } + return ret; +} +typedef struct LDKPersister_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKPersister_JCalls; +static void LDKPersister_JCalls_free(void* this_arg) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + LDKChannelManager channel_manager_var = *channel_manager; + int64_t channel_manager_ref = 0; + // 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_l_l(j_calls->instance_ptr, 64, channel_manager_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + LDKNetworkGraph network_graph_var = *network_graph; + int64_t network_graph_ref = 0; + // 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_l_l(j_calls->instance_ptr, 65, network_graph_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_scorer = tag_ptr(scorer, false); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, ret_scorer); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKPersister LDKPersister_init (int64_t o) { + LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); atomic_init(&calls->refcnt, 1); calls->instance_ptr = o; - LDKFutureCallback ret = { + LDKPersister ret = { .this_arg = (void*) calls, - .call = call_LDKFutureCallback_jcall, - .free = LDKFutureCallback_JCalls_free, + .persist_manager = persist_manager_LDKPersister_jcall, + .persist_graph = persist_graph_LDKPersister_jcall, + .persist_scorer = persist_scorer_LDKPersister_jcall, + .free = LDKPersister_JCalls_free, }; return ret; } -uint64_t CS_LDK_LDKFutureCallback_new(int32_t o) { - LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); - *res_ptr = LDKFutureCallback_init(o); +uint64_t CS_LDK_LDKPersister_new(int32_t o) { + LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); + *res_ptr = LDKPersister_init(o); return tag_ptr(res_ptr, true); } -void CS_LDK_FutureCallback_call(int64_t this_arg) { +int64_t CS_LDK_Persister_persist_manager(int64_t this_arg, int64_t channel_manager) { 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); + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKChannelManager channel_manager_conv; + channel_manager_conv.inner = untag_ptr(channel_manager); + channel_manager_conv.is_owned = ptr_is_owned(channel_manager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); + channel_manager_conv.is_owned = false; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Persister_persist_graph(int64_t this_arg, int64_t network_graph) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Persister_persist_scorer(int64_t this_arg, int64_t scorer) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + void* scorer_ptr = untag_ptr(scorer); + if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv); + return tag_ptr(ret_conv, true); +} + +typedef struct LDKPersist_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKPersist_JCalls; +static void LDKPersist_JCalls_free(void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +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_funding_outpoint_var = channel_funding_outpoint; + int64_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; + int64_t data_ref = 0; + data_var = ChannelMonitor_clone(&data_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); + data_ref = tag_ptr(data_var.inner, data_var.is_owned); + LDKMonitorUpdateId update_id_var = update_id; + int64_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_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 67, channel_funding_outpoint_ref, data_ref, update_id_ref); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); + return ret_conv; +} +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_funding_outpoint_var = channel_funding_outpoint; + int64_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; + int64_t update_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); + update_ref = tag_ptr(update_var.inner, update_var.is_owned); + LDKChannelMonitor data_var = *data; + int64_t data_ref = 0; + data_var = ChannelMonitor_clone(&data_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); + data_ref = tag_ptr(data_var.inner, data_var.is_owned); + LDKMonitorUpdateId update_id_var = update_id; + int64_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_ChannelMonitorUpdateStatus_llll(j_calls->instance_ptr, 68, channel_funding_outpoint_ref, update_ref, data_ref, update_id_ref); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(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; + int64_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_void_l(j_calls->instance_ptr, 69, channel_funding_outpoint_ref); +} +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); +} +static inline LDKPersist LDKPersist_init (int64_t o) { + LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKPersist ret = { + .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; +} +uint64_t CS_LDK_LDKPersist_new(int32_t o) { + LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *res_ptr = LDKPersist_init(o); + return tag_ptr(res_ptr, true); +} +int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t data, int64_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_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); + data_conv.is_owned = false; + LDKMonitorUpdateId update_id_conv; + update_id_conv.inner = untag_ptr(update_id); + 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); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &data_conv, update_id_conv)); + return ret_conv; +} + +int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t update, int64_t data, int64_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_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv = ChannelMonitorUpdate_clone(&update_conv); + LDKChannelMonitor data_conv; + data_conv.inner = untag_ptr(data); + data_conv.is_owned = ptr_is_owned(data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); + data_conv.is_owned = false; + LDKMonitorUpdateId update_id_conv; + update_id_conv.inner = untag_ptr(update_id); + 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); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((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; +} + +void CS_LDK_Persist_archive_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint) { + 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_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 { @@ -13467,7 +14760,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_void_lli(j_calls->instance_ptr, 68, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 70, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); } void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; @@ -13475,14 +14768,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_void_li(j_calls->instance_ptr, 69, (int64_t)block_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 71, (int64_t)block_arr, height_conv); } 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_void_li(j_calls->instance_ptr, 70, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 72, (int64_t)header_arr, height_conv); } static void LDKListen_JCalls_cloned(LDKListen* new_obj) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; @@ -13582,24 +14875,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_void_lli(j_calls->instance_ptr, 71, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 73, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); } 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_void_l(j_calls->instance_ptr, 72, (int64_t)txid_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 74, (int64_t)txid_arr); } 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_void_li(j_calls->instance_ptr, 73, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 75, (int64_t)header_arr, height_conv); } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 74); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 76); LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13709,6 +15002,68 @@ int64_tArray CS_LDK_Confirm_get_relevant_txids(int64_t this_arg) { return ret_arr; } +uint32_t CS_LDK_LDKSpendingDelay_ty_from_ptr(int64_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 CS_LDK_LDKSpendingDelay_Relative_get_num_blocks(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + CHECK(obj->tag == LDKSpendingDelay_Relative); + int32_t num_blocks_conv = obj->relative.num_blocks; + return num_blocks_conv; +} +int32_t CS_LDK_LDKSpendingDelay_Absolute_get_height(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + CHECK(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_void_(j_calls->instance_ptr, 77); +} +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 (int64_t 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 CS_LDK_LDKFutureCallback_new(int32_t o) { + LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); + *res_ptr = LDKFutureCallback_init(o); + return tag_ptr(res_ptr, true); +} +void CS_LDK_FutureCallback_call(int64_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; @@ -13724,7 +15079,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *event_copy = event; int64_t event_ref = tag_ptr(event_copy, true); - js_invoke_function_void_l(j_calls->instance_ptr, 75, event_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 78, event_ref); } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -13772,7 +15127,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_void_l(j_calls->instance_ptr, 76, tag_ptr(handler_ret, true)); + js_invoke_function_void_l(j_calls->instance_ptr, 79, tag_ptr(handler_ret, true)); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -13837,7 +15192,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 77); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 80); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13916,7 +15271,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_void_ll(j_calls->instance_ptr, 78, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 81, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13927,7 +15282,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_void_ll(j_calls->instance_ptr, 79, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 82, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13938,7 +15293,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_void_ll(j_calls->instance_ptr, 80, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 83, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13949,7 +15304,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_void_ll(j_calls->instance_ptr, 81, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 84, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13960,7 +15315,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_void_ll(j_calls->instance_ptr, 82, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 85, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13971,7 +15326,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_void_ll(j_calls->instance_ptr, 83, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 86, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13982,7 +15337,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_void_ll(j_calls->instance_ptr, 84, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 87, (int64_t)their_node_id_arr, msg_ref); } void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13993,7 +15348,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_void_ll(j_calls->instance_ptr, 85, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 88, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -14004,7 +15359,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_void_ll(j_calls->instance_ptr, 86, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 89, (int64_t)their_node_id_arr, msg_ref); } void handle_stfu_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKStfu * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -14015,39 +15370,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_void_ll(j_calls->instance_ptr, 87, (int64_t)their_node_id_arr, msg_ref); -} -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; - int64_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_void_ll(j_calls->instance_ptr, 88, (int64_t)their_node_id_arr, msg_ref); -} -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; - int64_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_void_ll(j_calls->instance_ptr, 89, (int64_t)their_node_id_arr, msg_ref); -} -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; - int64_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_void_ll(j_calls->instance_ptr, 90, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddInput * msg) { @@ -14344,9 +15666,6 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (int64_t 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, @@ -14533,51 +15852,6 @@ void CS_LDK_ChannelMessageHandler_handle_stfu(int64_t this_arg, int8_tArray the (this_arg_conv->handle_stfu)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -void CS_LDK_ChannelMessageHandler_handle_splice(int64_t this_arg, int8_tArray their_node_id, int64_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 CS_LDK_ChannelMessageHandler_handle_splice_ack(int64_t this_arg, int8_tArray their_node_id, int64_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 CS_LDK_ChannelMessageHandler_handle_splice_locked(int64_t this_arg, int8_tArray their_node_id, int64_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 CS_LDK_ChannelMessageHandler_handle_tx_add_input(int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -15037,6 +16311,55 @@ int64_tArray CS_LDK_OffersMessageHandler_release_pending_messages(int64_t this_ 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_l_l(j_calls->instance_ptr, 118, short_channel_id_conv); + 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 (int64_t 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 CS_LDK_LDKNodeIdLookUp_new(int32_t o) { + LDKNodeIdLookUp *res_ptr = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *res_ptr = LDKNodeIdLookUp_init(o); + return tag_ptr(res_ptr, true); +} +int8_tArray CS_LDK_NodeIdLookUp_next_node_id(int64_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; @@ -15055,7 +16378,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_l_l(j_calls->instance_ptr, 118, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 119, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -15069,7 +16392,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_l_l(j_calls->instance_ptr, 119, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 120, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -15083,7 +16406,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_l_l(j_calls->instance_ptr, 120, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 121, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -15093,7 +16416,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_l_l(j_calls->instance_ptr, 121, starting_point_conv); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 122, starting_point_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr); @@ -15106,7 +16429,7 @@ LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(co int64_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_l_l(j_calls->instance_ptr, 122, starting_point_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 123, starting_point_ref); LDKNodeAnnouncement ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15123,7 +16446,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_l_llb(j_calls->instance_ptr, 123, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 124, (int64_t)their_node_id_arr, init_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -15138,7 +16461,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl int64_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_l_ll(j_calls->instance_ptr, 124, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 125, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15153,7 +16476,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess int64_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_l_ll(j_calls->instance_ptr, 125, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 126, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15168,7 +16491,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl int64_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_l_ll(j_calls->instance_ptr, 126, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 127, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15183,7 +16506,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH int64_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_l_ll(j_calls->instance_ptr, 127, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 128, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15192,11 +16515,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_b_(j_calls->instance_ptr, 128); + return js_invoke_function_b_(j_calls->instance_ptr, 129); } LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 129); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 130); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15207,7 +16530,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_l_l(j_calls->instance_ptr, 130, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 131, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15448,7 +16771,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 131); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 132); LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15476,13 +16799,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_void_ll(j_calls->instance_ptr, 132, (int64_t)peer_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 133, (int64_t)peer_node_id_arr, msg_ref); } 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_l_l(j_calls->instance_ptr, 133, (int64_t)peer_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 134, (int64_t)peer_node_id_arr); LDKOnionMessage ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15499,7 +16822,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_l_llb(j_calls->instance_ptr, 134, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr, init_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -15510,15 +16833,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_void_l(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 136, (int64_t)their_node_id_arr); } void timer_tick_occurred_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 136); + js_invoke_function_void_(j_calls->instance_ptr, 137); } LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 137); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 138); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15529,7 +16852,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_l_l(j_calls->instance_ptr, 138, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 139, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15686,7 +17009,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_l_sl(j_calls->instance_ptr, 139, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_sl(j_calls->instance_ptr, 140, message_type_conv, (int64_t)buffer_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); @@ -15744,7 +17067,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_l_ll(j_calls->instance_ptr, 140, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 141, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15753,7 +17076,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 141); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 142); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15774,7 +17097,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_l_(j_calls->instance_ptr, 142); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 143); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15785,7 +17108,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_l_l(j_calls->instance_ptr, 143, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 144, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15895,7 +17218,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_l_l(j_calls->instance_ptr, 144, tag_ptr(msg_ret, true)); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 145, tag_ptr(msg_ret, true)); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); @@ -15908,7 +17231,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_l_ll(j_calls->instance_ptr, 145, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 146, message_type_conv, (int64_t)buffer_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_OnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ*)(ret_ptr); @@ -15917,7 +17240,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 146); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 147); LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -16023,21 +17346,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_l_lb(j_calls->instance_ptr, 147, (int64_t)data_arr, resume_read_conv); + return js_invoke_function_l_lb(j_calls->instance_ptr, 148, (int64_t)data_arr, resume_read_conv); } void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 148); + js_invoke_function_void_(j_calls->instance_ptr, 149); } 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_b_l(j_calls->instance_ptr, 149, tag_ptr(other_arg_clone, true)); + return js_invoke_function_b_l(j_calls->instance_ptr, 150, tag_ptr(other_arg_clone, true)); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - return js_invoke_function_l_(j_calls->instance_ptr, 150); + return js_invoke_function_l_(j_calls->instance_ptr, 151); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -16091,6 +17414,138 @@ int64_t CS_LDK_SocketDescriptor_hash(int64_t this_arg) { 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; + int64_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_l_l(j_calls->instance_ptr, 152, message_ref); + 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 (int64_t 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 CS_LDK_LDKSignBolt12InvoiceFn_new(int32_t o) { + LDKSignBolt12InvoiceFn *res_ptr = MALLOC(sizeof(LDKSignBolt12InvoiceFn), "LDKSignBolt12InvoiceFn"); + *res_ptr = LDKSignBolt12InvoiceFn_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_SignBolt12InvoiceFn_sign_invoice(int64_t this_arg, int64_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; + int64_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_l_l(j_calls->instance_ptr, 153, message_ref); + 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 (int64_t 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 CS_LDK_LDKSignInvoiceRequestFn_new(int32_t o) { + LDKSignInvoiceRequestFn *res_ptr = MALLOC(sizeof(LDKSignInvoiceRequestFn), "LDKSignInvoiceRequestFn"); + *res_ptr = LDKSignInvoiceRequestFn_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_SignInvoiceRequestFn_sign_invoice_request(int64_t this_arg, int64_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 CS_LDK_LDKSignError_ty_from_ptr(int64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignError_Signing: return 0; + case LDKSignError_Verification: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKSignError_Verification_get_verification(int64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + CHECK(obj->tag == LDKSignError_Verification); + int32_t verification_conv = LDKSecp256k1Error_to_cs(obj->verification); + return verification_conv; +} uint32_t CS_LDK_LDKEffectiveCapacity_ty_from_ptr(int64_t ptr) { LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr); switch(obj->tag) { @@ -16219,7 +17674,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_l_(j_calls->instance_ptr, 151); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 154); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -16264,6 +17719,33 @@ int8_tArray CS_LDK_Score_write(int64_t this_arg) { return ret_arr; } +uint32_t CS_LDK_LDKIntroductionNode_ty_from_ptr(int64_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 CS_LDK_LDKIntroductionNode_NodeId_get_node_id(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(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; +} +int32_t CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__0(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(obj->tag == LDKIntroductionNode_DirectedShortChannelId); + int32_t _0_conv = LDKDirection_to_cs(obj->directed_short_channel_id._0); + return _0_conv; +} +int64_t CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__1(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(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; @@ -16303,7 +17785,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_l_llli(j_calls->instance_ptr, 152, (int64_t)claim_id_arr, (int64_t)must_spend_arr, (int64_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv); + uint64_t ret = js_invoke_function_l_llli(j_calls->instance_ptr, 155, (int64_t)claim_id_arr, (int64_t)must_spend_arr, (int64_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CoinSelectionNoneZ ret_conv = *(LDKCResult_CoinSelectionNoneZ*)(ret_ptr); @@ -16316,7 +17798,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_l_l(j_calls->instance_ptr, 153, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 156, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -16415,7 +17897,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_l_(j_calls->instance_ptr, 154); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 157); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_UtxoZNoneZ ret_conv = *(LDKCResult_CVec_UtxoZNoneZ*)(ret_ptr); @@ -16424,7 +17906,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_l_(j_calls->instance_ptr, 155); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 158); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -16437,7 +17919,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_l_l(j_calls->instance_ptr, 156, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 159, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -16655,6 +18137,24 @@ int64_t CS_LDK_BigEndianScalar_new(int8_tArray big_endian_bytes) { 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 CS_LDK_BigEndianScalar_clone_ptr(int64_t arg) { + LDKBigEndianScalar* arg_conv = (LDKBigEndianScalar*)untag_ptr(arg); + int64_t ret_conv = BigEndianScalar_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_BigEndianScalar_clone(int64_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); @@ -16821,6 +18321,116 @@ void CS_LDK_Str_free(jstring _res) { Str_free(dummy); } +void CS_LDK_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); +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_RefundBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_RefundBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_u64Z_some(int64_t o) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_some(o); @@ -17127,14 +18737,6 @@ int64_t CS_LDK_COption_ThirtyTwoBytesZ_clone(int64_t orig) { return ret_ref; } -void CS_LDK_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); -} - int64_t CS_LDK_COption_CVec_u8ZZ_some(int8_tArray o) { LDKCVec_u8Z o_ref; o_ref.datalen = o->arr_len; @@ -17343,6 +18945,156 @@ int64_t CS_LDK_CResult_RecipientOnionFieldsNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_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); +} + +int64_t CS_LDK_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 CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok(int64_t o) { + LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_SchnorrSignatureNoneZ_free(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr(int64_t arg) { + LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_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 CS_LDK_CVec_ThirtyTwoBytesZ_free(ptrArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -17420,6 +19172,100 @@ int64_t CS_LDK_COption_CVec_ThirtyTwoBytesZZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_COption_AmountZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_AmountZ_none() { + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_AmountZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_AmountZ_clone_ptr(int64_t arg) { + LDKCOption_AmountZ* arg_conv = (LDKCOption_AmountZ*)untag_ptr(arg); + int64_t ret_conv = COption_AmountZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_AmountZ_clone(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_QuantityZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_QuantityZ_none() { + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_QuantityZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_QuantityZ_clone_ptr(int64_t arg) { + LDKCOption_QuantityZ* arg_conv = (LDKCOption_QuantityZ*)untag_ptr(arg); + int64_t ret_conv = COption_QuantityZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_QuantityZ_clone(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_CResult_ThirtyTwoBytesNoneZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); @@ -18057,7 +19903,7 @@ int64_t CS_LDK_COption_BigEndianScalarZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar + 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); int64_t ret_ref = tag_ptr(ret_copy, true); @@ -18165,54 +20011,6 @@ int64_t CS_LDK_CResult_RecoverableSignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_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); -} - -int64_t CS_LDK_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 CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok(int64_t o) { - LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_SchnorrSignatureNoneZ_free(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr(int64_t arg) { - LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_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); -} - int64_t CS_LDK_CResult_ECDSASignatureNoneZ_ok(int8_tArray o) { LDKECDSASignature o_ref; CHECK(o->arr_len == 64); @@ -18261,6 +20059,56 @@ int64_t CS_LDK_CResult_ECDSASignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_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 CS_LDK_CResult_TransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TransactionNoneZ_free(int64_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 CS_LDK_CResult_TransactionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_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); +} + int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -18725,56 +20573,6 @@ int64_t CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_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); -} - -int64_t CS_LDK_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 CS_LDK_CResult_TransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_TransactionNoneZ_free(int64_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 CS_LDK_CResult_TransactionNoneZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_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); -} - int64_t CS_LDK_COption_WriteableScoreZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -20032,6 +21830,60 @@ void CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_free(int64_t _res) { CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); } +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_err(int64_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 CS_LDK_CResult_BestBlockDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BestBlockDecodeErrorZ* o_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BestBlockDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BestBlockDecodeErrorZ_free(int64_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 CS_LDK_CResult_BestBlockDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BestBlockDecodeErrorZ* arg_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BestBlockDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_clone(int64_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); @@ -20216,81 +22068,86 @@ void CS_LDK_CVec_MonitorEventZ_free(int64_tArray _res) { 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 CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(int64_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 CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(int64_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; } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(int64_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); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(int64_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); } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(int64_t a, int64_tArray b, int8_tArray c) { +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(int64_t a, int64_t b, int64_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; - int64_t* b_vals = b->elems; - for (size_t o = 0; o < b_constr.datalen; o++) { - int64_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 CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(int64_t _res) { + c_constr.data = NULL; + int64_t* c_vals = c->elems; + for (size_t o = 0; o < c_constr.datalen; o++) { + int64_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 CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(int64_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 CS_LDK_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr; +void CS_LDK_CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(int64_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; int64_t* _res_vals = _res->elems; - for (size_t x = 0; x < _res_constr.datalen; x++) { - int64_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++) { + int64_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); } int64_t CS_LDK_CResult_InitFeaturesDecodeErrorZ_ok(int64_t o) { @@ -20671,6 +22528,225 @@ int64_t CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_err(int64_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 CS_LDK_CResult_OfferIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OfferIdDecodeErrorZ* o_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferIdDecodeErrorZ_free(int64_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 CS_LDK_CResult_OfferIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferIdDecodeErrorZ* arg_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok() { + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_OfferBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_OfferBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_ok(int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -20726,55 +22802,6 @@ int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_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); -} - -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free(int64_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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone(int64_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); -} - int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_ok(int64_t o) { LDKNodeId o_conv; o_conv.inner = untag_ptr(o); @@ -20829,6 +22856,55 @@ int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err(int32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok(int64_t o) { + LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free(int64_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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_NetworkUpdateZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -21614,6 +23690,34 @@ int64_t CS_LDK_COption_CVec_SocketAddressZZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_CResult_u64ShortChannelIdErrorZ_err(int32_t e) { + LDKShortChannelIdError e_conv = LDKShortChannelIdError_from_cs(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 CS_LDK_CResult_u64ShortChannelIdErrorZ_is_ok(int64_t o) { + LDKCResult_u64ShortChannelIdErrorZ* o_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_u64ShortChannelIdErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_u64ShortChannelIdErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_ok(int64_t o) { LDKPendingHTLCInfo o_conv; o_conv.inner = untag_ptr(o); @@ -21630,8 +23734,7 @@ int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_err(int64_t e) { 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); @@ -21652,6 +23755,24 @@ void CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_free(int64_t _res) { 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 CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(int64_t arg) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* arg_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone(int64_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 CS_LDK_CVec_HTLCOutputInCommitmentZ_free(int64_tArray _res) { LDKCVec_HTLCOutputInCommitmentZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -21891,6 +24012,53 @@ int64_t CS_LDK_CResult_CVec_UtxoZNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_COption_PaymentContextZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_PaymentContextZ_none() { + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_PaymentContextZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PaymentContextZ_clone_ptr(int64_t arg) { + LDKCOption_PaymentContextZ* arg_conv = (LDKCOption_PaymentContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentContextZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_PaymentContextZ_clone(int64_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); + int64_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); @@ -22015,55 +24183,57 @@ int64_t CS_LDK_COption_ChannelShutdownStateZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_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); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_ok(int64_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); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_err(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(int64_t o) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelIdAPIErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdAPIErrorZ* o_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdAPIErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelIdAPIErrorZ_free(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdAPIErrorZ* arg_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_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); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_clone(int64_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); } @@ -22460,63 +24630,136 @@ int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFail 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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(int64_t arg) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* arg_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone_ptr(int64_t arg) { + LDKC2Tuple_ChannelIdPublicKeyZ* arg_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(int64_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); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone(int64_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); } -int64_t CS_LDK_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); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_new(int64_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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_free(int64_t _res) { +void CS_LDK_C2Tuple_ChannelIdPublicKeyZ_free(int64_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 CS_LDK_CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res_constr; +void CS_LDK_CVec_C2Tuple_ChannelIdPublicKeyZZ_free(int64_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; int64_t* _res_vals = _res->elems; - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_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++) { + int64_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 CS_LDK_CVec_ChannelIdZ_free(int64_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; + int64_t* _res_vals = _res->elems; + for (size_t l = 0; l < _res_constr.datalen; l++) { + int64_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); +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(int64_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); } int64_t CS_LDK_COption_StrZ_some(jstring o) { @@ -22563,52 +24806,6 @@ int64_t CS_LDK_COption_StrZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok() { - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_err(int32_t e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_NoneBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone(int64_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); -} - int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -22658,6 +24855,58 @@ int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(int64_t return tag_ptr(ret_conv, true); } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(int64_t o) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_OffersMessageZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -23980,27 +26229,6 @@ void CS_LDK_CVec_CommitmentTransactionZ_free(int64_tArray _res) { CVec_CommitmentTransactionZ_free(_res_constr); } -void CS_LDK_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 i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = _res_vals[i]; - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = _res_conv_8->arr_len; - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_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); @@ -24701,64 +26929,24 @@ int64_t CS_LDK_COption_SocketAddressZ_clone(int64_t orig) { 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 CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(int64_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; -} - -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(int64_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); -} - -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_new(int8_tArray a, int64_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 CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_free(int64_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 CS_LDK_CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res_constr; +void CS_LDK_CVec_PeerDetailsZ_free(int64_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; int64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_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++) { + int64_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); } int64_t CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) { @@ -25204,6 +27392,108 @@ int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(int6 return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_SecretKeyZ_some(int8_tArray o) { LDKSecretKey o_ref; CHECK(o->arr_len == 32); @@ -25250,6 +27540,40 @@ int64_t CS_LDK_COption_SecretKeyZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_ok(int64_t o) { LDKVerifiedInvoiceRequest o_conv; o_conv.inner = untag_ptr(o); @@ -25300,6 +27624,94 @@ int64_t CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_err(int64_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 CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_free(int64_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 CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone(int64_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); +} + int32_t CS_LDK_COption_NoneZ_some() { int32_t ret_conv = LDKCOption_NoneZ_to_cs(COption_NoneZ_some()); return ret_conv; @@ -25336,6 +27748,52 @@ void CS_LDK_CVec_WitnessZ_free(ptrArray _res) { CVec_WitnessZ_free(_res_constr); } +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_ECDSASignatureZ_none() { + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_ECDSASignatureZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_ECDSASignatureZ_clone_ptr(int64_t arg) { + LDKCOption_ECDSASignatureZ* arg_conv = (LDKCOption_ECDSASignatureZ*)untag_ptr(arg); + int64_t ret_conv = COption_ECDSASignatureZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_ECDSASignatureZ_clone(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_COption_i64Z_some(int64_t o) { LDKCOption_i64Z *ret_copy = MALLOC(sizeof(LDKCOption_i64Z), "LDKCOption_i64Z"); *ret_copy = COption_i64Z_some(o); @@ -29251,6 +31709,27 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } +void CS_LDK_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 i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = _res_vals[i]; + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = _res_conv_8->arr_len; + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; + } + FREE(_res); + CVec_TransactionZ_free(_res_constr); +} + int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -30763,6 +33242,60 @@ int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_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_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_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_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ChannelIdDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ChannelIdDecodeErrorZ_free(_res_conv); +} + +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 CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone(int64_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); +} + 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); @@ -30907,98 +33440,218 @@ int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { 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); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_ok(int64_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); } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(int64_t arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_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_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(int64_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); +void CS_LDK_CResult_PaymentContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PaymentContextDecodeErrorZ_free(_res_conv); +} + +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 CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, int64_t b, int64_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); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone(int64_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); } -void CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(int64_t _res) { +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_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 = 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); +} + +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_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_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free(int64_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_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); + CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_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_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 CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err() { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone(int64_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); } -jboolean CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(int64_t o) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_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 = 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); +} + +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_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_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free(int64_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_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_Bolt12OfferContextDecodeErrorZ_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_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 CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(int64_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 CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(int64_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); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt12RefundContextDecodeErrorZ_free(_res_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 CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_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); } @@ -31049,6 +33702,101 @@ int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone(int64_t orig) { 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); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(int64_t arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(int64_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); +} + +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, int64_t b, int64_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 CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(int64_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); + FREE(untag_ptr(_res)); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_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); +} + +int64_t CS_LDK_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); +} + +jboolean CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(int64_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; +} + +void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_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); +} + +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 CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(int64_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; +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(int64_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); +} + int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -31179,6 +33927,24 @@ void CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZS CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_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); +} +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_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; +} + +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_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); +} + int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -31210,6 +33976,24 @@ void CS_LDK_CResult_PeeledOnionNoneZ_free(int64_t _res) { CResult_PeeledOnionNoneZ_free(_res_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); +} +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone(int64_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); +} + int64_t CS_LDK_CResult_SendSuccessSendErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -31245,6 +34029,24 @@ void CS_LDK_CResult_SendSuccessSendErrorZ_free(int64_t _res) { CResult_SendSuccessSendErrorZ_free(_res_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 CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_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 CS_LDK_CResult_BlindedPathNoneZ_ok(int64_t o) { LDKBlindedPath o_conv; o_conv.inner = untag_ptr(o); @@ -31526,6 +34328,261 @@ int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_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); +} + +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); +} +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_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); +} + +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 CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_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 CS_LDK_COption_FilterZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_FilterZ_none() { + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_FilterZ_free(int64_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); +} + +void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_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; + int64_t* _res_vals = _res->elems; + for (size_t y = 0; y < _res_constr.datalen; y++) { + int64_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); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_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); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_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); +} + +void CS_LDK_C2Tuple_BestBlockOutputSweeperZ_free(int64_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); +} + +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_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; +} + +void CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { LDKDelayedPaymentBasepoint o_conv; o_conv.inner = untag_ptr(o); @@ -31850,36 +34907,6 @@ int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_FilterZ_some(int64_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); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_FilterZ_none() { - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_FilterZ_free(int64_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); -} - int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_ok(int64_t o) { LDKLockedChannelMonitor o_conv; o_conv.inner = untag_ptr(o); @@ -31913,24 +34940,67 @@ void CS_LDK_CResult_LockedChannelMonitorNoneZ_free(int64_t _res) { CResult_LockedChannelMonitorNoneZ_free(_res_conv); } -void CS_LDK_CVec_OutPointZ_free(int64_tArray _res) { - LDKCVec_OutPointZ _res_constr; +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 CS_LDK_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone(int64_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); +} + +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_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 CS_LDK_C2Tuple_OutPointChannelIdZ_free(int64_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); +} + +void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_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(LDKOutPoint), "LDKCVec_OutPointZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t k = 0; k < _res_constr.datalen; k++) { - int64_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; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_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_OutPointZ_free(_res_constr); + CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { @@ -32430,6 +35500,19 @@ int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) return ret_arr; } +int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_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; +} + int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { LDKTransactionU16LenLimited obj_conv; obj_conv.inner = untag_ptr(obj); @@ -32662,6 +35745,55 @@ int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { + LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_block_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); + return ret_conv; +} + +jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_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; +} + +int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { + int32_t ret_conv = block_from_scid(short_channel_id); + return ret_conv; +} + +int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { + int32_t ret_conv = tx_index_from_scid(short_channel_id); + return ret_conv; +} + +int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { + int16_t ret_conv = vout_from_scid(short_channel_id); + return ret_conv; +} + +int64_t CS_LDK_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); +} + void CS_LDK_UntrustedString_free(int64_t this_obj) { LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32818,53 +35950,647 @@ int64_t CS_LDK_PrintableString_new(jstring a_arg) { return ret_ref; } -void CS_LDK_FutureCallback_free(int64_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 CS_LDK_Future_free(int64_t this_obj) { - LDKFuture this_obj_conv; +void CS_LDK_TrackedSpendableOutput_free(int64_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); - Future_free(this_obj_conv); + TrackedSpendableOutput_free(this_obj_conv); } -static inline uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg) { - LDKFuture ret_var = Future_clone(arg); +int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_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; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_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); + LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); + val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); + TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_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; + LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_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; + 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); + TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_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; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_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); + LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); + val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); + TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_new(int64_t descriptor_arg, int64_t channel_id_arg, int64_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); + int64_t ret_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 TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(arg); int64_t ret_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 CS_LDK_Future_clone_ptr(int64_t arg) { - LDKFuture arg_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone_ptr(int64_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 = Future_clone_ptr(&arg_conv); + int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Future_clone(int64_t orig) { - LDKFuture orig_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone(int64_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; - LDKFuture ret_var = Future_clone(&orig_conv); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); int64_t ret_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 CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_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; + 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 = TrackedSpendableOutput_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_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; +} + +int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpendStatus_free(this_ptr_conv); +} + +static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { + LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); + int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { + LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_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; +} + +int8_tArray CS_LDK_OutputSpendStatus_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_OutputSweeper_free(int64_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); + OutputSweeper_free(this_obj_conv); +} + +int64_t CS_LDK_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_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); + 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* 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); + 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); + } + 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); + int64_t ret_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 CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_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_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 + output_descriptors_constr.data = NULL; + int64_t* output_descriptors_vals = output_descriptors->elems; + for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { + int64_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); +} + +int64_tArray CS_LDK_OutputSweeper_tracked_spendable_outputs(int64_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_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t y = 0; y < ret_var.datalen; y++) { + LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; + int64_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; +} + +int64_t CS_LDK_OutputSweeper_current_best_block(int64_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; + LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); + int64_t ret_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 CS_LDK_OutputSweeper_as_Listen(int64_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; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_OutputSweeper_as_Confirm(int64_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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_SpendingDelay_free(int64_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); +} + +static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { + LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); + int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { + LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_relative(num_blocks); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_absolute(height); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_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); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_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 CS_LDK_FutureCallback_free(int64_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 CS_LDK_Future_free(int64_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 CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { LDKFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -32886,8 +36612,8 @@ void CS_LDK_Future_wait(int64_t this_arg) { this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = Future_clone(&this_arg_conv); - Future_wait(this_arg_conv); + this_arg_conv.is_owned = false; + Future_wait(&this_arg_conv); } jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { @@ -32895,8 +36621,8 @@ jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = Future_clone(&this_arg_conv); - jboolean ret_conv = Future_wait_timeout(this_arg_conv, max_wait); + this_arg_conv.is_owned = false; + jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); return ret_conv; } @@ -32913,8 +36639,8 @@ int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { future_conv.inner = untag_ptr(future); future_conv.is_owned = ptr_is_owned(future); CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); - future_conv = Future_clone(&future_conv); - LDKSleeper ret_var = Sleeper_from_single_future(future_conv); + future_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -32926,13 +36652,13 @@ int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { fut_a_conv.inner = untag_ptr(fut_a); fut_a_conv.is_owned = ptr_is_owned(fut_a); CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_a_conv); - fut_a_conv = Future_clone(&fut_a_conv); + fut_a_conv.is_owned = false; LDKFuture fut_b_conv; fut_b_conv.inner = untag_ptr(fut_b); fut_b_conv.is_owned = ptr_is_owned(fut_b); CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_b_conv); - fut_b_conv = Future_clone(&fut_b_conv); - LDKSleeper ret_var = Sleeper_from_two_futures(fut_a_conv, fut_b_conv); + fut_b_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -32953,7 +36679,8 @@ int64_t CS_LDK_Sleeper_new(int64_tArray futures) { futures_conv_8_conv.inner = untag_ptr(futures_conv_8); futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); - futures_conv_8_conv = Future_clone(&futures_conv_8_conv); + // WARNING: we need a move here but no clone is available for LDKFuture + futures_constr.data[i] = futures_conv_8_conv; } FREE(futures); @@ -33094,9 +36821,10 @@ int64_t CS_LDK_Record_get_channel_id(int64_t this_ptr) { this_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); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKChannelId ret_var = Record_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } @@ -33106,10 +36834,11 @@ void CS_LDK_Record_set_channel_id(int64_t this_ptr, int64_t val) { this_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)); + 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); } @@ -33203,10 +36932,11 @@ int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t c 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)); + 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); @@ -34465,6 +38195,59 @@ void CS_LDK_BestBlock_free(int64_t this_obj) { BestBlock_free(this_obj_conv); } +int8_tArray CS_LDK_BestBlock_get_block_hash(int64_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; + 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 CS_LDK_BestBlock_set_block_hash(int64_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; + 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); +} + +int32_t CS_LDK_BestBlock_get_height(int64_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 = BestBlock_get_height(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BestBlock_set_height(int64_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; + BestBlock_set_height(&this_ptr_conv, val); +} + +int64_t CS_LDK_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); + int64_t ret_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 BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { LDKBestBlock ret_var = BestBlock_clone(arg); int64_t ret_ref = 0; @@ -34495,6 +38278,16 @@ int64_t CS_LDK_BestBlock_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_BestBlock_hash(int64_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; +} + jboolean CS_LDK_BestBlock_eq(int64_t a, int64_t b) { LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); @@ -34519,36 +38312,27 @@ int64_t CS_LDK_BestBlock_from_network(int32_t network) { return ret_ref; } -int64_t CS_LDK_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); - int64_t ret_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 CS_LDK_BestBlock_block_hash(int64_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 CS_LDK_BestBlock_write(int64_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; } -int32_t CS_LDK_BestBlock_height(int64_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; +int64_t CS_LDK_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); } void CS_LDK_Listen_free(int64_t this_ptr) { @@ -34822,6 +38606,11 @@ int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { return ret_conv; } +int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); + return ret_conv; +} + int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); int64_t ret_conv = ConfirmationTarget_hash(o_conv); @@ -35039,16 +38828,14 @@ int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { this_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_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKOutPoint ret_conv_10_var = ret_var.data[k]; - int64_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 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); @@ -35118,6 +38905,29 @@ void CS_LDK_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); } +void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_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 CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_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); +} + int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -35189,6 +38999,33 @@ void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_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; + LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_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; + 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); + ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); +} + static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); int64_t ret_ref = 0; @@ -35298,6 +39135,27 @@ int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { return ret_ref; } +int64_t CS_LDK_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); @@ -35310,14 +39168,19 @@ int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { return ret_ref; } -int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t monitor_update_id) { +int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_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, monitor_update_id); + *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -35617,6 +39480,19 @@ int64_t CS_LDK_ChannelMonitor_get_funding_txo(int64_t this_arg) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_ChannelMonitor_channel_id(int64_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; + LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -35752,119 +39628,112 @@ int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { return ret_arr; } -ptrArray CS_LDK_ChannelMonitor_get_latest_holder_commitment_txn(int64_t this_arg, int64_t logger) { +void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_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); + 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; - 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 i = 0; i < ret_var.datalen; i++) { - LDKTransaction ret_conv_8_var = ret_var.data[i]; - int8_tArray ret_conv_8_arr = init_int8_tArray(ret_conv_8_var.datalen, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_conv_8_var.data, ret_conv_8_var.datalen); - Transaction_free(ret_conv_8_var); - ret_arr_ptr[i] = ret_conv_8_arr; + ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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; + int64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_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); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t 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_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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; - int64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_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); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t 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 CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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); -} - -int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { +void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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); +} + +int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -36051,6 +39920,32 @@ void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } +void CS_LDK_ChannelMonitor_signer_unblocked(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_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_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8_tArray tx, int32_t confirmation_height) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -36077,6 +39972,19 @@ int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8 return ret_arr; } +jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_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; + jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); + return ret_conv; +} + int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -36230,17 +40138,6 @@ int64_t CS_LDK_OutPoint_hash(int64_t o) { return ret_conv; } -int8_tArray CS_LDK_OutPoint_to_channel_id(int64_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; -} - int8_tArray CS_LDK_OutPoint_write(int64_t obj) { LDKOutPoint obj_conv; obj_conv.inner = untag_ptr(obj); @@ -36352,6 +40249,61 @@ int64_t CS_LDK_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_ar return ret_ref; } +static inline uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { + LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(arg); + int64_t ret_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 CS_LDK_InboundHTLCErr_clone_ptr(int64_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; +} + +int64_t CS_LDK_InboundHTLCErr_clone(int64_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); + int64_t ret_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 CS_LDK_InboundHTLCErr_hash(int64_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 CS_LDK_InboundHTLCErr_eq(int64_t a, int64_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; +} + int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { LDKUpdateAddHTLC msg_conv; msg_conv.inner = untag_ptr(msg); @@ -36415,7 +40367,7 @@ int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_c return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_tArray custom_tlvs, jboolean requires_blinded_error) { +int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_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); @@ -36425,6 +40377,10 @@ int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment 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); @@ -36445,12 +40401,12 @@ int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment } 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); + *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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs) { +int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_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); @@ -36480,7 +40436,7 @@ int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tA } 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); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -37347,27 +41303,31 @@ void CS_LDK_ChannelDetails_free(int64_t this_obj) { ChannelDetails_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelDetails_get_channel_id(int64_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, *ChannelDetails_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_ChannelDetails_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelDetails_set_channel_id(int64_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; - 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); + 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); } int64_t CS_LDK_ChannelDetails_get_counterparty(int64_t this_ptr) { @@ -37966,83 +41926,6 @@ void CS_LDK_ChannelDetails_set_config(int64_t this_ptr, int64_t val) { ChannelDetails_set_config(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_new(int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_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, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_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); - int64_t ret_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 ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { LDKChannelDetails ret_var = ChannelDetails_clone(arg); int64_t ret_ref = 0; @@ -38469,16 +42352,17 @@ int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray thei 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)); + 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_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + 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); } @@ -38573,34 +42457,36 @@ int64_tArray CS_LDK_ChannelManager_list_recent_payments(int64_t this_arg) { return ret_arr; } -int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_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; - 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; + 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_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { +int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_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; - 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; + 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); @@ -38614,43 +42500,45 @@ int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t thi 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); + *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); } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_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; - 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; + 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_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_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; - 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; + 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_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } @@ -38856,16 +42744,17 @@ int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t r return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { +int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_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; - 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; + 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); @@ -38875,7 +42764,7 @@ int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, i 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); + *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); } @@ -38885,20 +42774,20 @@ int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_ this_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; + 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_ThirtyTwoBytesPublicKeyZ), "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ Elements"); + temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); else temporary_channels_constr.data = NULL; int64_t* temporary_channels_vals = temporary_channels->elems; - for (size_t j = 0; j < temporary_channels_constr.datalen; j++) { - int64_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; + for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { + int64_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; @@ -38911,7 +42800,7 @@ int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_ return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, int64_t config_update) { +int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_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); @@ -38920,19 +42809,21 @@ int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, i 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; + 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(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); else channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t i = 0; i < channel_ids_constr.datalen; i++) { - int8_tArray channel_ids_conv_8 = channel_ids_vals[i]; - LDKThirtyTwoBytes channel_ids_conv_8_ref; - CHECK(channel_ids_conv_8->arr_len == 32); - memcpy(channel_ids_conv_8_ref.data, channel_ids_conv_8->elems, 32); FREE(channel_ids_conv_8); - channel_ids_constr.data[i] = channel_ids_conv_8_ref; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_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; @@ -38945,7 +42836,7 @@ int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, i return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, int64_t config) { +int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -38954,19 +42845,21 @@ int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArr 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; + 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(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); else channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t i = 0; i < channel_ids_constr.datalen; i++) { - int8_tArray channel_ids_conv_8 = channel_ids_vals[i]; - LDKThirtyTwoBytes channel_ids_conv_8_ref; - CHECK(channel_ids_conv_8->arr_len == 32); - memcpy(channel_ids_conv_8_ref.data, channel_ids_conv_8->elems, 32); FREE(channel_ids_conv_8); - channel_ids_constr.data[i] = channel_ids_conv_8_ref; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_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; @@ -38979,7 +42872,7 @@ int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArr return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { +int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_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); @@ -38988,15 +42881,16 @@ int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_t 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; + 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_ref, next_node_id_ref, amt_to_forward_msat); + *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); } @@ -39097,16 +42991,17 @@ int8_tArray CS_LDK_ChannelManager_get_our_node_id(int64_t this_arg) { return ret_arr; } -int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { +int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_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; - 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; + 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); @@ -39114,20 +43009,21 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int8_tAr 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); + *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); } -int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { +int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_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; - 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; + 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); @@ -39135,7 +43031,40 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(in 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); + *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); +} + +int64_t CS_LDK_ChannelManager_create_offer_builder(int64_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); +} + +int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_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); } @@ -39189,7 +43118,7 @@ int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t 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"); + 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); } @@ -39452,6 +43381,17 @@ int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_ChannelManager_as_NodeIdLookUp(int64_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); +} + int64_t CS_LDK_provided_init_features(int64_t config) { LDKUserConfig config_conv; config_conv.inner = untag_ptr(config); @@ -40134,6 +44074,20 @@ int8_tArray CS_LDK_DelayedPaymentBasepoint_to_public_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_DelayedPaymentBasepoint_derive_add_tweak(int64_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; + 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; +} + int8_tArray CS_LDK_DelayedPaymentBasepoint_write(int64_t obj) { LDKDelayedPaymentBasepoint obj_conv; obj_conv.inner = untag_ptr(obj); @@ -40414,6 +44368,20 @@ int8_tArray CS_LDK_HtlcBasepoint_to_public_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_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; + 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 CS_LDK_HtlcBasepoint_write(int64_t obj) { LDKHtlcBasepoint obj_conv; obj_conv.inner = untag_ptr(obj); @@ -40586,6 +44554,19 @@ int64_t CS_LDK_HtlcKey_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_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; +} + void CS_LDK_RevocationBasepoint_free(int64_t this_obj) { LDKRevocationBasepoint this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -41007,6 +44988,13 @@ int64_t CS_LDK_DecodeError_unsupported_compression() { return ret_ref; } +int64_t CS_LDK_DecodeError_dangerous_value() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_dangerous_value(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_DecodeError_hash(int64_t o) { LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); int64_t ret_conv = DecodeError_hash(o_conv); @@ -41188,27 +45176,31 @@ void CS_LDK_ErrorMessage_free(int64_t this_obj) { ErrorMessage_free(this_obj_conv); } -int8_tArray CS_LDK_ErrorMessage_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ErrorMessage_get_channel_id(int64_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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ErrorMessage_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_ErrorMessage_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ErrorMessage_set_channel_id(int64_t this_ptr, int64_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; - 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); + 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); } jstring CS_LDK_ErrorMessage_get_data(int64_t this_ptr) { @@ -41233,12 +45225,14 @@ void CS_LDK_ErrorMessage_set_data(int64_t this_ptr, jstring val) { ErrorMessage_set_data(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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); +int64_t CS_LDK_ErrorMessage_new(int64_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_ref, data_arg_conv); + LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_conv, data_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41308,27 +45302,31 @@ void CS_LDK_WarningMessage_free(int64_t this_obj) { WarningMessage_free(this_obj_conv); } -int8_tArray CS_LDK_WarningMessage_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_WarningMessage_get_channel_id(int64_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); - return ret_arr; + LDKChannelId ret_var = WarningMessage_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_WarningMessage_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_WarningMessage_set_channel_id(int64_t this_ptr, int64_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; - 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); + 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); } jstring CS_LDK_WarningMessage_get_data(int64_t this_ptr) { @@ -41353,12 +45351,14 @@ void CS_LDK_WarningMessage_set_data(int64_t this_ptr, jstring val) { WarningMessage_set_data(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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); +int64_t CS_LDK_WarningMessage_new(int64_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_ref, data_arg_conv); + LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_conv, data_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41619,27 +45619,27 @@ jboolean CS_LDK_Pong_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_OpenChannel_free(int64_t this_obj) { - LDKOpenChannel this_obj_conv; +void CS_LDK_CommonOpenChannelFields_free(int64_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); - OpenChannel_free(this_obj_conv); + CommonOpenChannelFields_free(this_obj_conv); } -int8_tArray CS_LDK_OpenChannel_get_chain_hash(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_chain_hash(int64_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(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32); + memcpy(ret_arr->elems, *CommonOpenChannelFields_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_OpenChannel_set_chain_hash(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_chain_hash(int64_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); @@ -41647,769 +45647,182 @@ void CS_LDK_OpenChannel_set_chain_hash(int64_t this_ptr, int8_tArray val) { 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); -} - -int8_tArray CS_LDK_OpenChannel_get_temporary_channel_id(int64_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(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_temporary_channel_id(int64_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; - 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); -} - -int64_t CS_LDK_OpenChannel_get_funding_satoshis(int64_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_funding_satoshis(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_funding_satoshis(int64_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_funding_satoshis(&this_ptr_conv, val); -} - -int64_t CS_LDK_OpenChannel_get_push_msat(int64_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 CS_LDK_OpenChannel_set_push_msat(int64_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 CS_LDK_OpenChannel_get_dust_limit_satoshis(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_dust_limit_satoshis(int64_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); -} - -int64_t CS_LDK_OpenChannel_get_max_htlc_value_in_flight_msat(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_max_htlc_value_in_flight_msat(int64_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 CS_LDK_OpenChannel_get_channel_reserve_satoshis(int64_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 CS_LDK_OpenChannel_set_channel_reserve_satoshis(int64_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); -} - -int64_t CS_LDK_OpenChannel_get_htlc_minimum_msat(int64_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_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_htlc_minimum_msat(int64_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_htlc_minimum_msat(&this_ptr_conv, val); -} - -int32_t CS_LDK_OpenChannel_get_feerate_per_kw(int64_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; - int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_feerate_per_kw(int64_t this_ptr, int32_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_feerate_per_kw(&this_ptr_conv, val); -} - -int16_t CS_LDK_OpenChannel_get_to_self_delay(int64_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; -} - -void CS_LDK_OpenChannel_set_to_self_delay(int64_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); -} - -int16_t CS_LDK_OpenChannel_get_max_accepted_htlcs(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_max_accepted_htlcs(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_funding_pubkey(int64_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; -} - -void CS_LDK_OpenChannel_set_funding_pubkey(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_revocation_basepoint(int64_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 CS_LDK_OpenChannel_set_revocation_basepoint(int64_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_revocation_basepoint(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannel_get_payment_point(int64_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_payment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_payment_point(int64_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_payment_point(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannel_get_delayed_payment_basepoint(int64_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_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_delayed_payment_basepoint(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_htlc_basepoint(int64_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; -} - -void CS_LDK_OpenChannel_set_htlc_basepoint(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_first_per_commitment_point(int64_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; -} - -void CS_LDK_OpenChannel_set_first_per_commitment_point(int64_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); -} - -int8_t CS_LDK_OpenChannel_get_channel_flags(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_channel_flags(int64_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); -} - -int64_t CS_LDK_OpenChannel_get_shutdown_scriptpubkey(int64_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; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = OpenChannel_get_shutdown_scriptpubkey(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_OpenChannel_set_shutdown_scriptpubkey(int64_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; - 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); + CommonOpenChannelFields_set_chain_hash(&this_ptr_conv, val_ref); } -int64_t CS_LDK_OpenChannel_get_channel_type(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_temporary_channel_id(int64_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 = OpenChannel_get_channel_type(&this_ptr_conv); + LDKChannelId ret_var = CommonOpenChannelFields_get_temporary_channel_id(&this_ptr_conv); int64_t ret_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 CS_LDK_OpenChannel_set_channel_type(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_temporary_channel_id(int64_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; - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone(&val_conv); - OpenChannel_set_channel_type(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_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); - int64_t ret_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); - int64_t ret_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 CS_LDK_OpenChannel_clone_ptr(int64_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; -} - -int64_t CS_LDK_OpenChannel_clone(int64_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); - int64_t ret_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 CS_LDK_OpenChannel_hash(int64_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 CS_LDK_OpenChannel_eq(int64_t a, int64_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 CS_LDK_OpenChannelV2_free(int64_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); -} - -int8_tArray CS_LDK_OpenChannelV2_get_chain_hash(int64_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_chain_hash(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_OpenChannelV2_set_chain_hash(int64_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_chain_hash(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannelV2_get_temporary_channel_id(int64_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; -} - -void CS_LDK_OpenChannelV2_set_temporary_channel_id(int64_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); -} - -int32_t CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(int64_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_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(int64_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_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); + val_conv = ChannelId_clone(&val_conv); + CommonOpenChannelFields_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_OpenChannelV2_get_funding_satoshis(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_funding_satoshis(int64_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); + int64_t ret_conv = CommonOpenChannelFields_get_funding_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_funding_satoshis(int64_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_funding_satoshis(&this_ptr_conv, val); + CommonOpenChannelFields_set_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_dust_limit_satoshis(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_dust_limit_satoshis(int64_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_dust_limit_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_dust_limit_satoshis(int64_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_dust_limit_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(int64_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_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(int64_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_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_htlc_minimum_msat(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_htlc_minimum_msat(int64_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_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_htlc_minimum_msat(int64_t this_ptr, int64_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_htlc_minimum_msat(&this_ptr_conv, val); -} - -int16_t CS_LDK_OpenChannelV2_get_to_self_delay(int64_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; - int16_t ret_conv = OpenChannelV2_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannelV2_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_htlc_minimum_msat(int64_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 CS_LDK_OpenChannelV2_get_max_accepted_htlcs(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int32_t CS_LDK_CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_get_locktime(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_CommonOpenChannelFields_get_to_self_delay(int64_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 CS_LDK_OpenChannelV2_set_locktime(int64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_to_self_delay(int64_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 CS_LDK_OpenChannelV2_get_funding_pubkey(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_CommonOpenChannelFields_get_max_accepted_htlcs(int64_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 CS_LDK_OpenChannelV2_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_max_accepted_htlcs(int64_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 CS_LDK_OpenChannelV2_get_revocation_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_funding_pubkey(int64_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 CS_LDK_OpenChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_funding_pubkey(int64_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); @@ -42417,22 +45830,22 @@ void CS_LDK_OpenChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArra 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 CS_LDK_OpenChannelV2_get_payment_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_revocation_basepoint(int64_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 CS_LDK_OpenChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_revocation_basepoint(int64_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); @@ -42440,22 +45853,22 @@ void CS_LDK_OpenChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray v 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 CS_LDK_OpenChannelV2_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_payment_basepoint(int64_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 CS_LDK_OpenChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_payment_basepoint(int64_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); @@ -42463,22 +45876,22 @@ void CS_LDK_OpenChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_ 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 CS_LDK_OpenChannelV2_get_htlc_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_delayed_payment_basepoint(int64_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 CS_LDK_OpenChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_delayed_payment_basepoint(int64_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); @@ -42486,22 +45899,22 @@ void CS_LDK_OpenChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) 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 CS_LDK_OpenChannelV2_get_first_per_commitment_point(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_htlc_basepoint(int64_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 CS_LDK_OpenChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_htlc_basepoint(int64_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); @@ -42509,22 +45922,22 @@ void CS_LDK_OpenChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8 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 CS_LDK_OpenChannelV2_get_second_per_commitment_point(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_first_per_commitment_point(int64_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 CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_first_per_commitment_point(int64_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); @@ -42532,42 +45945,42 @@ void CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int 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 CS_LDK_OpenChannelV2_get_channel_flags(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_t CS_LDK_CommonOpenChannelFields_get_channel_flags(int64_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 CS_LDK_OpenChannelV2_set_channel_flags(int64_t this_ptr, int8_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_channel_flags(int64_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); } -int64_t CS_LDK_OpenChannelV2_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_shutdown_scriptpubkey(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_shutdown_scriptpubkey(int64_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); @@ -42576,24 +45989,24 @@ void CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t v 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); } -int64_t CS_LDK_OpenChannelV2_get_channel_type(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_channel_type(int64_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); int64_t ret_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 CS_LDK_OpenChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_channel_type(int64_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); @@ -42603,36 +46016,18 @@ void CS_LDK_OpenChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { 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); -} - -int32_t CS_LDK_OpenChannelV2_get_require_confirmed_inputs(int64_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 = LDKCOption_NoneZ_to_cs(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); - return ret_conv; + CommonOpenChannelFields_set_channel_type(&this_ptr_conv, val_conv); } -void CS_LDK_OpenChannelV2_set_require_confirmed_inputs(int64_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; - LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); - OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg, int32_t require_confirmed_inputs_arg) { +int64_t CS_LDK_CommonOpenChannelFields_new(int8_tArray chain_hash_arg, int64_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, int64_t shutdown_scriptpubkey_arg, int64_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); @@ -42651,9 +46046,6 @@ int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray tempor 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); @@ -42663,8 +46055,336 @@ int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray tempor 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); + int64_t ret_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); + int64_t ret_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 CS_LDK_CommonOpenChannelFields_clone_ptr(int64_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; +} + +int64_t CS_LDK_CommonOpenChannelFields_clone(int64_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); + int64_t ret_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 CS_LDK_CommonOpenChannelFields_hash(int64_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 CS_LDK_CommonOpenChannelFields_eq(int64_t a, int64_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 CS_LDK_OpenChannel_free(int64_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); +} + +int64_t CS_LDK_OpenChannel_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_OpenChannel_set_common_fields(int64_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; + 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 CS_LDK_OpenChannel_get_push_msat(int64_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 CS_LDK_OpenChannel_set_push_msat(int64_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 CS_LDK_OpenChannel_get_channel_reserve_satoshis(int64_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 CS_LDK_OpenChannel_set_channel_reserve_satoshis(int64_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); +} + +int64_t CS_LDK_OpenChannel_new(int64_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_OpenChannel_clone_ptr(int64_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; +} + +int64_t CS_LDK_OpenChannel_clone(int64_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); + int64_t ret_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 CS_LDK_OpenChannel_hash(int64_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 CS_LDK_OpenChannel_eq(int64_t a, int64_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 CS_LDK_OpenChannelV2_free(int64_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); +} + +int64_t CS_LDK_OpenChannelV2_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_OpenChannelV2_set_common_fields(int64_t this_ptr, int64_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 CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_get_locktime(int64_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 CS_LDK_OpenChannelV2_set_locktime(int64_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 CS_LDK_OpenChannelV2_get_second_per_commitment_point(int64_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 CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_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); +} + +int32_t CS_LDK_OpenChannelV2_get_require_confirmed_inputs(int64_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 = LDKCOption_NoneZ_to_cs(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_OpenChannelV2_set_require_confirmed_inputs(int64_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; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OpenChannelV2_new(int64_t common_fields_arg, int32_t funding_feerate_sat_per_1000_weight_arg, int32_t locktime_arg, int8_tArray second_per_commitment_point_arg, int32_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_cs(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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42726,183 +46446,168 @@ jboolean CS_LDK_OpenChannelV2_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_AcceptChannel_free(int64_t this_obj) { - LDKAcceptChannel this_obj_conv; +void CS_LDK_CommonAcceptChannelFields_free(int64_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 CS_LDK_AcceptChannel_get_temporary_channel_id(int64_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 CS_LDK_AcceptChannel_set_temporary_channel_id(int64_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 CS_LDK_AcceptChannel_get_dust_limit_satoshis(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_temporary_channel_id(int64_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); + int64_t ret_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 CS_LDK_AcceptChannel_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_temporary_channel_id(int64_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_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 CS_LDK_AcceptChannel_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannel_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannel_get_channel_reserve_satoshis(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannel_set_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannel_get_htlc_minimum_msat(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannel_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannel_get_minimum_depth(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int32_t CS_LDK_CommonAcceptChannelFields_get_minimum_depth(int64_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 CS_LDK_AcceptChannel_set_minimum_depth(int64_t this_ptr, int32_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_minimum_depth(int64_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 CS_LDK_AcceptChannel_get_to_self_delay(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t CS_LDK_CommonAcceptChannelFields_get_to_self_delay(int64_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 CS_LDK_AcceptChannel_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_to_self_delay(int64_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 CS_LDK_AcceptChannel_get_max_accepted_htlcs(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t CS_LDK_CommonAcceptChannelFields_get_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannel_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannel_get_funding_pubkey(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_funding_pubkey(int64_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 CS_LDK_AcceptChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_funding_pubkey(int64_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); @@ -42910,22 +46615,22 @@ void CS_LDK_AcceptChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) 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 CS_LDK_AcceptChannel_get_revocation_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_revocation_basepoint(int64_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 CS_LDK_AcceptChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_revocation_basepoint(int64_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); @@ -42933,22 +46638,22 @@ void CS_LDK_AcceptChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArra 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 CS_LDK_AcceptChannel_get_payment_point(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_payment_basepoint(int64_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 CS_LDK_AcceptChannel_set_payment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_payment_basepoint(int64_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); @@ -42956,22 +46661,22 @@ void CS_LDK_AcceptChannel_set_payment_point(int64_t this_ptr, int8_tArray val) 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 CS_LDK_AcceptChannel_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_delayed_payment_basepoint(int64_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 CS_LDK_AcceptChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_delayed_payment_basepoint(int64_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); @@ -42979,22 +46684,22 @@ void CS_LDK_AcceptChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_ 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 CS_LDK_AcceptChannel_get_htlc_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_htlc_basepoint(int64_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 CS_LDK_AcceptChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_htlc_basepoint(int64_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); @@ -43002,22 +46707,22 @@ void CS_LDK_AcceptChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) 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 CS_LDK_AcceptChannel_get_first_per_commitment_point(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_first_per_commitment_point(int64_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 CS_LDK_AcceptChannel_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_first_per_commitment_point(int64_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); @@ -43025,23 +46730,23 @@ void CS_LDK_AcceptChannel_set_first_per_commitment_point(int64_t this_ptr, int8 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); } -int64_t CS_LDK_AcceptChannel_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_shutdown_scriptpubkey(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_AcceptChannel_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_shutdown_scriptpubkey(int64_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); @@ -43050,24 +46755,24 @@ void CS_LDK_AcceptChannel_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t v 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); } -int64_t CS_LDK_AcceptChannel_get_channel_type(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_channel_type(int64_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); int64_t ret_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 CS_LDK_AcceptChannel_set_channel_type(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_channel_type(int64_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); @@ -43077,22 +46782,24 @@ void CS_LDK_AcceptChannel_set_channel_type(int64_t this_ptr, int64_t val) { 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); } -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_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); +int64_t CS_LDK_CommonAcceptChannelFields_new(int64_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, int64_t shutdown_scriptpubkey_arg, int64_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); @@ -43111,7 +46818,129 @@ int64_t CS_LDK_AcceptChannel_new(int8_tArray temporary_channel_id_arg, int64_t 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); + int64_t ret_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); + int64_t ret_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 CS_LDK_CommonAcceptChannelFields_clone_ptr(int64_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; +} + +int64_t CS_LDK_CommonAcceptChannelFields_clone(int64_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); + int64_t ret_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 CS_LDK_CommonAcceptChannelFields_hash(int64_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 CS_LDK_CommonAcceptChannelFields_eq(int64_t a, int64_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 CS_LDK_AcceptChannel_free(int64_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); +} + +int64_t CS_LDK_AcceptChannel_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_AcceptChannel_set_common_fields(int64_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; + 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 CS_LDK_AcceptChannel_get_channel_reserve_satoshis(int64_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 CS_LDK_AcceptChannel_set_channel_reserve_satoshis(int64_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); +} + +int64_t CS_LDK_AcceptChannel_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43181,27 +47010,31 @@ void CS_LDK_AcceptChannelV2_free(int64_t this_obj) { AcceptChannelV2_free(this_obj_conv); } -int8_tArray CS_LDK_AcceptChannelV2_get_temporary_channel_id(int64_t this_ptr) { +int64_t CS_LDK_AcceptChannelV2_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_AcceptChannelV2_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_AcceptChannelV2_set_common_fields(int64_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; - 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 CS_LDK_AcceptChannelV2_get_funding_satoshis(int64_t this_ptr) { @@ -43223,258 +47056,6 @@ void CS_LDK_AcceptChannelV2_set_funding_satoshis(int64_t this_ptr, int64_t val) AcceptChannelV2_set_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannelV2_get_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannelV2_set_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannelV2_get_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannelV2_set_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannelV2_get_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannelV2_set_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannelV2_get_minimum_depth(int64_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 CS_LDK_AcceptChannelV2_set_minimum_depth(int64_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 CS_LDK_AcceptChannelV2_get_to_self_delay(int64_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 CS_LDK_AcceptChannelV2_set_to_self_delay(int64_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 CS_LDK_AcceptChannelV2_get_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannelV2_set_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannelV2_get_funding_pubkey(int64_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 CS_LDK_AcceptChannelV2_set_funding_pubkey(int64_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 CS_LDK_AcceptChannelV2_get_revocation_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_revocation_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_delayed_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_delayed_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_htlc_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_htlc_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_first_per_commitment_point(int64_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 CS_LDK_AcceptChannelV2_set_first_per_commitment_point(int64_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 CS_LDK_AcceptChannelV2_get_second_per_commitment_point(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43498,58 +47079,6 @@ void CS_LDK_AcceptChannelV2_set_second_per_commitment_point(int64_t this_ptr, i AcceptChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_AcceptChannelV2_get_shutdown_scriptpubkey(int64_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); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_AcceptChannelV2_set_shutdown_scriptpubkey(int64_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; - 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); -} - -int64_t CS_LDK_AcceptChannelV2_get_channel_type(int64_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); - int64_t ret_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 CS_LDK_AcceptChannelV2_set_channel_type(int64_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; - 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); -} - int32_t CS_LDK_AcceptChannelV2_get_require_confirmed_inputs(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43570,42 +47099,17 @@ void CS_LDK_AcceptChannelV2_set_require_confirmed_inputs(int64_t this_ptr, int3 AcceptChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg, int32_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); +int64_t CS_LDK_AcceptChannelV2_new(int64_t common_fields_arg, int64_t funding_satoshis_arg, int8_tArray second_per_commitment_point_arg, int32_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_cs(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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43675,27 +47179,31 @@ void CS_LDK_FundingCreated_free(int64_t this_obj) { FundingCreated_free(this_obj_conv); } -int8_tArray CS_LDK_FundingCreated_get_temporary_channel_id(int64_t this_ptr) { +int64_t CS_LDK_FundingCreated_get_temporary_channel_id(int64_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); + int64_t ret_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 CS_LDK_FundingCreated_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_FundingCreated_set_temporary_channel_id(int64_t this_ptr, int64_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 CS_LDK_FundingCreated_get_funding_txid(int64_t this_ptr) { @@ -43763,17 +47271,19 @@ void CS_LDK_FundingCreated_set_signature(int64_t this_ptr, int8_tArray val) { FundingCreated_set_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_FundingCreated_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43843,27 +47353,31 @@ void CS_LDK_FundingSigned_free(int64_t this_obj) { FundingSigned_free(this_obj_conv); } -int8_tArray CS_LDK_FundingSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_FundingSigned_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_FundingSigned_get_signature(int64_t this_ptr) { @@ -43889,14 +47403,16 @@ void CS_LDK_FundingSigned_set_signature(int64_t this_ptr, int8_tArray val) { FundingSigned_set_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_FundingSigned_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43966,27 +47482,31 @@ void CS_LDK_ChannelReady_free(int64_t this_obj) { ChannelReady_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelReady_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelReady_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ChannelReady_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelReady_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ChannelReady_get_next_per_commitment_point(int64_t this_ptr) { @@ -44037,10 +47557,12 @@ void CS_LDK_ChannelReady_set_short_channel_id_alias(int64_t this_ptr, int64_t v ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_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); +int64_t CS_LDK_ChannelReady_new(int64_t channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_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); @@ -44048,7 +47570,7 @@ int64_t CS_LDK_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_pe 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44118,27 +47640,31 @@ void CS_LDK_Stfu_free(int64_t this_obj) { Stfu_free(this_obj_conv); } -int8_tArray CS_LDK_Stfu_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Stfu_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_Stfu_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Stfu_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_Stfu_get_initiator(int64_t this_ptr) { @@ -44160,11 +47686,13 @@ void CS_LDK_Stfu_set_initiator(int64_t this_ptr, int8_t val) { Stfu_set_initiator(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_Stfu_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44224,27 +47752,31 @@ void CS_LDK_Splice_free(int64_t this_obj) { Splice_free(this_obj_conv); } -int8_tArray CS_LDK_Splice_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Splice_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_Splice_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Splice_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_Splice_get_chain_hash(int64_t this_ptr) { @@ -44350,17 +47882,19 @@ void CS_LDK_Splice_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { Splice_set_funding_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_Splice_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44420,27 +47954,31 @@ void CS_LDK_SpliceAck_free(int64_t this_obj) { SpliceAck_free(this_obj_conv); } -int8_tArray CS_LDK_SpliceAck_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_SpliceAck_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_SpliceAck_get_chain_hash(int64_t this_ptr) { @@ -44508,17 +48046,19 @@ void CS_LDK_SpliceAck_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_SpliceAck_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44578,34 +48118,40 @@ void CS_LDK_SpliceLocked_free(int64_t this_obj) { SpliceLocked_free(this_obj_conv); } -int8_tArray CS_LDK_SpliceLocked_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_SpliceLocked_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int64_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); } -int64_t CS_LDK_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); +int64_t CS_LDK_SpliceLocked_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44665,27 +48211,31 @@ void CS_LDK_TxAddInput_free(int64_t this_obj) { TxAddInput_free(this_obj_conv); } -int8_tArray CS_LDK_TxAddInput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAddInput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAddInput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAddInput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxAddInput_get_serial_id(int64_t this_ptr) { @@ -44772,16 +48322,18 @@ void CS_LDK_TxAddInput_set_sequence(int64_t this_ptr, int32_t val) { TxAddInput_set_sequence(&this_ptr_conv, val); } -int64_t CS_LDK_TxAddInput_new(int8_tArray channel_id_arg, int64_t serial_id_arg, int64_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); +int64_t CS_LDK_TxAddInput_new(int64_t channel_id_arg, int64_t serial_id_arg, int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44851,27 +48403,31 @@ void CS_LDK_TxAddOutput_free(int64_t this_obj) { TxAddOutput_free(this_obj_conv); } -int8_tArray CS_LDK_TxAddOutput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAddOutput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAddOutput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAddOutput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxAddOutput_get_serial_id(int64_t this_ptr) { @@ -44938,15 +48494,17 @@ void CS_LDK_TxAddOutput_set_script(int64_t this_ptr, int8_tArray val) { TxAddOutput_set_script(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxAddOutput_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45016,27 +48574,31 @@ void CS_LDK_TxRemoveInput_free(int64_t this_obj) { TxRemoveInput_free(this_obj_conv); } -int8_tArray CS_LDK_TxRemoveInput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxRemoveInput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxRemoveInput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxRemoveInput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxRemoveInput_get_serial_id(int64_t this_ptr) { @@ -45058,11 +48620,13 @@ void CS_LDK_TxRemoveInput_set_serial_id(int64_t this_ptr, int64_t val) { TxRemoveInput_set_serial_id(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxRemoveInput_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45132,27 +48696,31 @@ void CS_LDK_TxRemoveOutput_free(int64_t this_obj) { TxRemoveOutput_free(this_obj_conv); } -int8_tArray CS_LDK_TxRemoveOutput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxRemoveOutput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxRemoveOutput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxRemoveOutput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxRemoveOutput_get_serial_id(int64_t this_ptr) { @@ -45174,11 +48742,13 @@ void CS_LDK_TxRemoveOutput_set_serial_id(int64_t this_ptr, int64_t val) { TxRemoveOutput_set_serial_id(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxRemoveOutput_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45248,34 +48818,40 @@ void CS_LDK_TxComplete_free(int64_t this_obj) { TxComplete_free(this_obj_conv); } -int8_tArray CS_LDK_TxComplete_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxComplete_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxComplete_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxComplete_set_channel_id(int64_t this_ptr, int64_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); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxComplete_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45345,27 +48921,31 @@ void CS_LDK_TxSignatures_free(int64_t this_obj) { TxSignatures_free(this_obj_conv); } -int8_tArray CS_LDK_TxSignatures_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxSignatures_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxSignatures_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxSignatures_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxSignatures_get_tx_hash(int64_t this_ptr) { @@ -45439,10 +49019,37 @@ void CS_LDK_TxSignatures_set_witnesses(int64_t this_ptr, ptrArray val) { TxSignatures_set_witnesses(&this_ptr_conv, val_constr); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxSignatures_get_funding_outpoint_sig(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TxSignatures_set_funding_outpoint_sig(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg, int64_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); @@ -45463,7 +49070,11 @@ int64_t CS_LDK_TxSignatures_new(int8_tArray channel_id_arg, int8_tArray tx_hash witnesses_arg_constr.data[i] = witnesses_arg_conv_8_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45533,27 +49144,31 @@ void CS_LDK_TxInitRbf_free(int64_t this_obj) { TxInitRbf_free(this_obj_conv); } -int8_tArray CS_LDK_TxInitRbf_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxInitRbf_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxInitRbf_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxInitRbf_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxInitRbf_get_locktime(int64_t this_ptr) { @@ -45619,15 +49234,17 @@ void CS_LDK_TxInitRbf_set_funding_output_contribution(int64_t this_ptr, int64_t TxInitRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxInitRbf_new(int8_tArray channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, int64_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); +int64_t CS_LDK_TxInitRbf_new(int64_t channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45697,27 +49314,31 @@ void CS_LDK_TxAckRbf_free(int64_t this_obj) { TxAckRbf_free(this_obj_conv); } -int8_tArray CS_LDK_TxAckRbf_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAckRbf_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAckRbf_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAckRbf_set_channel_id(int64_t this_ptr, int64_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); } int64_t CS_LDK_TxAckRbf_get_funding_output_contribution(int64_t this_ptr) { @@ -45745,15 +49366,17 @@ void CS_LDK_TxAckRbf_set_funding_output_contribution(int64_t this_ptr, int64_t TxAckRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxAckRbf_new(int8_tArray channel_id_arg, int64_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); +int64_t CS_LDK_TxAckRbf_new(int64_t channel_id_arg, int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45823,27 +49446,31 @@ void CS_LDK_TxAbort_free(int64_t this_obj) { TxAbort_free(this_obj_conv); } -int8_tArray CS_LDK_TxAbort_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAbort_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAbort_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAbort_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxAbort_get_data(int64_t this_ptr) { @@ -45872,15 +49499,17 @@ void CS_LDK_TxAbort_set_data(int64_t this_ptr, int8_tArray val) { TxAbort_set_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxAbort_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45950,27 +49579,31 @@ void CS_LDK_Shutdown_free(int64_t this_obj) { Shutdown_free(this_obj_conv); } -int8_tArray CS_LDK_Shutdown_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Shutdown_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_Shutdown_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Shutdown_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_Shutdown_get_scriptpubkey(int64_t this_ptr) { @@ -45999,15 +49632,17 @@ void CS_LDK_Shutdown_set_scriptpubkey(int64_t this_ptr, int8_tArray val) { Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_Shutdown_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46186,27 +49821,31 @@ void CS_LDK_ClosingSigned_free(int64_t this_obj) { ClosingSigned_free(this_obj_conv); } -int8_tArray CS_LDK_ClosingSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ClosingSigned_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ClosingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ClosingSigned_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ClosingSigned_get_fee_satoshis(int64_t this_ptr) { @@ -46278,10 +49917,12 @@ void CS_LDK_ClosingSigned_set_fee_range(int64_t this_ptr, int64_t val) { ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_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); +int64_t CS_LDK_ClosingSigned_new(int64_t channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_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); @@ -46290,7 +49931,7 @@ int64_t CS_LDK_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satosh 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46360,27 +50001,31 @@ void CS_LDK_UpdateAddHTLC_free(int64_t this_obj) { UpdateAddHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateAddHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateAddHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateAddHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateAddHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateAddHTLC_get_htlc_id(int64_t this_ptr) { @@ -46538,10 +50183,12 @@ void CS_LDK_UpdateAddHTLC_set_blinding_point(int64_t this_ptr, int8_tArray val) UpdateAddHTLC_set_blinding_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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, int64_t skimmed_fee_msat_arg, int64_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); +int64_t CS_LDK_UpdateAddHTLC_new(int64_t channel_id_arg, int64_t htlc_id_arg, int64_t amount_msat_arg, int8_tArray payment_hash_arg, int32_t cltv_expiry_arg, int64_t skimmed_fee_msat_arg, int64_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); @@ -46557,7 +50204,7 @@ int64_t CS_LDK_UpdateAddHTLC_new(int8_tArray channel_id_arg, int64_t htlc_id_ar 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46756,27 +50403,31 @@ void CS_LDK_UpdateFulfillHTLC_free(int64_t this_obj) { UpdateFulfillHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFulfillHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFulfillHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFulfillHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFulfillHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFulfillHTLC_get_htlc_id(int64_t this_ptr) { @@ -46821,14 +50472,16 @@ void CS_LDK_UpdateFulfillHTLC_set_payment_preimage(int64_t this_ptr, int8_tArra UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_UpdateFulfillHTLC_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46898,27 +50551,31 @@ void CS_LDK_UpdateFailHTLC_free(int64_t this_obj) { UpdateFailHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFailHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFailHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFailHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFailHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFailHTLC_get_htlc_id(int64_t this_ptr) { @@ -47003,27 +50660,31 @@ void CS_LDK_UpdateFailMalformedHTLC_free(int64_t this_obj) { UpdateFailMalformedHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFailMalformedHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFailMalformedHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFailMalformedHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFailMalformedHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFailMalformedHTLC_get_htlc_id(int64_t this_ptr) { @@ -47127,27 +50788,31 @@ void CS_LDK_CommitmentSigned_free(int64_t this_obj) { CommitmentSigned_free(this_obj_conv); } -int8_tArray CS_LDK_CommitmentSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_CommitmentSigned_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_CommitmentSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_CommitmentSigned_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_CommitmentSigned_get_signature(int64_t this_ptr) { @@ -47217,10 +50882,12 @@ void CS_LDK_CommitmentSigned_set_htlc_signatures(int64_t this_ptr, ptrArray val CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -int64_t CS_LDK_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); +int64_t CS_LDK_CommitmentSigned_new(int64_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); @@ -47239,7 +50906,7 @@ int64_t CS_LDK_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray sig htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47309,27 +50976,31 @@ void CS_LDK_RevokeAndACK_free(int64_t this_obj) { RevokeAndACK_free(this_obj_conv); } -int8_tArray CS_LDK_RevokeAndACK_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_RevokeAndACK_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_RevokeAndACK_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_RevokeAndACK_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_RevokeAndACK_get_per_commitment_secret(int64_t this_ptr) { @@ -47378,17 +51049,19 @@ void CS_LDK_RevokeAndACK_set_next_per_commitment_point(int64_t this_ptr, int8_t RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_RevokeAndACK_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47458,27 +51131,31 @@ void CS_LDK_UpdateFee_free(int64_t this_obj) { UpdateFee_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFee_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFee_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFee_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFee_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFee_get_feerate_per_kw(int64_t this_ptr) { @@ -47500,11 +51177,13 @@ void CS_LDK_UpdateFee_set_feerate_per_kw(int64_t this_ptr, int32_t val) { UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_UpdateFee_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47574,27 +51253,31 @@ void CS_LDK_ChannelReestablish_free(int64_t this_obj) { ChannelReestablish_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelReestablish_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelReestablish_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ChannelReestablish_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelReestablish_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ChannelReestablish_get_next_local_commitment_number(int64_t this_ptr) { @@ -47706,10 +51389,12 @@ void CS_LDK_ChannelReestablish_set_next_funding_txid(int64_t this_ptr, int64_t ChannelReestablish_set_next_funding_txid(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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, int64_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); +int64_t CS_LDK_ChannelReestablish_new(int64_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, int64_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); @@ -47720,7 +51405,7 @@ int64_t CS_LDK_ChannelReestablish_new(int8_tArray channel_id_arg, int64_t next_ 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47790,27 +51475,31 @@ void CS_LDK_AnnouncementSignatures_free(int64_t this_obj) { AnnouncementSignatures_free(this_obj_conv); } -int8_tArray CS_LDK_AnnouncementSignatures_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_AnnouncementSignatures_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_AnnouncementSignatures_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_AnnouncementSignatures_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_AnnouncementSignatures_get_short_channel_id(int64_t this_ptr) { @@ -47878,17 +51567,19 @@ void CS_LDK_AnnouncementSignatures_set_bitcoin_signature(int64_t this_ptr, int8 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_AnnouncementSignatures_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -48375,6 +52066,107 @@ void CS_LDK_UnsignedNodeAnnouncement_set_addresses(int64_t this_ptr, int64_tArr UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +int8_tArray CS_LDK_UnsignedNodeAnnouncement_get_excess_address_data(int64_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 CS_LDK_UnsignedNodeAnnouncement_set_excess_address_data(int64_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 CS_LDK_UnsignedNodeAnnouncement_get_excess_data(int64_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 CS_LDK_UnsignedNodeAnnouncement_set_excess_data(int64_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); +} + +int64_t CS_LDK_UnsignedNodeAnnouncement_new(int64_t features_arg, int32_t timestamp_arg, int64_t node_id_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_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; + int64_t* addresses_arg_vals = addresses_arg->elems; + for (size_t p = 0; p < addresses_arg_constr.datalen; p++) { + int64_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); + int64_t ret_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); int64_t ret_ref = 0; @@ -51067,6 +54859,191 @@ jboolean CS_LDK_OnionPacket_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_TrampolineOnionPacket_free(int64_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 CS_LDK_TrampolineOnionPacket_get_version(int64_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 CS_LDK_TrampolineOnionPacket_set_version(int64_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 CS_LDK_TrampolineOnionPacket_get_public_key(int64_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 CS_LDK_TrampolineOnionPacket_set_public_key(int64_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 CS_LDK_TrampolineOnionPacket_get_hop_data(int64_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 CS_LDK_TrampolineOnionPacket_set_hop_data(int64_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 CS_LDK_TrampolineOnionPacket_get_hmac(int64_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 CS_LDK_TrampolineOnionPacket_set_hmac(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_TrampolineOnionPacket_clone_ptr(int64_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; +} + +int64_t CS_LDK_TrampolineOnionPacket_clone(int64_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); + int64_t ret_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 CS_LDK_TrampolineOnionPacket_hash(int64_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 CS_LDK_TrampolineOnionPacket_eq(int64_t a, int64_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 CS_LDK_TrampolineOnionPacket_write(int64_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; +} + int8_tArray CS_LDK_AcceptChannel_write(int64_t obj) { LDKAcceptChannel obj_conv; obj_conv.inner = untag_ptr(obj); @@ -52584,6 +56561,127 @@ void CS_LDK_SocketDescriptor_free(int64_t this_ptr) { SocketDescriptor_free(this_ptr_conv); } +void CS_LDK_PeerDetails_free(int64_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 CS_LDK_PeerDetails_get_counterparty_node_id(int64_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 CS_LDK_PeerDetails_set_counterparty_node_id(int64_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); +} + +int64_t CS_LDK_PeerDetails_get_socket_address(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PeerDetails_set_socket_address(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_PeerDetails_get_init_features(int64_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); + int64_t ret_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 CS_LDK_PeerDetails_set_init_features(int64_t this_ptr, int64_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 CS_LDK_PeerDetails_get_is_inbound_connection(int64_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 CS_LDK_PeerDetails_set_is_inbound_connection(int64_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); +} + +int64_t CS_LDK_PeerDetails_new(int8_tArray counterparty_node_id_arg, int64_t socket_address_arg, int64_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); + int64_t ret_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 CS_LDK_PeerHandleError_free(int64_t this_obj) { LDKPeerHandleError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52670,26 +56768,44 @@ int64_t CS_LDK_PeerManager_new(int64_t message_handler, int32_t current_time, i return ret_ref; } -int64_tArray CS_LDK_PeerManager_get_peer_node_ids(int64_t this_arg) { +int64_tArray CS_LDK_PeerManager_list_peers(int64_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); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t 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]; + int64_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; } +int64_t CS_LDK_PeerManager_peer_by_node_id(int64_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); + int64_t ret_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 CS_LDK_PeerManager_new_outbound_connection(int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { LDKPeerManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -58522,6 +62638,120 @@ jboolean CS_LDK_NodeFeatures_requires_keysend(int64_t this_arg) { return ret_conv; } +void CS_LDK_InitFeatures_set_trampoline_routing_optional(int64_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 CS_LDK_InitFeatures_set_trampoline_routing_required(int64_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 CS_LDK_InitFeatures_supports_trampoline_routing(int64_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 CS_LDK_NodeFeatures_set_trampoline_routing_optional(int64_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 CS_LDK_NodeFeatures_set_trampoline_routing_required(int64_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 CS_LDK_NodeFeatures_supports_trampoline_routing(int64_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 CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_optional(int64_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 CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_required(int64_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 CS_LDK_Bolt11InvoiceFeatures_supports_trampoline_routing(int64_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 CS_LDK_InitFeatures_requires_trampoline_routing(int64_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 CS_LDK_NodeFeatures_requires_trampoline_routing(int64_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 CS_LDK_Bolt11InvoiceFeatures_requires_trampoline_routing(int64_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 CS_LDK_ShutdownScript_free(int64_t this_obj) { LDKShutdownScript this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -58747,6 +62977,222 @@ jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features return ret_conv; } +void CS_LDK_ChannelId_free(int64_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 CS_LDK_ChannelId_get_a(int64_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 CS_LDK_ChannelId_set_a(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_ChannelId_clone_ptr(int64_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; +} + +int64_t CS_LDK_ChannelId_clone(int64_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); + int64_t ret_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 CS_LDK_ChannelId_eq(int64_t a, int64_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 CS_LDK_ChannelId_hash(int64_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; +} + +int64_t CS_LDK_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); + int64_t ret_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 CS_LDK_ChannelId_v1_from_funding_outpoint(int64_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); + int64_t ret_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 CS_LDK_ChannelId_temporary_from_entropy_source(int64_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); + int64_t ret_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 CS_LDK_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); + int64_t ret_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 CS_LDK_ChannelId_new_zero() { + LDKChannelId ret_var = ChannelId_new_zero(); + int64_t ret_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 CS_LDK_ChannelId_is_zero(int64_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; +} + +int64_t CS_LDK_ChannelId_v2_from_revocation_basepoints(int64_t ours, int64_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); + int64_t ret_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 CS_LDK_ChannelId_temporary_v2_from_revocation_basepoint(int64_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); + int64_t ret_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 CS_LDK_ChannelId_write(int64_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; +} + +int64_t CS_LDK_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); +} + void CS_LDK_Retry_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -59266,6 +63712,413 @@ void CS_LDK_Type_free(int64_t this_ptr) { Type_free(this_ptr_conv); } +void CS_LDK_OfferId_free(int64_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 CS_LDK_OfferId_get_a(int64_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 CS_LDK_OfferId_set_a(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_OfferId_clone_ptr(int64_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; +} + +int64_t CS_LDK_OfferId_clone(int64_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); + int64_t ret_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 CS_LDK_OfferId_eq(int64_t a, int64_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 CS_LDK_OfferId_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_OfferWithExplicitMetadataBuilder_free(int64_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); + int64_t ret_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 CS_LDK_OfferWithExplicitMetadataBuilder_clone_ptr(int64_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; +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_clone(int64_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); + int64_t ret_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 CS_LDK_OfferWithDerivedMetadataBuilder_free(int64_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); + int64_t ret_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 CS_LDK_OfferWithDerivedMetadataBuilder_clone_ptr(int64_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; +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_clone(int64_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); + int64_t ret_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 CS_LDK_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); + int64_t ret_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 CS_LDK_OfferWithExplicitMetadataBuilder_metadata(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_chain(int64_t this_arg, int32_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_cs(network); + OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_amount_msats(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_absolute_expiry(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_description(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_issuer(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_path(int64_t this_arg, int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_supported_quantity(int64_t this_arg, int64_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); +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_build(int64_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); +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(int8_tArray node_id, int64_t expanded_key, int64_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); + int64_t ret_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 CS_LDK_OfferWithDerivedMetadataBuilder_chain(int64_t this_arg, int32_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_cs(network); + OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_amount_msats(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_absolute_expiry(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_description(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_issuer(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_path(int64_t this_arg, int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_supported_quantity(int64_t this_arg, int64_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); +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_build(int64_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 CS_LDK_Offer_free(int64_t this_obj) { LDKOffer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -59342,10 +64195,9 @@ int64_t CS_LDK_Offer_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59428,10 +64280,9 @@ int64_t CS_LDK_Offer_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59446,6 +64297,19 @@ int8_tArray CS_LDK_Offer_signing_pubkey(int64_t this_arg) { return ret_arr; } +int64_t CS_LDK_Offer_id(int64_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); + int64_t ret_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 CS_LDK_Offer_supports_chain(int64_t this_arg, int8_tArray chain) { LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -59499,6 +64363,89 @@ jboolean CS_LDK_Offer_expects_quantity(int64_t this_arg) { return ret_conv; } +int64_t CS_LDK_Offer_request_invoice_deriving_payer_id(int64_t this_arg, int64_t expanded_key, int64_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); +} + +int64_t CS_LDK_Offer_request_invoice_deriving_metadata(int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_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); +} + +int64_t CS_LDK_Offer_request_invoice(int64_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 CS_LDK_Offer_hash(int64_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 CS_LDK_Offer_write(int64_t obj) { LDKOffer obj_conv; obj_conv.inner = untag_ptr(obj); @@ -59512,95 +64459,316 @@ int8_tArray CS_LDK_Offer_write(int64_t obj) { return ret_arr; } -void CS_LDK_Amount_free(int64_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 CS_LDK_Amount_free(int64_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } int64_t CS_LDK_Amount_clone_ptr(int64_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; } int64_t CS_LDK_Amount_clone(int64_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Amount_bitcoin(int64_t amount_msats) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_bitcoin(amount_msats); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_Quantity_free(int64_t this_obj) { - LDKQuantity this_obj_conv; +void CS_LDK_Quantity_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Quantity_clone_ptr(int64_t arg) { + LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); + int64_t ret_conv = Quantity_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Quantity_clone(int64_t orig) { + LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_bounded(int64_t a) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_bounded(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_unbounded() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_unbounded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_one() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_one(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_free(int64_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); +} + +int64_t CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_build(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(int64_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); +} + +int64_t CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(int64_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 CS_LDK_UnsignedBolt12Invoice_free(int64_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); int64_t ret_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 CS_LDK_Quantity_clone_ptr(int64_t arg) { - LDKQuantity arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_clone_ptr(int64_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; } -int64_t CS_LDK_Quantity_clone(int64_t orig) { - LDKQuantity orig_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_clone(int64_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); int64_t ret_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 CS_LDK_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 CS_LDK_UnsignedBolt12Invoice_free(int64_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 CS_LDK_SignBolt12InvoiceFn_free(int64_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); } int64_t CS_LDK_UnsignedBolt12Invoice_tagged_hash(int64_t this_arg) { @@ -59695,10 +64863,9 @@ int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59781,10 +64948,9 @@ int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59965,10 +65131,9 @@ int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60051,10 +65216,9 @@ int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60232,6 +65396,16 @@ int64_t CS_LDK_Bolt12Invoice_verify(int64_t this_arg, int64_t key) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_Bolt12Invoice_hash(int64_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 CS_LDK_UnsignedBolt12Invoice_write(int64_t obj) { LDKUnsignedBolt12Invoice obj_conv; obj_conv.inner = untag_ptr(obj); @@ -60715,6 +65889,142 @@ int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +void CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_free(int64_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 CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_free(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_build(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_chain(int64_t this_arg, int32_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_cs(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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_quantity(int64_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 CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_payer_note(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_chain(int64_t this_arg, int32_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_cs(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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_quantity(int64_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 CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_payer_note(int64_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 CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { LDKUnsignedInvoiceRequest this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -60723,6 +66033,45 @@ void CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { UnsignedInvoiceRequest_free(this_obj_conv); } +static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); + int64_t ret_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 CS_LDK_UnsignedInvoiceRequest_clone_ptr(int64_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; +} + +int64_t CS_LDK_UnsignedInvoiceRequest_clone(int64_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); + int64_t ret_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 CS_LDK_SignInvoiceRequestFn_free(int64_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); +} + int64_t CS_LDK_UnsignedInvoiceRequest_tagged_hash(int64_t this_arg) { LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -60782,6 +66131,33 @@ void CS_LDK_VerifiedInvoiceRequest_free(int64_t this_obj) { VerifiedInvoiceRequest_free(this_obj_conv); } +int64_t CS_LDK_VerifiedInvoiceRequest_get_offer_id(int64_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); + int64_t ret_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 CS_LDK_VerifiedInvoiceRequest_set_offer_id(int64_t this_ptr, int64_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); +} + int64_t CS_LDK_VerifiedInvoiceRequest_get_keys(int64_t this_ptr) { LDKVerifiedInvoiceRequest this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -60875,10 +66251,9 @@ int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60961,10 +66336,9 @@ int64_t CS_LDK_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61101,10 +66475,9 @@ int64_t CS_LDK_InvoiceRequest_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61187,10 +66560,9 @@ int64_t CS_LDK_InvoiceRequest_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61289,15 +66661,64 @@ int64_t CS_LDK_InvoiceRequest_payer_note(int64_t this_arg) { return ret_ref; } -int8_tArray CS_LDK_InvoiceRequest_signature(int64_t this_arg) { +int64_t CS_LDK_InvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequest_respond_with_no_std(int64_t this_arg, int64_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; + 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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); } int64_t CS_LDK_InvoiceRequest_verify(int64_t this_arg, int64_t key) { @@ -61316,6 +66737,17 @@ int64_t CS_LDK_InvoiceRequest_verify(int64_t this_arg, int64_t key) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_InvoiceRequest_signature(int64_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 CS_LDK_VerifiedInvoiceRequest_chains(int64_t this_arg) { LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -61354,10 +66786,9 @@ int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61440,10 +66871,9 @@ int64_t CS_LDK_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61542,6 +66972,126 @@ int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_VerifiedInvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_with_no_std(int64_t this_arg, int64_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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t this_arg, int64_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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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 CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); @@ -61568,6 +67118,177 @@ int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { return ret_arr; } +void CS_LDK_InvoiceRequestFields_free(int64_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 CS_LDK_InvoiceRequestFields_get_payer_id(int64_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 CS_LDK_InvoiceRequestFields_set_payer_id(int64_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); +} + +int64_t CS_LDK_InvoiceRequestFields_get_quantity(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_InvoiceRequestFields_set_quantity(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_InvoiceRequestFields_get_payer_note_truncated(int64_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); + int64_t ret_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 CS_LDK_InvoiceRequestFields_set_payer_note_truncated(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_InvoiceRequestFields_new(int8_tArray payer_id_arg, int64_t quantity_arg, int64_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_InvoiceRequestFields_clone_ptr(int64_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; +} + +int64_t CS_LDK_InvoiceRequestFields_clone(int64_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); + int64_t ret_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 CS_LDK_InvoiceRequestFields_eq(int64_t a, int64_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 CS_LDK_InvoiceRequestFields_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_TaggedHash_free(int64_t this_obj) { LDKTaggedHash this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -61640,6 +67361,50 @@ int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { return ret_arr; } +void CS_LDK_SignError_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SignError_clone_ptr(int64_t arg) { + LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); + int64_t ret_conv = SignError_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SignError_clone(int64_t orig) { + LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SignError_signing() { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_signing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SignError_verification(int32_t a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_verification(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { LDKBolt12ParseError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -61799,6 +67564,11 @@ int32_t CS_LDK_Bolt12SemanticError_missing_paths() { return ret_conv; } +int32_t CS_LDK_Bolt12SemanticError_unexpected_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); + return ret_conv; +} + int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); return ret_conv; @@ -61819,6 +67589,164 @@ int32_t CS_LDK_Bolt12SemanticError_missing_signature() { return ret_conv; } +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_free(int64_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); + int64_t ret_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone_ptr(int64_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; +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone(int64_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); + int64_t ret_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 CS_LDK_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); +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(int8_tArray node_id, int64_t expanded_key, int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_description(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_issuer(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_path(int64_t this_arg, int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_chain(int64_t this_arg, int32_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_cs(network); + RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_quantity(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_payer_note(int64_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); +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_build(int64_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 CS_LDK_Refund_free(int64_t this_obj) { LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -62019,6 +67947,16 @@ int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_Refund_hash(int64_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 CS_LDK_Refund_write(int64_t obj) { LDKRefund obj_conv; obj_conv.inner = untag_ptr(obj); @@ -62250,6 +68188,16 @@ int64_t CS_LDK_NodeId_from_pubkey(int8_tArray pubkey) { return ret_ref; } +int64_t CS_LDK_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 CS_LDK_NodeId_as_slice(int64_t this_arg) { LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63123,6 +69071,32 @@ int64_t CS_LDK_DirectedChannelInfo_effective_capacity(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_DirectedChannelInfo_source(int64_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); + int64_t ret_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 CS_LDK_DirectedChannelInfo_target(int64_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); + int64_t ret_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 CS_LDK_EffectiveCapacity_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -63843,6 +69817,16 @@ jboolean CS_LDK_NodeInfo_eq(int64_t a, int64_t b) { return ret_conv; } +jboolean CS_LDK_NodeInfo_is_tor_only(int64_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; +} + int8_tArray CS_LDK_NodeInfo_write(int64_t obj) { LDKNodeInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -67999,7 +73983,34 @@ void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(int64_t t DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(int64_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); + int64_t ret_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 CS_LDK_DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_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); @@ -68020,7 +74031,12 @@ int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tA 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -68704,6 +74720,29 @@ void CS_LDK_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } +int8_tArray CS_LDK_HTLCDescriptor_get_commitment_txid(int64_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 CS_LDK_HTLCDescriptor_set_commitment_txid(int64_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 CS_LDK_HTLCDescriptor_get_per_commitment_number(int64_t this_ptr) { LDKHTLCDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -68840,6 +74879,37 @@ void CS_LDK_HTLCDescriptor_set_counterparty_sig(int64_t this_ptr, int8_tArray v HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); } +int64_t CS_LDK_HTLCDescriptor_new(int64_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, int64_t htlc_arg, int64_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); + int64_t ret_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); int64_t ret_ref = 0; @@ -69044,6 +75114,15 @@ void CS_LDK_NodeSigner_free(int64_t this_ptr) { NodeSigner_free(this_ptr_conv); } +void CS_LDK_OutputSpender_free(int64_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 CS_LDK_SignerProvider_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -69053,6 +75132,15 @@ void CS_LDK_SignerProvider_free(int64_t this_ptr) { SignerProvider_free(this_ptr_conv); } +void CS_LDK_ChangeDestinationSource_free(int64_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 CS_LDK_InMemorySigner_free(int64_t this_obj) { LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -69544,76 +75632,36 @@ int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_ return tag_ptr(ret_conv, true); } -int64_t CS_LDK_KeysManager_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { +int64_t CS_LDK_KeysManager_as_EntropySource(int64_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; - int64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_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; - int64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_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); } -int64_t CS_LDK_KeysManager_as_EntropySource(int64_t this_arg) { +int64_t CS_LDK_KeysManager_as_NodeSigner(int64_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); } -int64_t CS_LDK_KeysManager_as_NodeSigner(int64_t this_arg) { +int64_t CS_LDK_KeysManager_as_OutputSpender(int64_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); } @@ -69658,6 +75706,17 @@ int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_PhantomKeysManager_as_OutputSpender(int64_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); +} + int64_t CS_LDK_PhantomKeysManager_as_SignerProvider(int64_t this_arg) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -69685,57 +75744,6 @@ int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_s return ret_ref; } -int64_t CS_LDK_PhantomKeysManager_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_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; - int64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_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; - int64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_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); -} - int64_t CS_LDK_PhantomKeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -69775,6 +75783,36 @@ int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(int64_t this_ return ret_arr; } +void CS_LDK_RandomBytes_free(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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 CS_LDK_RandomBytes_as_EntropySource(int64_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 CS_LDK_EcdsaChannelSigner_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -70095,6 +76133,29 @@ int64_t CS_LDK_Destination_blinded_path(int64_t a) { return ret_ref; } +int64_t CS_LDK_Destination_hash(int64_t o) { + LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); + int64_t ret_conv = Destination_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_Destination_eq(int64_t a, int64_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 CS_LDK_Destination_resolve(int64_t this_arg, int64_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 CS_LDK_SendSuccess_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -70141,6 +76202,12 @@ int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { return ret_ref; } +int64_t CS_LDK_SendSuccess_hash(int64_t o) { + LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); + int64_t ret_conv = SendSuccess_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SendSuccess_eq(int64_t a, int64_t b) { LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); @@ -70237,6 +76304,13 @@ int64_t CS_LDK_SendError_get_node_id_failed() { return ret_ref; } +int64_t CS_LDK_SendError_unresolved_introduction_node() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_unresolved_introduction_node(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_SendError_blinded_path_advance_failed() { LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); *ret_copy = SendError_blinded_path_advance_failed(); @@ -70244,6 +76318,12 @@ int64_t CS_LDK_SendError_blinded_path_advance_failed() { return ret_ref; } +int64_t CS_LDK_SendError_hash(int64_t o) { + LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); + int64_t ret_conv = SendError_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SendError_eq(int64_t a, int64_t b) { LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); @@ -70289,17 +76369,18 @@ int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_PeeledOnion_forward(int8_tArray a, int64_t b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); +int64_t CS_LDK_PeeledOnion_forward(int64_t a, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -70323,13 +76404,53 @@ int64_t CS_LDK_PeeledOnion_receive(int64_t a, int8_tArray b, int64_t c) { return ret_ref; } -int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer, int64_t path, int64_t contents, int64_t reply_path) { +int64_t CS_LDK_create_onion_message_resolving_destination(int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_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); +} + +int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_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); @@ -70348,7 +76469,7 @@ int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer 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); } @@ -70384,7 +76505,7 @@ int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t log return tag_ptr(ret_conv, true); } -int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { +int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { void* entropy_source_ptr = untag_ptr(entropy_source); CHECK_ACCESS(entropy_source_ptr); LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); @@ -70406,6 +76527,13 @@ int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, // 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); @@ -70427,7 +76555,7 @@ int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, // 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -70866,6 +76994,65 @@ void CS_LDK_OnionMessageContents_free(int64_t this_ptr) { OnionMessageContents_free(this_ptr_conv); } +void CS_LDK_NextMessageHop_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_NextMessageHop_clone_ptr(int64_t arg) { + LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); + int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_NextMessageHop_clone(int64_t orig) { + LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_short_channel_id(int64_t a) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_short_channel_id(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_hash(int64_t o) { + LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); + int64_t ret_conv = NextMessageHop_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_NextMessageHop_eq(int64_t a, int64_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 CS_LDK_BlindedPath_free(int64_t this_obj) { LDKBlindedPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -70874,27 +77061,29 @@ void CS_LDK_BlindedPath_free(int64_t this_obj) { BlindedPath_free(this_obj_conv); } -int8_tArray CS_LDK_BlindedPath_get_introduction_node_id(int64_t this_ptr) { +int64_t CS_LDK_BlindedPath_get_introduction_node(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedPath_set_introduction_node_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_BlindedPath_set_introduction_node(int64_t this_ptr, int64_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 CS_LDK_BlindedPath_get_blinding_point(int64_t this_ptr) { @@ -70968,10 +77157,11 @@ void CS_LDK_BlindedPath_set_blinded_hops(int64_t this_ptr, int64_tArray val) { BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); } -int64_t CS_LDK_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArray blinding_point_arg, int64_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); +int64_t CS_LDK_BlindedPath_new(int64_t introduction_node_arg, int8_tArray blinding_point_arg, int64_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); @@ -70992,7 +77182,7 @@ int64_t CS_LDK_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArra 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -71054,6 +77244,131 @@ jboolean CS_LDK_BlindedPath_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_IntroductionNode_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_IntroductionNode_clone_ptr(int64_t arg) { + LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); + int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_IntroductionNode_clone(int64_t orig) { + LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_directed_short_channel_id(int32_t a, int64_t b) { + LDKDirection a_conv = LDKDirection_from_cs(a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_hash(int64_t o) { + LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); + int64_t ret_conv = IntroductionNode_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_IntroductionNode_eq(int64_t a, int64_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; +} + +int32_t CS_LDK_Direction_clone(int64_t orig) { + LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); + int32_t ret_conv = LDKDirection_to_cs(Direction_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_Direction_node_one() { + int32_t ret_conv = LDKDirection_to_cs(Direction_node_one()); + return ret_conv; +} + +int32_t CS_LDK_Direction_node_two() { + int32_t ret_conv = LDKDirection_to_cs(Direction_node_two()); + return ret_conv; +} + +int64_t CS_LDK_Direction_hash(int64_t o) { + LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); + int64_t ret_conv = Direction_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_Direction_eq(int64_t a, int64_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 CS_LDK_NodeIdLookUp_free(int64_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 CS_LDK_EmptyNodeIdLookUp_free(int64_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); +} + +int64_t CS_LDK_EmptyNodeIdLookUp_new() { + LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); + int64_t ret_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 CS_LDK_EmptyNodeIdLookUp_as_NodeIdLookUp(int64_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 CS_LDK_BlindedHop_free(int64_t this_obj) { LDKBlindedHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -71186,8 +77501,12 @@ int64_t CS_LDK_BlindedPath_one_hop_for_message(int8_tArray recipient_node_id, i 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); @@ -71210,14 +77529,18 @@ int64_t CS_LDK_BlindedPath_new_for_message(ptrArray node_pks, int64_t entropy_s } 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); } -int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64_t payee_tlvs, int64_t entropy_source) { +int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_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); @@ -71227,14 +77550,18 @@ int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64 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); } -int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int64_t entropy_source) { +int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { LDKCVec_ForwardNodeZ intermediate_nodes_constr; intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; if (intermediate_nodes_constr.datalen > 0) @@ -71261,13 +77588,35 @@ int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int 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); } +int64_t CS_LDK_BlindedPath_public_introduction_node_id(int64_t this_arg, int64_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); + int64_t ret_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 CS_LDK_BlindedPath_write(int64_t obj) { LDKBlindedPath obj_conv; obj_conv.inner = untag_ptr(obj); @@ -71656,7 +78005,32 @@ void CS_LDK_ReceiveTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_constraints_arg) { +int64_t CS_LDK_ReceiveTlvs_get_payment_context(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_ReceiveTlvs_set_payment_context(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_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); @@ -71665,7 +78039,11 @@ int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_ 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -71889,6 +78267,317 @@ int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { return ret_ref; } +void CS_LDK_PaymentContext_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PaymentContext_clone_ptr(int64_t arg) { + LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); + int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentContext_clone(int64_t orig) { + LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_unknown(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_bolt12_offer(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_bolt12_refund(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_PaymentContext_eq(int64_t a, int64_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 CS_LDK_UnknownPaymentContext_free(int64_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); + int64_t ret_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 CS_LDK_UnknownPaymentContext_clone_ptr(int64_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; +} + +int64_t CS_LDK_UnknownPaymentContext_clone(int64_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); + int64_t ret_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 CS_LDK_UnknownPaymentContext_eq(int64_t a, int64_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 CS_LDK_Bolt12OfferContext_free(int64_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); +} + +int64_t CS_LDK_Bolt12OfferContext_get_offer_id(int64_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_set_offer_id(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_Bolt12OfferContext_get_invoice_request(int64_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_set_invoice_request(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_Bolt12OfferContext_new(int64_t offer_id_arg, int64_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_clone_ptr(int64_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; +} + +int64_t CS_LDK_Bolt12OfferContext_clone(int64_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_eq(int64_t a, int64_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 CS_LDK_Bolt12RefundContext_free(int64_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); +} + +int64_t CS_LDK_Bolt12RefundContext_new() { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); + int64_t ret_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); + int64_t ret_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 CS_LDK_Bolt12RefundContext_clone_ptr(int64_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; +} + +int64_t CS_LDK_Bolt12RefundContext_clone(int64_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); + int64_t ret_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 CS_LDK_Bolt12RefundContext_eq(int64_t a, int64_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 CS_LDK_ForwardTlvs_write(int64_t obj) { LDKForwardTlvs obj_conv; obj_conv.inner = untag_ptr(obj); @@ -71961,6 +78650,94 @@ int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_PaymentContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_UnknownPaymentContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_Bolt12OfferContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_Bolt12RefundContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_PaymentPurpose_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -71990,7 +78767,21 @@ int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_PaymentPurpose_invoice_payment(int64_t payment_preimage, int8_tArray payment_secret) { +int64_t CS_LDK_PaymentPurpose_bolt11_invoice_payment(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentPurpose_bolt12_offer_payment(int64_t payment_preimage, int8_tArray payment_secret, int64_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); @@ -71998,8 +78789,32 @@ int64_t CS_LDK_PaymentPurpose_invoice_payment(int64_t payment_preimage, int8_tA 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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentPurpose_bolt12_refund_payment(int64_t payment_preimage, int8_tArray payment_secret, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72056,27 +78871,31 @@ void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { ClaimedHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_ClaimedHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ClaimedHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ClaimedHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ClaimedHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ClaimedHTLC_get_user_channel_id(int64_t this_ptr) { @@ -72159,14 +78978,16 @@ void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(int64_t this_ptr, int ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_ClaimedHTLC_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -72366,9 +79187,23 @@ int64_t CS_LDK_ClosureReason_holder_force_closed() { return ret_ref; } -int64_t CS_LDK_ClosureReason_cooperative_closure() { +int64_t CS_LDK_ClosureReason_legacy_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_legacy_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_cooperative_closure(); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ClosureReason_locally_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72423,6 +79258,13 @@ int64_t CS_LDK_ClosureReason_funding_batch_closure() { return ret_ref; } +int64_t CS_LDK_ClosureReason_htlcs_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_htlcs_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); @@ -72478,15 +79320,17 @@ int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) { +int64_t CS_LDK_HTLCDestination_next_hop_channel(int8_tArray node_id, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72505,6 +79349,13 @@ int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) return ret_ref; } +int64_t CS_LDK_HTLCDestination_invalid_onion() { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_onion(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); @@ -72632,10 +79483,12 @@ int64_t CS_LDK_Event_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_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); +int64_t CS_LDK_Event_funding_generation_ready(int64_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); @@ -72647,7 +79500,7 @@ int64_t CS_LDK_Event_funding_generation_ready(int8_tArray temporary_channel_id, 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72668,10 +79521,11 @@ int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArra 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); @@ -72920,50 +79774,68 @@ int64_t CS_LDK_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_payment_forwarded(int64_t prev_channel_id, int64_t next_channel_id, int64_t fee_earned_msat, jboolean claim_from_onchain_tx, int64_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)); +int64_t CS_LDK_Event_payment_forwarded(int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_pending(int8_tArray channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_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); +int64_t CS_LDK_Event_channel_pending(int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_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); @@ -72972,16 +79844,23 @@ int64_t CS_LDK_Event_channel_pending(int8_tArray channel_id, int8_tArray user_c 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_ready(int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_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); +int64_t CS_LDK_Event_channel_ready(int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_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); @@ -72994,15 +79873,17 @@ int64_t CS_LDK_Event_channel_ready(int8_tArray channel_id, int8_tArray user_cha 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_closed(int8_tArray channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_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); +int64_t CS_LDK_Event_channel_closed(int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_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); @@ -73023,30 +79904,34 @@ int64_t CS_LDK_Event_channel_closed(int8_tArray channel_id, int8_tArray user_ch 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_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); +int64_t CS_LDK_Event_discard_funding(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_open_channel_request(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_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); +int64_t CS_LDK_Event_open_channel_request(int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_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); @@ -73056,21 +79941,23 @@ int64_t CS_LDK_Event_open_channel_request(int8_tArray temporary_channel_id, int 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_htlchandling_failed(int8_tArray prev_channel_id, int64_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); +int64_t CS_LDK_Event_htlchandling_failed(int64_t prev_channel_id, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -73927,7 +80814,15 @@ int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_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, int64_t anchor_descriptor, int64_tArray pending_htlcs) { +int64_t CS_LDK_BumpTransactionEvent_channel_close(int64_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, int64_t anchor_descriptor, int64_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); @@ -73959,12 +80854,20 @@ int64_t CS_LDK_BumpTransactionEvent_channel_close(int8_tArray claim_id, int32_t } 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { +int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_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); @@ -73986,7 +80889,7 @@ int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_ } 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -76432,6 +83335,17 @@ int8_tArray CS_LDK_Bolt11Invoice_recover_payee_pub_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_Bolt11Invoice_get_payee_pub_key(int64_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; +} + int64_t CS_LDK_Bolt11Invoice_expires_at(int64_t this_arg) { LDKBolt11Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); diff --git a/c_sharp/bindings.c.body b/c_sharp/bindings.c.body index 6eea9029..172f27f3 100644 --- a/c_sharp/bindings.c.body +++ b/c_sharp/bindings.c.body @@ -221,6 +221,13 @@ int CS_LDK_register_l_lllb_invoker(invoker_l_lllb invoker) { return 0; } +typedef int64_t (*invoker_l_lllil)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c, int32_t d, int64_t e); +static invoker_l_lllil js_invoke_function_l_lllil; +int CS_LDK_register_l_lllil_invoker(invoker_l_lllil invoker) { + js_invoke_function_l_lllil = invoker; + return 0; +} + typedef int32_t (*invoker_ChannelMonitorUpdateStatus_lll)(int obj_ptr, int fn_id, int64_t a, int64_t b, int64_t c); static invoker_ChannelMonitorUpdateStatus_lll js_invoke_function_ChannelMonitorUpdateStatus_lll; int CS_LDK_register_ChannelMonitorUpdateStatus_lll_invoker(invoker_ChannelMonitorUpdateStatus_lll invoker) { @@ -235,13 +242,6 @@ int CS_LDK_register_ChannelMonitorUpdateStatus_llll_invoker(invoker_ChannelMonit return 0; } -typedef void (*invoker_void_)(int obj_ptr, int fn_id); -static invoker_void_ js_invoke_function_void_; -int CS_LDK_register_void__invoker(invoker_void_ invoker) { - js_invoke_function_void_ = invoker; - return 0; -} - typedef void (*invoker_void_lli)(int obj_ptr, int fn_id, int64_t a, int64_t b, int32_t c); static invoker_void_lli js_invoke_function_void_lli; int CS_LDK_register_void_lli_invoker(invoker_void_lli invoker) { @@ -256,6 +256,13 @@ int CS_LDK_register_void_li_invoker(invoker_void_li invoker) { return 0; } +typedef void (*invoker_void_)(int obj_ptr, int fn_id); +static invoker_void_ js_invoke_function_void_; +int CS_LDK_register_void__invoker(invoker_void_ invoker) { + js_invoke_function_void_ = invoker; + return 0; +} + typedef int64_t (*invoker_l_llb)(int obj_ptr, int fn_id, int64_t a, int64_t b, jboolean c); static invoker_l_llb js_invoke_function_l_llb; int CS_LDK_register_l_llb_invoker(invoker_l_llb invoker) { @@ -423,10 +430,11 @@ static inline LDKBolt12SemanticError LDKBolt12SemanticError_from_cs(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; default: abort(); } } @@ -455,10 +463,11 @@ static inline int32_t LDKBolt12SemanticError_to_cs(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(); } } @@ -520,6 +529,7 @@ static inline LDKConfirmationTarget LDKConfirmationTarget_from_cs(int32_t ord) { case 3: return LDKConfirmationTarget_AnchorChannelFee; case 4: return LDKConfirmationTarget_NonAnchorChannelFee; case 5: return LDKConfirmationTarget_ChannelCloseMinimum; + case 6: return LDKConfirmationTarget_OutputSpendingFee; default: abort(); } } @@ -531,6 +541,7 @@ static inline int32_t LDKConfirmationTarget_to_cs(LDKConfirmationTarget val) { case LDKConfirmationTarget_AnchorChannelFee: return 3; case LDKConfirmationTarget_NonAnchorChannelFee: return 4; case LDKConfirmationTarget_ChannelCloseMinimum: return 5; + case LDKConfirmationTarget_OutputSpendingFee: return 6; default: abort(); } } @@ -576,6 +587,20 @@ static inline int32_t LDKCurrency_to_cs(LDKCurrency val) { default: abort(); } } +static inline LDKDirection LDKDirection_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKDirection_NodeOne; + case 1: return LDKDirection_NodeTwo; + default: abort(); + } +} +static inline int32_t LDKDirection_to_cs(LDKDirection val) { + switch (val) { + case LDKDirection_NodeOne: return 0; + case LDKDirection_NodeTwo: return 1; + default: abort(); + } +} static inline LDKHTLCClaim LDKHTLCClaim_from_cs(int32_t ord) { switch (ord) { case 0: return LDKHTLCClaim_OfferedTimeout; @@ -766,6 +791,22 @@ static inline int32_t LDKSecp256k1Error_to_cs(LDKSecp256k1Error val) { default: abort(); } } +static inline LDKShortChannelIdError LDKShortChannelIdError_from_cs(int32_t ord) { + switch (ord) { + case 0: return LDKShortChannelIdError_BlockOverflow; + case 1: return LDKShortChannelIdError_TxIndexOverflow; + case 2: return LDKShortChannelIdError_VoutIndexOverflow; + default: abort(); + } +} +static inline int32_t LDKShortChannelIdError_to_cs(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_cs(int32_t ord) { switch (ord) { case 0: return LDKSiPrefix_Milli; @@ -867,6 +908,54 @@ int8_t CS_LDK_LDKBech32Error_InvalidData_get_invalid_data(int64_t ptr) { 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; +} +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefundMaybeWithDerivedMetadataBuilder ret_var = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + LDKRefund ret_var = CResult_RefundBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_RefundBolt12SemanticErrorZ* owner_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_RefundBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_u64Z_ty_from_ptr(int64_t ptr) { LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr); switch(obj->tag) { @@ -946,6 +1035,7 @@ uint32_t CS_LDK_LDKDecodeError_ty_from_ptr(int64_t ptr) { case LDKDecodeError_BadLengthDescriptor: return 4; case LDKDecodeError_Io: return 5; case LDKDecodeError_UnsupportedCompression: return 6; + case LDKDecodeError_DangerousValue: return 7; default: abort(); } } @@ -1177,6 +1267,74 @@ void CS_LDK_CResult_RecipientOnionFieldsNoneZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedBolt12Invoice ret_var = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + LDKBolt12Invoice ret_var = CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* owner_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_err(int64_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++) { @@ -1207,6 +1365,76 @@ ptrArray CS_LDK_LDKCOption_CVec_ThirtyTwoBytesZZ_Some_get_some(int64_t ptr) { return some_arr; } +uint32_t CS_LDK_LDKAmount_ty_from_ptr(int64_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 CS_LDK_LDKAmount_Bitcoin_get_amount_msats(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Bitcoin); + int64_t amount_msats_conv = obj->bitcoin.amount_msats; + return amount_msats_conv; +} +int8_tArray CS_LDK_LDKAmount_Currency_get_iso4217_code(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKAmount_Currency_get_amount(int64_t ptr) { + LDKAmount *obj = (LDKAmount*)untag_ptr(ptr); + CHECK(obj->tag == LDKAmount_Currency); + int64_t amount_conv = obj->currency.amount; + return amount_conv; +} +uint32_t CS_LDK_LDKCOption_AmountZ_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKCOption_AmountZ_Some_get_some(int64_t ptr) { + LDKCOption_AmountZ *obj = (LDKCOption_AmountZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_AmountZ_Some); + int64_t some_ref = tag_ptr(&obj->some, false); + return some_ref; +} +uint32_t CS_LDK_LDKQuantity_ty_from_ptr(int64_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 CS_LDK_LDKQuantity_Bounded_get_bounded(int64_t ptr) { + LDKQuantity *obj = (LDKQuantity*)untag_ptr(ptr); + CHECK(obj->tag == LDKQuantity_Bounded); + int64_t bounded_conv = obj->bounded; + return bounded_conv; +} +uint32_t CS_LDK_LDKCOption_QuantityZ_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKCOption_QuantityZ_Some_get_some(int64_t ptr) { + LDKCOption_QuantityZ *obj = (LDKCOption_QuantityZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_QuantityZ_Some); + int64_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); @@ -1571,44 +1799,45 @@ void CS_LDK_CResult_RecoverableSignatureNoneZ_get_err(int64_t owner) { 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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok(int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); +int8_tArray CS_LDK_CResult_ECDSASignatureNoneZ_get_ok(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_get_err(int64_t owner) { - LDKCResult_SchnorrSignatureNoneZ* owner_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(owner); - CResult_SchnorrSignatureNoneZ_get_err(owner_conv); +void CS_LDK_CResult_ECDSASignatureNoneZ_get_err(int64_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 CS_LDK_CResult_ECDSASignatureNoneZ_get_ok(int64_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 CS_LDK_CResult_TransactionNoneZ_get_ok(int64_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 CS_LDK_CResult_ECDSASignatureNoneZ_get_err(int64_t owner) { - LDKCResult_ECDSASignatureNoneZ* owner_conv = (LDKCResult_ECDSASignatureNoneZ*)untag_ptr(owner); - CResult_ECDSASignatureNoneZ_get_err(owner_conv); +void CS_LDK_CResult_TransactionNoneZ_get_err(int64_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){ @@ -2481,27 +2710,6 @@ int64_t CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_err(int64_t owner) { 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 CS_LDK_CResult_TransactionNoneZ_get_ok(int64_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 CS_LDK_CResult_TransactionNoneZ_get_err(int64_t owner) { - LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner); - CResult_TransactionNoneZ_get_err(owner_conv); -} - uint32_t CS_LDK_LDKCandidateRouteHop_ty_from_ptr(int64_t ptr) { LDKCandidateRouteHop *obj = (LDKCandidateRouteHop*)untag_ptr(ptr); switch(obj->tag) { @@ -3533,6 +3741,32 @@ int64_t CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_BestBlockDecodeErrorZ* owner_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(owner); + LDKBestBlock ret_var = CResult_BestBlockDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_get_err(int64_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); + int64_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; } @@ -3616,12 +3850,48 @@ void CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_get_err(int64_t owner) { CResult_ChannelMonitorUpdateStatusNoneZ_get_err(owner_conv); } +uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_CounterpartyForceClosed); + LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; + int64_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 CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { + LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); + CHECK(obj->tag == LDKClosureReason_ProcessingError); + LDKStr err_str = obj->processing_error.err; + jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); + return err_conv; +} uint32_t CS_LDK_LDKMonitorEvent_ty_from_ptr(int64_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(); } } @@ -3634,6 +3904,30 @@ int64_t CS_LDK_LDKMonitorEvent_HTLCEvent_get_htlc_event(int64_t ptr) { htlc_event_ref = tag_ptr(htlc_event_var.inner, false); return htlc_event_ref; } +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_reason(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + int64_t reason_ref = tag_ptr(&obj->holder_force_closed_with_info.reason, false); + return reason_ref; +} +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKOutPoint outpoint_var = obj->holder_force_closed_with_info.outpoint; + int64_t outpoint_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var); + outpoint_ref = tag_ptr(outpoint_var.inner, false); + return outpoint_ref; +} +int64_t CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_HolderForceClosedWithInfo); + LDKChannelId channel_id_var = obj->holder_force_closed_with_info.channel_id; + int64_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 CS_LDK_LDKMonitorEvent_HolderForceClosed_get_holder_force_closed(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMonitorEvent_HolderForceClosed); @@ -3652,6 +3946,15 @@ int64_t CS_LDK_LDKMonitorEvent_Completed_get_funding_txo(int64_t ptr) { funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } +int64_t CS_LDK_LDKMonitorEvent_Completed_get_channel_id(int64_t ptr) { + LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKMonitorEvent_Completed); + LDKChannelId channel_id_var = obj->completed.channel_id; + int64_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 CS_LDK_LDKMonitorEvent_Completed_get_monitor_update_id(int64_t ptr) { LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKMonitorEvent_Completed); @@ -3665,26 +3968,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; } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKOutPoint ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(owner_conv); + int64_t ret_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; +} +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(owner_conv); int64_t ret_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); } -int64_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); - LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv); +int64_tArray CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(int64_t owner) { + LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); + LDKCVec_MonitorEventZ ret_var = C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(owner_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); @@ -3699,20 +4016,20 @@ int64_tArray CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(int64_t 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 CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(int64_t owner) { - LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner); +int8_tArray CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(int64_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; } @@ -3898,6 +4215,123 @@ int64_t CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferIdDecodeErrorZ* owner_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(owner); + LDKOfferId ret_var = CResult_OfferIdDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_get_err(int64_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); + int64_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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok(int64_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); +} +int32_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOffer ret_var = CResult_OfferBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_OfferBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithDerivedPayerIdBuilder ret_var = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequestWithExplicitPayerIdBuilder ret_var = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; @@ -3926,27 +4360,6 @@ int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_get_err(int64_t owner) { 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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok(int64_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; -} -int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { - LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKSecp256k1Error_to_cs(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; @@ -3973,6 +4386,27 @@ int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_get_err(int64_t owner) { 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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok(int64_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; +} +int32_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err(int64_t owner) { + LDKCResult_PublicKeySecp256k1ErrorZ* owner_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKSecp256k1Error_to_cs(CResult_PublicKeySecp256k1ErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKNetworkUpdate_ty_from_ptr(int64_t ptr) { LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr); switch(obj->tag) { @@ -5257,6 +5691,26 @@ int64_tArray CS_LDK_LDKCOption_CVec_SocketAddressZZ_Some_get_some(int64_t ptr) { 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 CS_LDK_CResult_u64ShortChannelIdErrorZ_get_ok(int64_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); +} +int32_t CS_LDK_CResult_u64ShortChannelIdErrorZ_get_err(int64_t owner) { + LDKCResult_u64ShortChannelIdErrorZ* owner_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKShortChannelIdError_to_cs(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; @@ -5381,6 +5835,56 @@ void CS_LDK_CResult_CVec_UtxoZNoneZ_get_err(int64_t owner) { CResult_CVec_UtxoZNoneZ_get_err(owner_conv); } +uint32_t CS_LDK_LDKPaymentContext_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKPaymentContext_Unknown_get_unknown(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Unknown); + LDKUnknownPaymentContext unknown_var = obj->unknown; + int64_t unknown_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(unknown_var); + unknown_ref = tag_ptr(unknown_var.inner, false); + return unknown_ref; +} +int64_t CS_LDK_LDKPaymentContext_Bolt12Offer_get_bolt12_offer(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Bolt12Offer); + LDKBolt12OfferContext bolt12_offer_var = obj->bolt12_offer; + int64_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; +} +int64_t CS_LDK_LDKPaymentContext_Bolt12Refund_get_bolt12_refund(int64_t ptr) { + LDKPaymentContext *obj = (LDKPaymentContext*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentContext_Bolt12Refund); + LDKBolt12RefundContext bolt12_refund_var = obj->bolt12_refund; + int64_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 CS_LDK_LDKCOption_PaymentContextZ_ty_from_ptr(int64_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(); + } +} +int64_t CS_LDK_LDKCOption_PaymentContextZ_Some_get_some(int64_t ptr) { + LDKCOption_PaymentContextZ *obj = (LDKCOption_PaymentContextZ*)untag_ptr(ptr); + CHECK(obj->tag == LDKCOption_PaymentContextZ_Some); + int64_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; } @@ -5429,25 +5933,28 @@ int32_t CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some(int64_t ptr) { int32_t some_conv = LDKChannelShutdownState_to_cs(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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(int64_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; +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelIdAPIErrorZ* owner_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdAPIErrorZ_get_ok(owner_conv); + int64_t ret_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); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_t owner) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* owner_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_get_err(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -5782,33 +6289,68 @@ int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFail 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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(int64_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; +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_a(int64_t owner) { + LDKC2Tuple_ChannelIdPublicKeyZ* owner_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_ChannelIdPublicKeyZ_get_a(owner_conv); + int64_t ret_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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(int64_t owner) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* owner_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(owner); +int8_tArray CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_b(int64_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_ThirtyTwoBytesPublicKeyZ_clone(&orig->data[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] = 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; +} +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKOfferWithDerivedMetadataBuilder ret_var = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_StrZ_ty_from_ptr(int64_t ptr) { LDKCOption_StrZ *obj = (LDKCOption_StrZ*)untag_ptr(ptr); switch(obj->tag) { @@ -5824,25 +6366,6 @@ jstring CS_LDK_LDKCOption_StrZ_Some_get_some(int64_t ptr) { jstring some_conv = str_ref_to_cs(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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok(int64_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); -} -int32_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err(int64_t owner) { - LDKCResult_NoneBolt12SemanticErrorZ* owner_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKBolt12SemanticError_to_cs(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); @@ -5863,6 +6386,29 @@ void CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(int64_t 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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok(int64_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); +} +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + uint32_t CS_LDK_LDKOffersMessage_ty_from_ptr(int64_t ptr) { LDKOffersMessage *obj = (LDKOffersMessage*)untag_ptr(ptr); switch(obj->tag) { @@ -6158,6 +6704,12 @@ int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_metadata(int64_t ptr) { int64_t payment_metadata_ref = tag_ptr(&obj->receive.payment_metadata, false); return payment_metadata_ref; } +int64_t CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_context(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(obj->tag == LDKPendingHTLCRouting_Receive); + int64_t payment_context_ref = tag_ptr(&obj->receive.payment_context, false); + return payment_context_ref; +} int32_t CS_LDK_LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry(int64_t ptr) { LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); CHECK(obj->tag == LDKPendingHTLCRouting_Receive); @@ -6237,6 +6789,12 @@ int64_tArray CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_custom_tlvs(int64_t return custom_tlvs_arr; } +jboolean CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error(int64_t ptr) { + LDKPendingHTLCRouting *obj = (LDKPendingHTLCRouting*)untag_ptr(ptr); + CHECK(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); @@ -6380,23 +6938,23 @@ LDKChannelMonitorUpdateStatus update_channel_LDKWatch_jcall(const void* this_arg LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(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; int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 29); - 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; int64_t* ret_vals = ret->elems; - for (size_t x = 0; x < ret_constr.datalen; x++) { - int64_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++) { + int64_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; @@ -6465,14 +7023,14 @@ int64_tArray CS_LDK_Watch_release_pending_monitor_events(int64_t this_arg) { 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); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t 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); @@ -6705,7 +7263,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_request_LDKNodeSigner_jcall LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedInvoiceRequest invoice_request_var = *invoice_request; int64_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_l_l(j_calls->instance_ptr, 36, invoice_request_ref); @@ -6719,7 +7277,7 @@ LDKCResult_SchnorrSignatureNoneZ sign_bolt12_invoice_LDKNodeSigner_jcall(const v LDKNodeSigner_JCalls *j_calls = (LDKNodeSigner_JCalls*) this_arg; LDKUnsignedBolt12Invoice invoice_var = *invoice; int64_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_l_l(j_calls->instance_ptr, 37, invoice_ref); @@ -8404,34 +8962,6 @@ int64_t CS_LDK_LDKCOption_SocketAddressZ_Some_get_some(int64_t ptr) { int64_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 CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(int64_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); -} -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(int64_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); - int64_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); @@ -8661,6 +9191,54 @@ int32_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(in 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; +} +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKUnsignedInvoiceRequest ret_var = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceRequest ret_var = CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(owner_conv)); + return ret_conv; +} + uint32_t CS_LDK_LDKCOption_SecretKeyZ_ty_from_ptr(int64_t ptr) { LDKCOption_SecretKeyZ *obj = (LDKCOption_SecretKeyZ*)untag_ptr(ptr); switch(obj->tag) { @@ -8676,6 +9254,30 @@ int8_tArray CS_LDK_LDKCOption_SecretKeyZ_Some_get_some(int64_t ptr) { 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; +} +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithExplicitSigningPubkeyBuilder ret_var = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; @@ -8699,6 +9301,56 @@ void CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + LDKInvoiceWithDerivedSigningPubkeyBuilder ret_var = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int32_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(int64_t owner) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* owner_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKBolt12SemanticError_to_cs(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; +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* owner_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(owner); + LDKInvoiceRequestFields ret_var = CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(int64_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); + int64_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++) { @@ -8706,6 +9358,21 @@ static inline LDKCVec_WitnessZ CVec_WitnessZ_clone(const LDKCVec_WitnessZ *orig) } return ret; } +uint32_t CS_LDK_LDKCOption_ECDSASignatureZ_ty_from_ptr(int64_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 CS_LDK_LDKCOption_ECDSASignatureZ_Some_get_some(int64_t ptr) { + LDKCOption_ECDSASignatureZ *obj = (LDKCOption_ECDSASignatureZ*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKCOption_i64Z_ty_from_ptr(int64_t ptr) { LDKCOption_i64Z *obj = (LDKCOption_i64Z*)untag_ptr(ptr); switch(obj->tag) { @@ -10167,13 +10834,6 @@ int64_t CS_LDK_CResult_Bolt11InvoiceSignOrCreationErrorZ_get_err(int64_t owner) return ret_ref; } -static inline LDKCVec_FutureZ CVec_FutureZ_clone(const LDKCVec_FutureZ *orig) { - LDKCVec_FutureZ ret = { .data = MALLOC(sizeof(LDKFuture) * orig->datalen, "LDKCVec_FutureZ clone bytes"), .datalen = orig->datalen }; - for (size_t i = 0; i < ret.datalen; i++) { - ret.data[i] = Future_clone(&orig->data[i]); - } - return ret; -} static inline struct LDKOffersMessage CResult_OffersMessageDecodeErrorZ_get_ok(LDKCResult_OffersMessageDecodeErrorZ *NONNULL_PTR owner){ CHECK(owner->result_ok); return OffersMessage_clone(&*owner->contents.result); @@ -10591,24 +11251,70 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(int64_t own uint32_t CS_LDK_LDKPaymentPurpose_ty_from_ptr(int64_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(); } } -int64_t CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(int64_t ptr) { +int64_t CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt11_invoice_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt11InvoicePayment); + int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__); + memcpy(payment_secret_arr->elems, obj->bolt11_invoice_payment.payment_secret.data, 32); + return payment_secret_arr; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt12_offer_payment.payment_preimage, false); + return payment_preimage_ref; +} +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(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; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12OfferPayment); + LDKBolt12OfferContext payment_context_var = obj->bolt12_offer_payment.payment_context; + int64_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; +} +int64_t CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentPurpose_InvoicePayment); - int64_t payment_preimage_ref = tag_ptr(&obj->invoice_payment.payment_preimage, false); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + int64_t payment_preimage_ref = tag_ptr(&obj->bolt12_refund_payment.payment_preimage, false); return payment_preimage_ref; } -int8_tArray CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_secret(int64_t ptr) { +int8_tArray CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); - CHECK(obj->tag == LDKPaymentPurpose_InvoicePayment); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); 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->bolt12_refund_payment.payment_secret.data, 32); return payment_secret_arr; } +int64_t CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context(int64_t ptr) { + LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); + CHECK(obj->tag == LDKPaymentPurpose_Bolt12RefundPayment); + LDKBolt12RefundContext payment_context_var = obj->bolt12_refund_payment.payment_context; + int64_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 CS_LDK_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(int64_t ptr) { LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr); CHECK(obj->tag == LDKPaymentPurpose_SpontaneousPayment); @@ -10724,38 +11430,6 @@ int64_t CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_err(int64_t owner) return ret_ref; } -uint32_t CS_LDK_LDKClosureReason_ty_from_ptr(int64_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(); - } -} -int64_t CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - CHECK(obj->tag == LDKClosureReason_CounterpartyForceClosed); - LDKUntrustedString peer_msg_var = obj->counterparty_force_closed.peer_msg; - int64_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 CS_LDK_LDKClosureReason_ProcessingError_get_err(int64_t ptr) { - LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr); - CHECK(obj->tag == LDKClosureReason_ProcessingError); - LDKStr err_str = obj->processing_error.err; - jstring err_conv = str_ref_to_cs(err_str.chars, err_str.len); - return err_conv; -} uint32_t CS_LDK_LDKCOption_ClosureReasonZ_ty_from_ptr(int64_t ptr) { LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr); switch(obj->tag) { @@ -10800,7 +11474,8 @@ uint32_t CS_LDK_LDKHTLCDestination_ty_from_ptr(int64_t ptr) { 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(); } } @@ -10811,12 +11486,14 @@ int8_tArray CS_LDK_LDKHTLCDestination_NextHopChannel_get_node_id(int64_t ptr) { memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33); return node_id_arr; } -int8_tArray CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKHTLCDestination_NextHopChannel_get_channel_id(int64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(int64_t ptr) { LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr); @@ -10941,6 +11618,22 @@ uint32_t CS_LDK_LDKBumpTransactionEvent_ty_from_ptr(int64_t ptr) { default: abort(); } } +int64_t CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_channel_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); + LDKChannelId channel_id_var = obj->channel_close.channel_id; + int64_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 CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_claim_id(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKBumpTransactionEvent_ChannelClose); @@ -10994,6 +11687,22 @@ int64_tArray CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs(int64 return pending_htlcs_arr; } +int64_t CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_channel_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); + LDKChannelId channel_id_var = obj->htlc_resolution.channel_id; + int64_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 CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id(int64_t ptr) { + LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_claim_id(int64_t ptr) { LDKBumpTransactionEvent *obj = (LDKBumpTransactionEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKBumpTransactionEvent_HTLCResolution); @@ -11058,12 +11767,14 @@ uint32_t CS_LDK_LDKEvent_ty_from_ptr(int64_t ptr) { default: abort(); } } -int8_tArray CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_FundingGenerationReady_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_FundingGenerationReady_get_counterparty_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11137,7 +11848,10 @@ int64_t CS_LDK_LDKEvent_PaymentClaimable_get_purpose(int64_t ptr) { int64_t CS_LDK_LDKEvent_PaymentClaimable_get_via_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentClaimable); - int64_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; + int64_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; } int64_t CS_LDK_LDKEvent_PaymentClaimable_get_via_user_channel_id(int64_t ptr) { @@ -11444,26 +12158,53 @@ int64_tArray CS_LDK_LDKEvent_SpendableOutputs_get_outputs(int64_t ptr) { int64_t CS_LDK_LDKEvent_SpendableOutputs_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_SpendableOutputs); - int64_t channel_id_ref = tag_ptr(&obj->spendable_outputs.channel_id, false); + LDKChannelId channel_id_var = obj->spendable_outputs.channel_id; + int64_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 CS_LDK_LDKEvent_PaymentForwarded_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_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; + int64_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; } int64_t CS_LDK_LDKEvent_PaymentForwarded_get_next_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_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; + int64_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; } -int64_t CS_LDK_LDKEvent_PaymentForwarded_get_fee_earned_msat(int64_t ptr) { +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_prev_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t prev_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.prev_user_channel_id, false); + return prev_user_channel_id_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_next_user_channel_id(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t next_user_channel_id_ref = tag_ptr(&obj->payment_forwarded.next_user_channel_id, false); + return next_user_channel_id_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_total_fee_earned_msat(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_PaymentForwarded); - int64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false); - return fee_earned_msat_ref; + int64_t total_fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.total_fee_earned_msat, false); + return total_fee_earned_msat_ref; +} +int64_t CS_LDK_LDKEvent_PaymentForwarded_get_skimmed_fee_msat(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_PaymentForwarded); + int64_t skimmed_fee_msat_ref = tag_ptr(&obj->payment_forwarded.skimmed_fee_msat, false); + return skimmed_fee_msat_ref; } jboolean CS_LDK_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11477,12 +12218,14 @@ int64_t CS_LDK_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(int6 int64_t outbound_amount_forwarded_msat_ref = tag_ptr(&obj->payment_forwarded.outbound_amount_forwarded_msat, false); return outbound_amount_forwarded_msat_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelPending_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelPending_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_ChannelPending_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11494,7 +12237,10 @@ int8_tArray CS_LDK_LDKEvent_ChannelPending_get_user_channel_id(int64_t ptr) { int64_t CS_LDK_LDKEvent_ChannelPending_get_former_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(obj->tag == LDKEvent_ChannelPending); - int64_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; + int64_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 CS_LDK_LDKEvent_ChannelPending_get_counterparty_node_id(int64_t ptr) { @@ -11513,12 +12259,23 @@ int64_t CS_LDK_LDKEvent_ChannelPending_get_funding_txo(int64_t ptr) { funding_txo_ref = tag_ptr(funding_txo_var.inner, false); return funding_txo_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelReady_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelPending_get_channel_type(int64_t ptr) { + LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); + CHECK(obj->tag == LDKEvent_ChannelPending); + LDKChannelTypeFeatures channel_type_var = obj->channel_pending.channel_type; + int64_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; +} +int64_t CS_LDK_LDKEvent_ChannelReady_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_ChannelReady_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11543,12 +12300,14 @@ int64_t CS_LDK_LDKEvent_ChannelReady_get_channel_type(int64_t ptr) { channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray CS_LDK_LDKEvent_ChannelClosed_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_ChannelClosed_get_user_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11585,12 +12344,14 @@ int64_t CS_LDK_LDKEvent_ChannelClosed_get_channel_funding_txo(int64_t ptr) { channel_funding_txo_ref = tag_ptr(channel_funding_txo_var.inner, false); return channel_funding_txo_ref; } -int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_DiscardFunding_get_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_DiscardFunding_get_transaction(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11600,12 +12361,14 @@ int8_tArray CS_LDK_LDKEvent_DiscardFunding_get_transaction(int64_t ptr) { memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen); return transaction_arr; } -int8_tArray CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_temporary_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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 CS_LDK_LDKEvent_OpenChannelRequest_get_counterparty_node_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -11635,12 +12398,14 @@ int64_t CS_LDK_LDKEvent_OpenChannelRequest_get_channel_type(int64_t ptr) { channel_type_ref = tag_ptr(channel_type_var.inner, false); return channel_type_ref; } -int8_tArray CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { +int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); CHECK(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; + int64_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; } int64_t CS_LDK_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(int64_t ptr) { LDKEvent *obj = (LDKEvent*)untag_ptr(ptr); @@ -12178,6 +12943,32 @@ int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err(int64_t owner) { 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; +} +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_ChannelIdDecodeErrorZ* owner_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(owner); + LDKChannelId ret_var = CResult_ChannelIdDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_get_err(int64_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); + int64_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); } @@ -12249,6 +13040,129 @@ int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_get_err(int64_t owner) { 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); +} +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_get_ok(int64_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); + int64_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); +} +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* owner_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(owner); + LDKUnknownPaymentContext ret_var = CResult_UnknownPaymentContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12OfferContext ret_var = CResult_Bolt12OfferContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* owner_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(owner); + LDKBolt12RefundContext ret_var = CResult_Bolt12RefundContextDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_err(int64_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); + int64_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 CS_LDK_CResult_StrSecp256k1ErrorZ_get_ok(int64_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_cs(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; +} +int32_t CS_LDK_CResult_StrSecp256k1ErrorZ_get_err(int64_t owner) { + LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); + int32_t ret_conv = LDKSecp256k1Error_to_cs(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); } @@ -12307,27 +13221,6 @@ void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZN 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 CS_LDK_CResult_StrSecp256k1ErrorZ_get_ok(int64_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_cs(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; -} -int32_t CS_LDK_CResult_StrSecp256k1ErrorZ_get_err(int64_t owner) { - LDKCResult_StrSecp256k1ErrorZ* owner_conv = (LDKCResult_StrSecp256k1ErrorZ*)untag_ptr(owner); - int32_t ret_conv = LDKSecp256k1Error_to_cs(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; } @@ -12374,7 +13267,8 @@ uint32_t CS_LDK_LDKSendError_ty_from_ptr(int64_t ptr) { 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(); } } @@ -12414,6 +13308,27 @@ int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZ return ret_ref; } +uint32_t CS_LDK_LDKNextMessageHop_ty_from_ptr(int64_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 CS_LDK_LDKNextMessageHop_NodeId_get_node_id(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKNextMessageHop_ShortChannelId_get_short_channel_id(int64_t ptr) { + LDKNextMessageHop *obj = (LDKNextMessageHop*)untag_ptr(ptr); + CHECK(obj->tag == LDKNextMessageHop_ShortChannelId); + int64_t short_channel_id_conv = obj->short_channel_id; + return short_channel_id_conv; +} uint32_t CS_LDK_LDKParsedOnionMessageContents_ty_from_ptr(int64_t ptr) { LDKParsedOnionMessageContents *obj = (LDKParsedOnionMessageContents*)untag_ptr(ptr); switch(obj->tag) { @@ -12443,12 +13358,11 @@ uint32_t CS_LDK_LDKPeeledOnion_ty_from_ptr(int64_t ptr) { default: abort(); } } -int8_tArray CS_LDK_LDKPeeledOnion_Forward_get__0(int64_t ptr) { +int64_t CS_LDK_LDKPeeledOnion_Forward_get__0(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); CHECK(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; + int64_t _0_ref = tag_ptr(&obj->forward._0, false); + return _0_ref; } int64_t CS_LDK_LDKPeeledOnion_Forward_get__1(int64_t ptr) { LDKPeeledOnion *obj = (LDKPeeledOnion*)untag_ptr(ptr); @@ -12669,158 +13583,122 @@ int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_err(int64_t owner) { 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; -} -int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); - LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); -} -int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(int64_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); - int64_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; -} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); - LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); -} -int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(int64_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); - int64_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; +static inline struct LDKTrackedSpendableOutput CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ + LDKTrackedSpendableOutput ret = *owner->contents.result; ret.is_owned = false; return ret; } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); - LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_get_ok(owner_conv); +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); + LDKTrackedSpendableOutput ret_var = CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(owner_conv); int64_t ret_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){ +static inline struct LDKDecodeError CResult_TrackedSpendableOutputDecodeErrorZ_get_err(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner){ CHECK(!owner->result_ok); return DecodeError_clone(&*owner->contents.err); } -int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_err(int64_t owner) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* owner_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(owner); LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); - *ret_copy = CResult_HtlcBasepointDecodeErrorZ_get_err(owner_conv); + *ret_copy = CResult_TrackedSpendableOutputDecodeErrorZ_get_err(owner_conv); int64_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; -} -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); - LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); -} -int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err(int64_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); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; +uint32_t CS_LDK_LDKOutputSpendStatus_ty_from_ptr(int64_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; +int64_t CS_LDK_LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingInitialBroadcast); + int64_t delayed_until_height_ref = tag_ptr(&obj->pending_initial_broadcast.delayed_until_height, false); + return delayed_until_height_ref; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingFirstConfirmation); + int32_t latest_broadcast_height_conv = obj->pending_first_confirmation.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t latest_broadcast_height_conv = obj->pending_threshold_confirmations.latest_broadcast_height; + return latest_broadcast_height_conv; +} +int8_tArray CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(obj->tag == LDKOutputSpendStatus_PendingThresholdConfirmations); + int32_t confirmation_height_conv = obj->pending_threshold_confirmations.confirmation_height; + return confirmation_height_conv; } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); - LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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 CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash(int64_t ptr) { + LDKOutputSpendStatus *obj = (LDKOutputSpendStatus*)untag_ptr(ptr); + CHECK(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); } -int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err(int64_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); +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_ok(int64_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); int64_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; -} -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok(int64_t owner) { - LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); - LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_get_ok(owner_conv); - int64_t ret_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); } -int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err(int64_t owner) { - LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_err(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -12921,85 +13799,62 @@ int64_t CS_LDK_LDKCOption_FilterZ_Some_get_some(int64_t ptr) { } 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; -} -int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok(int64_t owner) { - LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); - LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); - int64_t ret_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 CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err(int64_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_l_(j_calls->instance_ptr, 58); + 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; } -int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); - int64_t ret_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 (int64_t 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; } -int64_tArray CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(int64_t owner) { - LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); - LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t r = 0; r < ret_var.datalen; r++) { - LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; - int64_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 CS_LDK_LDKChangeDestinationSource_new(int32_t 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; +int64_t CS_LDK_ChangeDestinationSource_get_change_destination_script(int64_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; @@ -13021,7 +13876,7 @@ LDKCResult_CVec_u8ZIOErrorZ read_LDKKVStore_jcall(const void* this_arg, LDKStr p LDKStr key_str = key; jstring key_conv = str_ref_to_cs(key_str.chars, key_str.len); Str_free(key_str); - uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 58, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv); + uint64_t ret = js_invoke_function_l_lll(j_calls->instance_ptr, 59, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZIOErrorZ ret_conv = *(LDKCResult_CVec_u8ZIOErrorZ*)(ret_ptr); @@ -13042,7 +13897,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_l_llll(j_calls->instance_ptr, 59, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, (int64_t)buf_arr); + uint64_t ret = js_invoke_function_l_llll(j_calls->instance_ptr, 60, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, (int64_t)buf_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -13061,7 +13916,7 @@ LDKCResult_NoneIOErrorZ remove_LDKKVStore_jcall(const void* this_arg, LDKStr pri jstring key_conv = str_ref_to_cs(key_str.chars, key_str.len); Str_free(key_str); jboolean lazy_conv = lazy; - uint64_t ret = js_invoke_function_l_lllb(j_calls->instance_ptr, 60, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, lazy_conv); + uint64_t ret = js_invoke_function_l_lllb(j_calls->instance_ptr, 61, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv, (int64_t)key_conv, lazy_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); @@ -13076,7 +13931,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_cs(secondary_namespace_str.chars, secondary_namespace_str.len); Str_free(secondary_namespace_str); - uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 61, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 62, (int64_t)primary_namespace_conv, (int64_t)secondary_namespace_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_StrZIOErrorZ ret_conv = *(LDKCResult_CVec_StrZIOErrorZ*)(ret_ptr); @@ -13158,283 +14013,721 @@ int64_t CS_LDK_KVStore_list(int64_t this_arg, jstring primary_namespace, jstrin return tag_ptr(ret_conv, true); } -typedef struct LDKPersister_JCalls { +typedef struct LDKOutputSpender_JCalls { atomic_size_t refcnt; uint32_t instance_ptr; -} LDKPersister_JCalls; -static void LDKPersister_JCalls_free(void* this_arg) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; +} 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_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; - LDKChannelManager channel_manager_var = *channel_manager; - int64_t channel_manager_ref = 0; - // 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_l_l(j_calls->instance_ptr, 62, channel_manager_ref); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; -} -LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; - LDKNetworkGraph network_graph_var = *network_graph; - int64_t network_graph_ref = 0; - // 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_l_l(j_calls->instance_ptr, 63, network_graph_ref); - void* ret_ptr = untag_ptr(ret); - CHECK_ACCESS(ret_ptr); - LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); - FREE(untag_ptr(ret)); - return ret_conv; -} -LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; - // WARNING: This object doesn't live past this scope, needs clone! - int64_t ret_scorer = tag_ptr(scorer, false); - uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 64, ret_scorer); +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; + int64_tArray descriptors_arr = NULL; + descriptors_arr = init_int64_tArray(descriptors_var.datalen, __LINE__); + int64_t *descriptors_arr_ptr = (int64_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]; + int64_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; + int64_tArray outputs_arr = NULL; + outputs_arr = init_int64_tArray(outputs_var.datalen, __LINE__); + int64_t *outputs_arr_ptr = (int64_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; + int64_t locktime_ref = tag_ptr(locktime_copy, true); + uint64_t ret = js_invoke_function_l_lllil(j_calls->instance_ptr, 63, (int64_t)descriptors_arr, (int64_t)outputs_arr, (int64_t)change_destination_script_arr, feerate_sat_per_1000_weight_conv, locktime_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); - LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); FREE(untag_ptr(ret)); return ret_conv; } -static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { - LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; +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 LDKPersister LDKPersister_init (int64_t o) { - LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); +static inline LDKOutputSpender LDKOutputSpender_init (int64_t o) { + LDKOutputSpender_JCalls *calls = MALLOC(sizeof(LDKOutputSpender_JCalls), "LDKOutputSpender_JCalls"); atomic_init(&calls->refcnt, 1); calls->instance_ptr = o; - LDKPersister ret = { + LDKOutputSpender ret = { .this_arg = (void*) calls, - .persist_manager = persist_manager_LDKPersister_jcall, - .persist_graph = persist_graph_LDKPersister_jcall, - .persist_scorer = persist_scorer_LDKPersister_jcall, - .free = LDKPersister_JCalls_free, + .spend_spendable_outputs = spend_spendable_outputs_LDKOutputSpender_jcall, + .free = LDKOutputSpender_JCalls_free, }; return ret; } -uint64_t CS_LDK_LDKPersister_new(int32_t o) { - LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); - *res_ptr = LDKPersister_init(o); +uint64_t CS_LDK_LDKOutputSpender_new(int32_t o) { + LDKOutputSpender *res_ptr = MALLOC(sizeof(LDKOutputSpender), "LDKOutputSpender"); + *res_ptr = LDKOutputSpender_init(o); return tag_ptr(res_ptr, true); } -int64_t CS_LDK_Persister_persist_manager(int64_t this_arg, int64_t channel_manager) { +int64_t CS_LDK_OutputSpender_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKChannelManager channel_manager_conv; - channel_manager_conv.inner = untag_ptr(channel_manager); - channel_manager_conv.is_owned = ptr_is_owned(channel_manager); - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); - channel_manager_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); + 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; + int64_t* descriptors_vals = descriptors->elems; + for (size_t b = 0; b < descriptors_constr.datalen; b++) { + int64_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; + int64_t* outputs_vals = outputs->elems; + for (size_t h = 0; h < outputs_constr.datalen; h++) { + int64_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); } -int64_t CS_LDK_Persister_persist_graph(int64_t this_arg, int64_t network_graph) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - LDKNetworkGraph network_graph_conv; - network_graph_conv.inner = untag_ptr(network_graph); - network_graph_conv.is_owned = ptr_is_owned(network_graph); - CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); - network_graph_conv.is_owned = false; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_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; } - -int64_t CS_LDK_Persister_persist_scorer(int64_t this_arg, int64_t scorer) { - void* this_arg_ptr = untag_ptr(this_arg); - if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } - LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; - void* scorer_ptr = untag_ptr(scorer); - if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } - LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr; - LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); - *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv); - return tag_ptr(ret_conv, true); +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_OutputSweeperDecodeErrorZ* owner_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = CResult_OutputSweeperDecodeErrorZ_get_ok(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -typedef struct LDKPersist_JCalls { - atomic_size_t refcnt; - uint32_t instance_ptr; -} LDKPersist_JCalls; -static void LDKPersist_JCalls_free(void* this_arg) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { - FREE(j_calls); - } +static inline struct LDKDecodeError CResult_OutputSweeperDecodeErrorZ_get_err(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner){ +CHECK(!owner->result_ok); + return DecodeError_clone(&*owner->contents.err); } -LDKChannelMonitorUpdateStatus persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - int64_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); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_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_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 65, channel_id_ref, data_ref, update_id_ref); - LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); - return ret_conv; +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_err(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -LDKChannelMonitorUpdateStatus update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, LDKChannelMonitorUpdate update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) { - LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; - LDKOutPoint channel_id_var = channel_id; - int64_t channel_id_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var); - channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned); - LDKChannelMonitorUpdate update_var = update; - int64_t update_ref = 0; - CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); - update_ref = tag_ptr(update_var.inner, update_var.is_owned); - LDKChannelMonitor data_var = *data; - int64_t data_ref = 0; - data_var = ChannelMonitor_clone(&data_var); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); - data_ref = tag_ptr(data_var.inner, data_var.is_owned); - LDKMonitorUpdateId update_id_var = update_id; - int64_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_ChannelMonitorUpdateStatus_llll(j_calls->instance_ptr, 66, channel_id_ref, update_ref, data_ref, update_id_ref); - LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); - return ret_conv; + +static inline struct LDKBestBlock C2Tuple_BestBlockOutputSweeperZ_get_a(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner){ + LDKBestBlock ret = owner->a; + ret.is_owned = false; + return ret; } -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); +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_a(int64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKBestBlock ret_var = C2Tuple_BestBlockOutputSweeperZ_get_a(owner_conv); + int64_t ret_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 LDKPersist LDKPersist_init (int64_t o) { - LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls"); - atomic_init(&calls->refcnt, 1); - calls->instance_ptr = o; - LDKPersist ret = { - .this_arg = (void*) calls, - .persist_new_channel = persist_new_channel_LDKPersist_jcall, - .update_persisted_channel = update_persisted_channel_LDKPersist_jcall, - .free = LDKPersist_JCalls_free, - }; +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 CS_LDK_LDKPersist_new(int32_t o) { - LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist"); - *res_ptr = LDKPersist_init(o); - return tag_ptr(res_ptr, true); -} -int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_id, int64_t data, int64_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); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - 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); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv)); - return ret_conv; +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_b(int64_t owner) { + LDKC2Tuple_BestBlockOutputSweeperZ* owner_conv = (LDKC2Tuple_BestBlockOutputSweeperZ*)untag_ptr(owner); + LDKOutputSweeper ret_var = C2Tuple_BestBlockOutputSweeperZ_get_b(owner_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; } -int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_id, int64_t update, int64_t data, int64_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); - 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 = ChannelMonitorUpdate_clone(&update_conv); - LDKChannelMonitor data_conv; - data_conv.inner = untag_ptr(data); - data_conv.is_owned = ptr_is_owned(data); - CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); - data_conv.is_owned = false; - LDKMonitorUpdateId update_id_conv; - update_id_conv.inner = untag_ptr(update_id); - 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); - int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, update_conv, &data_conv, update_id_conv)); - return ret_conv; +static inline struct LDKC2Tuple_BestBlockOutputSweeperZ *CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner){ +CHECK(owner->result_ok); + return &*owner->contents.result; } - -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); - } +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ*)untag_ptr(owner); + int64_t ret_ret = tag_ptr(CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(owner_conv), false); + return ret_ret; } -void call_LDKFutureCallback_jcall(const void* this_arg) { - LDKFutureCallback_JCalls *j_calls = (LDKFutureCallback_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 67); + +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); } -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); +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -static inline LDKFutureCallback LDKFutureCallback_init (int64_t o) { - LDKFutureCallback_JCalls *calls = MALLOC(sizeof(LDKFutureCallback_JCalls), "LDKFutureCallback_JCalls"); + +static inline struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner){ + LDKDelayedPaymentBasepoint ret = *owner->contents.result; + ret.is_owned = false; + return ret; +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_DelayedPaymentBasepointDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentBasepointDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentBasepoint ret_var = CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_DelayedPaymentKeyDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentKeyDecodeErrorZ*)untag_ptr(owner); + LDKDelayedPaymentKey ret_var = CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HtlcBasepointDecodeErrorZ* owner_conv = (LDKCResult_HtlcBasepointDecodeErrorZ*)untag_ptr(owner); + LDKHtlcBasepoint ret_var = CResult_HtlcBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_HtlcKeyDecodeErrorZ* owner_conv = (LDKCResult_HtlcKeyDecodeErrorZ*)untag_ptr(owner); + LDKHtlcKey ret_var = CResult_HtlcKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RevocationBasepointDecodeErrorZ* owner_conv = (LDKCResult_RevocationBasepointDecodeErrorZ*)untag_ptr(owner); + LDKRevocationBasepoint ret_var = CResult_RevocationBasepointDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok(int64_t owner) { + LDKCResult_RevocationKeyDecodeErrorZ* owner_conv = (LDKCResult_RevocationKeyDecodeErrorZ*)untag_ptr(owner); + LDKRevocationKey ret_var = CResult_RevocationKeyDecodeErrorZ_get_ok(owner_conv); + int64_t ret_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); +} +int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err(int64_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); + int64_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; +} +int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok(int64_t owner) { + LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner); + LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv); + int64_t ret_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 CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err(int64_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; +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointChannelIdZ_get_a(owner_conv); + int64_t ret_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; +} +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointChannelIdZ* owner_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(owner); + LDKChannelId ret_var = C2Tuple_OutPointChannelIdZ_get_b(owner_conv); + int64_t ret_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; +} +int64_t CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKOutPoint ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(owner_conv); + int64_t ret_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); +} +int64_tArray CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(int64_t owner) { + LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ* owner_conv = (LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ*)untag_ptr(owner); + LDKCVec_MonitorUpdateIdZ ret_var = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(owner_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t r = 0; r < ret_var.datalen; r++) { + LDKMonitorUpdateId ret_conv_17_var = ret_var.data[r]; + int64_t ret_conv_17_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_17_var); + ret_conv_17_ref = tag_ptr(ret_conv_17_var.inner, ret_conv_17_var.is_owned); + ret_arr_ptr[r] = ret_conv_17_ref; + } + + FREE(ret_var.data); + return ret_arr; +} + +static inline LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ CVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ_clone(const LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ *orig) { + LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ) * orig->datalen, "LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ clone bytes"), .datalen = orig->datalen }; + for (size_t i = 0; i < ret.datalen; i++) { + ret.data[i] = C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone(&orig->data[i]); + } + return ret; +} +typedef struct LDKPersister_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKPersister_JCalls; +static void LDKPersister_JCalls_free(void* this_arg) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +LDKCResult_NoneIOErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + LDKChannelManager channel_manager_var = *channel_manager; + int64_t channel_manager_ref = 0; + // 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_l_l(j_calls->instance_ptr, 64, channel_manager_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_NoneIOErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + LDKNetworkGraph network_graph_var = *network_graph; + int64_t network_graph_ref = 0; + // 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_l_l(j_calls->instance_ptr, 65, network_graph_ref); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +LDKCResult_NoneIOErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKWriteableScore * scorer) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg; + // WARNING: This object doesn't live past this scope, needs clone! + int64_t ret_scorer = tag_ptr(scorer, false); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 66, ret_scorer); + void* ret_ptr = untag_ptr(ret); + CHECK_ACCESS(ret_ptr); + LDKCResult_NoneIOErrorZ ret_conv = *(LDKCResult_NoneIOErrorZ*)(ret_ptr); + FREE(untag_ptr(ret)); + return ret_conv; +} +static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) { + LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg; + atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release); +} +static inline LDKPersister LDKPersister_init (int64_t o) { + LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls"); atomic_init(&calls->refcnt, 1); calls->instance_ptr = o; - LDKFutureCallback ret = { + LDKPersister ret = { .this_arg = (void*) calls, - .call = call_LDKFutureCallback_jcall, - .free = LDKFutureCallback_JCalls_free, + .persist_manager = persist_manager_LDKPersister_jcall, + .persist_graph = persist_graph_LDKPersister_jcall, + .persist_scorer = persist_scorer_LDKPersister_jcall, + .free = LDKPersister_JCalls_free, }; return ret; } -uint64_t CS_LDK_LDKFutureCallback_new(int32_t o) { - LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); - *res_ptr = LDKFutureCallback_init(o); +uint64_t CS_LDK_LDKPersister_new(int32_t o) { + LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister"); + *res_ptr = LDKPersister_init(o); return tag_ptr(res_ptr, true); } -void CS_LDK_FutureCallback_call(int64_t this_arg) { +int64_t CS_LDK_Persister_persist_manager(int64_t this_arg, int64_t channel_manager) { 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); + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKChannelManager channel_manager_conv; + channel_manager_conv.inner = untag_ptr(channel_manager); + channel_manager_conv.is_owned = ptr_is_owned(channel_manager); + CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv); + channel_manager_conv.is_owned = false; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Persister_persist_graph(int64_t this_arg, int64_t network_graph) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + LDKNetworkGraph network_graph_conv; + network_graph_conv.inner = untag_ptr(network_graph); + network_graph_conv.is_owned = ptr_is_owned(network_graph); + CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv); + network_graph_conv.is_owned = false; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_Persister_persist_scorer(int64_t this_arg, int64_t scorer) { + void* this_arg_ptr = untag_ptr(this_arg); + if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } + LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr; + void* scorer_ptr = untag_ptr(scorer); + if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); } + LDKWriteableScore* scorer_conv = (LDKWriteableScore*)scorer_ptr; + LDKCResult_NoneIOErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneIOErrorZ), "LDKCResult_NoneIOErrorZ"); + *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, scorer_conv); + return tag_ptr(ret_conv, true); +} + +typedef struct LDKPersist_JCalls { + atomic_size_t refcnt; + uint32_t instance_ptr; +} LDKPersist_JCalls; +static void LDKPersist_JCalls_free(void* this_arg) { + LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg; + if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) { + FREE(j_calls); + } +} +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_funding_outpoint_var = channel_funding_outpoint; + int64_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; + int64_t data_ref = 0; + data_var = ChannelMonitor_clone(&data_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); + data_ref = tag_ptr(data_var.inner, data_var.is_owned); + LDKMonitorUpdateId update_id_var = update_id; + int64_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_ChannelMonitorUpdateStatus_lll(j_calls->instance_ptr, 67, channel_funding_outpoint_ref, data_ref, update_id_ref); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(ret); + return ret_conv; +} +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_funding_outpoint_var = channel_funding_outpoint; + int64_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; + int64_t update_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var); + update_ref = tag_ptr(update_var.inner, update_var.is_owned); + LDKChannelMonitor data_var = *data; + int64_t data_ref = 0; + data_var = ChannelMonitor_clone(&data_var); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var); + data_ref = tag_ptr(data_var.inner, data_var.is_owned); + LDKMonitorUpdateId update_id_var = update_id; + int64_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_ChannelMonitorUpdateStatus_llll(j_calls->instance_ptr, 68, channel_funding_outpoint_ref, update_ref, data_ref, update_id_ref); + LDKChannelMonitorUpdateStatus ret_conv = LDKChannelMonitorUpdateStatus_from_cs(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; + int64_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_void_l(j_calls->instance_ptr, 69, channel_funding_outpoint_ref); +} +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); +} +static inline LDKPersist LDKPersist_init (int64_t o) { + LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls"); + atomic_init(&calls->refcnt, 1); + calls->instance_ptr = o; + + LDKPersist ret = { + .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; +} +uint64_t CS_LDK_LDKPersist_new(int32_t o) { + LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist"); + *res_ptr = LDKPersist_init(o); + return tag_ptr(res_ptr, true); +} +int32_t CS_LDK_Persist_persist_new_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t data, int64_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_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); + data_conv.is_owned = false; + LDKMonitorUpdateId update_id_conv; + update_id_conv.inner = untag_ptr(update_id); + 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); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_funding_outpoint_conv, &data_conv, update_id_conv)); + return ret_conv; +} + +int32_t CS_LDK_Persist_update_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint, int64_t update, int64_t data, int64_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_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); + CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv); + update_conv = ChannelMonitorUpdate_clone(&update_conv); + LDKChannelMonitor data_conv; + data_conv.inner = untag_ptr(data); + data_conv.is_owned = ptr_is_owned(data); + CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv); + data_conv.is_owned = false; + LDKMonitorUpdateId update_id_conv; + update_id_conv.inner = untag_ptr(update_id); + 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); + int32_t ret_conv = LDKChannelMonitorUpdateStatus_to_cs((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; +} + +void CS_LDK_Persist_archive_persisted_channel(int64_t this_arg, int64_t channel_funding_outpoint) { + 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_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 { @@ -13463,7 +14756,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_void_lli(j_calls->instance_ptr, 68, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 70, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); } void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg; @@ -13471,14 +14764,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_void_li(j_calls->instance_ptr, 69, (int64_t)block_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 71, (int64_t)block_arr, height_conv); } 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_void_li(j_calls->instance_ptr, 70, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 72, (int64_t)header_arr, height_conv); } static void LDKListen_JCalls_cloned(LDKListen* new_obj) { LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg; @@ -13578,24 +14871,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_void_lli(j_calls->instance_ptr, 71, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); + js_invoke_function_void_lli(j_calls->instance_ptr, 73, (int64_t)header_arr, (int64_t)txdata_arr, height_conv); } 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_void_l(j_calls->instance_ptr, 72, (int64_t)txid_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 74, (int64_t)txid_arr); } 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_void_li(j_calls->instance_ptr, 73, (int64_t)header_arr, height_conv); + js_invoke_function_void_li(j_calls->instance_ptr, 75, (int64_t)header_arr, height_conv); } LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) { LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 74); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 76); LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13705,6 +14998,68 @@ int64_tArray CS_LDK_Confirm_get_relevant_txids(int64_t this_arg) { return ret_arr; } +uint32_t CS_LDK_LDKSpendingDelay_ty_from_ptr(int64_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 CS_LDK_LDKSpendingDelay_Relative_get_num_blocks(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + CHECK(obj->tag == LDKSpendingDelay_Relative); + int32_t num_blocks_conv = obj->relative.num_blocks; + return num_blocks_conv; +} +int32_t CS_LDK_LDKSpendingDelay_Absolute_get_height(int64_t ptr) { + LDKSpendingDelay *obj = (LDKSpendingDelay*)untag_ptr(ptr); + CHECK(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_void_(j_calls->instance_ptr, 77); +} +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 (int64_t 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 CS_LDK_LDKFutureCallback_new(int32_t o) { + LDKFutureCallback *res_ptr = MALLOC(sizeof(LDKFutureCallback), "LDKFutureCallback"); + *res_ptr = LDKFutureCallback_init(o); + return tag_ptr(res_ptr, true); +} +void CS_LDK_FutureCallback_call(int64_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; @@ -13720,7 +15075,7 @@ void handle_event_LDKEventHandler_jcall(const void* this_arg, LDKEvent event) { LDKEvent *event_copy = MALLOC(sizeof(LDKEvent), "LDKEvent"); *event_copy = event; int64_t event_ref = tag_ptr(event_copy, true); - js_invoke_function_void_l(j_calls->instance_ptr, 75, event_ref); + js_invoke_function_void_l(j_calls->instance_ptr, 78, event_ref); } static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) { LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg; @@ -13768,7 +15123,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_void_l(j_calls->instance_ptr, 76, tag_ptr(handler_ret, true)); + js_invoke_function_void_l(j_calls->instance_ptr, 79, tag_ptr(handler_ret, true)); } static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) { LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg; @@ -13833,7 +15188,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 77); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 80); LDKCVec_MessageSendEventZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -13912,7 +15267,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_void_ll(j_calls->instance_ptr, 78, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 81, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13923,7 +15278,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_void_ll(j_calls->instance_ptr, 79, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 82, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13934,7 +15289,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_void_ll(j_calls->instance_ptr, 80, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 83, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13945,7 +15300,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_void_ll(j_calls->instance_ptr, 81, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 84, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13956,7 +15311,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_void_ll(j_calls->instance_ptr, 82, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 85, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13967,7 +15322,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_void_ll(j_calls->instance_ptr, 83, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 86, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -13978,7 +15333,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_void_ll(j_calls->instance_ptr, 84, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 87, (int64_t)their_node_id_arr, msg_ref); } void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKShutdown * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -13989,7 +15344,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_void_ll(j_calls->instance_ptr, 85, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 88, (int64_t)their_node_id_arr, msg_ref); } 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; @@ -14000,7 +15355,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_void_ll(j_calls->instance_ptr, 86, (int64_t)their_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 89, (int64_t)their_node_id_arr, msg_ref); } void handle_stfu_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKStfu * msg) { LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg; @@ -14011,39 +15366,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_void_ll(j_calls->instance_ptr, 87, (int64_t)their_node_id_arr, msg_ref); -} -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; - int64_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_void_ll(j_calls->instance_ptr, 88, (int64_t)their_node_id_arr, msg_ref); -} -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; - int64_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_void_ll(j_calls->instance_ptr, 89, (int64_t)their_node_id_arr, msg_ref); -} -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; - int64_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_void_ll(j_calls->instance_ptr, 90, (int64_t)their_node_id_arr, msg_ref); } void handle_tx_add_input_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKTxAddInput * msg) { @@ -14340,9 +15662,6 @@ static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (int64_t 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, @@ -14529,51 +15848,6 @@ void CS_LDK_ChannelMessageHandler_handle_stfu(int64_t this_arg, int8_tArray the (this_arg_conv->handle_stfu)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv); } -void CS_LDK_ChannelMessageHandler_handle_splice(int64_t this_arg, int8_tArray their_node_id, int64_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 CS_LDK_ChannelMessageHandler_handle_splice_ack(int64_t this_arg, int8_tArray their_node_id, int64_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 CS_LDK_ChannelMessageHandler_handle_splice_locked(int64_t this_arg, int8_tArray their_node_id, int64_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 CS_LDK_ChannelMessageHandler_handle_tx_add_input(int64_t this_arg, int8_tArray their_node_id, int64_t msg) { void* this_arg_ptr = untag_ptr(this_arg); if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); } @@ -15033,6 +16307,55 @@ int64_tArray CS_LDK_OffersMessageHandler_release_pending_messages(int64_t this_ 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_l_l(j_calls->instance_ptr, 118, short_channel_id_conv); + 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 (int64_t 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 CS_LDK_LDKNodeIdLookUp_new(int32_t o) { + LDKNodeIdLookUp *res_ptr = MALLOC(sizeof(LDKNodeIdLookUp), "LDKNodeIdLookUp"); + *res_ptr = LDKNodeIdLookUp_init(o); + return tag_ptr(res_ptr, true); +} +int8_tArray CS_LDK_NodeIdLookUp_next_node_id(int64_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; @@ -15051,7 +16374,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_l_l(j_calls->instance_ptr, 118, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 119, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -15065,7 +16388,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_l_l(j_calls->instance_ptr, 119, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 120, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -15079,7 +16402,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_l_l(j_calls->instance_ptr, 120, msg_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 121, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr); @@ -15089,7 +16412,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_l_l(j_calls->instance_ptr, 121, starting_point_conv); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 122, starting_point_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_conv = *(LDKCOption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ*)(ret_ptr); @@ -15102,7 +16425,7 @@ LDKNodeAnnouncement get_next_node_announcement_LDKRoutingMessageHandler_jcall(co int64_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_l_l(j_calls->instance_ptr, 122, starting_point_ref); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 123, starting_point_ref); LDKNodeAnnouncement ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15119,7 +16442,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_l_llb(j_calls->instance_ptr, 123, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 124, (int64_t)their_node_id_arr, init_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -15134,7 +16457,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandl int64_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_l_ll(j_calls->instance_ptr, 124, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 125, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15149,7 +16472,7 @@ LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMess int64_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_l_ll(j_calls->instance_ptr, 125, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 126, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15164,7 +16487,7 @@ LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandl int64_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_l_ll(j_calls->instance_ptr, 126, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 127, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15179,7 +16502,7 @@ LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageH int64_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_l_ll(j_calls->instance_ptr, 127, (int64_t)their_node_id_arr, msg_ref); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 128, (int64_t)their_node_id_arr, msg_ref); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15188,11 +16511,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_b_(j_calls->instance_ptr, 128); + return js_invoke_function_b_(j_calls->instance_ptr, 129); } LDKNodeFeatures provided_node_features_LDKRoutingMessageHandler_jcall(const void* this_arg) { LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 129); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 130); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15203,7 +16526,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_l_l(j_calls->instance_ptr, 130, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 131, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15444,7 +16767,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 131); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 132); LDKCVec_C2Tuple_PublicKeyCVec_SocketAddressZZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15472,13 +16795,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_void_ll(j_calls->instance_ptr, 132, (int64_t)peer_node_id_arr, msg_ref); + js_invoke_function_void_ll(j_calls->instance_ptr, 133, (int64_t)peer_node_id_arr, msg_ref); } 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_l_l(j_calls->instance_ptr, 133, (int64_t)peer_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 134, (int64_t)peer_node_id_arr); LDKOnionMessage ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15495,7 +16818,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_l_llb(j_calls->instance_ptr, 134, (int64_t)their_node_id_arr, init_ref, inbound_conv); + uint64_t ret = js_invoke_function_l_llb(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr, init_ref, inbound_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr); @@ -15506,15 +16829,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_void_l(j_calls->instance_ptr, 135, (int64_t)their_node_id_arr); + js_invoke_function_void_l(j_calls->instance_ptr, 136, (int64_t)their_node_id_arr); } void timer_tick_occurred_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 136); + js_invoke_function_void_(j_calls->instance_ptr, 137); } LDKNodeFeatures provided_node_features_LDKOnionMessageHandler_jcall(const void* this_arg) { LDKOnionMessageHandler_JCalls *j_calls = (LDKOnionMessageHandler_JCalls*) this_arg; - uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 137); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 138); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15525,7 +16848,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_l_l(j_calls->instance_ptr, 138, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 139, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15682,7 +17005,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_l_sl(j_calls->instance_ptr, 139, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_sl(j_calls->instance_ptr, 140, message_type_conv, (int64_t)buffer_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr); @@ -15740,7 +17063,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_l_ll(j_calls->instance_ptr, 140, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 141, tag_ptr(msg_ret, true), (int64_t)sender_node_id_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr); @@ -15749,7 +17072,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 141); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 142); LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -15770,7 +17093,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_l_(j_calls->instance_ptr, 142); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 143); LDKNodeFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15781,7 +17104,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_l_l(j_calls->instance_ptr, 143, (int64_t)their_node_id_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 144, (int64_t)their_node_id_arr); LDKInitFeatures ret_conv; ret_conv.inner = untag_ptr(ret); ret_conv.is_owned = ptr_is_owned(ret); @@ -15891,7 +17214,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_l_l(j_calls->instance_ptr, 144, tag_ptr(msg_ret, true)); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 145, tag_ptr(msg_ret, true)); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCOption_OnionMessageContentsZ ret_conv = *(LDKCOption_OnionMessageContentsZ*)(ret_ptr); @@ -15904,7 +17227,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_l_ll(j_calls->instance_ptr, 145, message_type_conv, (int64_t)buffer_arr); + uint64_t ret = js_invoke_function_l_ll(j_calls->instance_ptr, 146, message_type_conv, (int64_t)buffer_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_COption_OnionMessageContentsZDecodeErrorZ ret_conv = *(LDKCResult_COption_OnionMessageContentsZDecodeErrorZ*)(ret_ptr); @@ -15913,7 +17236,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; - int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 146); + int64_tArray ret = (int64_tArray)js_invoke_function_l_(j_calls->instance_ptr, 147); LDKCVec_C3Tuple_OnionMessageContentsDestinationBlindedPathZZ ret_constr; ret_constr.datalen = ret->arr_len; if (ret_constr.datalen > 0) @@ -16019,21 +17342,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_l_lb(j_calls->instance_ptr, 147, (int64_t)data_arr, resume_read_conv); + return js_invoke_function_l_lb(j_calls->instance_ptr, 148, (int64_t)data_arr, resume_read_conv); } void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - js_invoke_function_void_(j_calls->instance_ptr, 148); + js_invoke_function_void_(j_calls->instance_ptr, 149); } 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_b_l(j_calls->instance_ptr, 149, tag_ptr(other_arg_clone, true)); + return js_invoke_function_b_l(j_calls->instance_ptr, 150, tag_ptr(other_arg_clone, true)); } uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg; - return js_invoke_function_l_(j_calls->instance_ptr, 150); + return js_invoke_function_l_(j_calls->instance_ptr, 151); } static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) { LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg; @@ -16087,6 +17410,138 @@ int64_t CS_LDK_SocketDescriptor_hash(int64_t this_arg) { 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; + int64_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_l_l(j_calls->instance_ptr, 152, message_ref); + 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 (int64_t 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 CS_LDK_LDKSignBolt12InvoiceFn_new(int32_t o) { + LDKSignBolt12InvoiceFn *res_ptr = MALLOC(sizeof(LDKSignBolt12InvoiceFn), "LDKSignBolt12InvoiceFn"); + *res_ptr = LDKSignBolt12InvoiceFn_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_SignBolt12InvoiceFn_sign_invoice(int64_t this_arg, int64_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; + int64_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_l_l(j_calls->instance_ptr, 153, message_ref); + 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 (int64_t 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 CS_LDK_LDKSignInvoiceRequestFn_new(int32_t o) { + LDKSignInvoiceRequestFn *res_ptr = MALLOC(sizeof(LDKSignInvoiceRequestFn), "LDKSignInvoiceRequestFn"); + *res_ptr = LDKSignInvoiceRequestFn_init(o); + return tag_ptr(res_ptr, true); +} +int64_t CS_LDK_SignInvoiceRequestFn_sign_invoice_request(int64_t this_arg, int64_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 CS_LDK_LDKSignError_ty_from_ptr(int64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + switch(obj->tag) { + case LDKSignError_Signing: return 0; + case LDKSignError_Verification: return 1; + default: abort(); + } +} +int32_t CS_LDK_LDKSignError_Verification_get_verification(int64_t ptr) { + LDKSignError *obj = (LDKSignError*)untag_ptr(ptr); + CHECK(obj->tag == LDKSignError_Verification); + int32_t verification_conv = LDKSecp256k1Error_to_cs(obj->verification); + return verification_conv; +} uint32_t CS_LDK_LDKEffectiveCapacity_ty_from_ptr(int64_t ptr) { LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr); switch(obj->tag) { @@ -16215,7 +17670,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_l_(j_calls->instance_ptr, 151); + int8_tArray ret = (int8_tArray)js_invoke_function_l_(j_calls->instance_ptr, 154); LDKCVec_u8Z ret_ref; ret_ref.datalen = ret->arr_len; ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes"); @@ -16260,6 +17715,33 @@ int8_tArray CS_LDK_Score_write(int64_t this_arg) { return ret_arr; } +uint32_t CS_LDK_LDKIntroductionNode_ty_from_ptr(int64_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 CS_LDK_LDKIntroductionNode_NodeId_get_node_id(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(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; +} +int32_t CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__0(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(obj->tag == LDKIntroductionNode_DirectedShortChannelId); + int32_t _0_conv = LDKDirection_to_cs(obj->directed_short_channel_id._0); + return _0_conv; +} +int64_t CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__1(int64_t ptr) { + LDKIntroductionNode *obj = (LDKIntroductionNode*)untag_ptr(ptr); + CHECK(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; @@ -16299,7 +17781,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_l_llli(j_calls->instance_ptr, 152, (int64_t)claim_id_arr, (int64_t)must_spend_arr, (int64_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv); + uint64_t ret = js_invoke_function_l_llli(j_calls->instance_ptr, 155, (int64_t)claim_id_arr, (int64_t)must_spend_arr, (int64_t)must_pay_to_arr, target_feerate_sat_per_1000_weight_conv); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CoinSelectionNoneZ ret_conv = *(LDKCResult_CoinSelectionNoneZ*)(ret_ptr); @@ -16312,7 +17794,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_l_l(j_calls->instance_ptr, 153, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 156, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -16411,7 +17893,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_l_(j_calls->instance_ptr, 154); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 157); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_UtxoZNoneZ ret_conv = *(LDKCResult_CVec_UtxoZNoneZ*)(ret_ptr); @@ -16420,7 +17902,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_l_(j_calls->instance_ptr, 155); + uint64_t ret = js_invoke_function_l_(j_calls->instance_ptr, 158); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_CVec_u8ZNoneZ ret_conv = *(LDKCResult_CVec_u8ZNoneZ*)(ret_ptr); @@ -16433,7 +17915,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_l_l(j_calls->instance_ptr, 156, (int64_t)psbt_arr); + uint64_t ret = js_invoke_function_l_l(j_calls->instance_ptr, 159, (int64_t)psbt_arr); void* ret_ptr = untag_ptr(ret); CHECK_ACCESS(ret_ptr); LDKCResult_TransactionNoneZ ret_conv = *(LDKCResult_TransactionNoneZ*)(ret_ptr); @@ -16651,6 +18133,24 @@ int64_t CS_LDK_BigEndianScalar_new(int8_tArray big_endian_bytes) { 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 CS_LDK_BigEndianScalar_clone_ptr(int64_t arg) { + LDKBigEndianScalar* arg_conv = (LDKBigEndianScalar*)untag_ptr(arg); + int64_t ret_conv = BigEndianScalar_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_BigEndianScalar_clone(int64_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); @@ -16817,6 +18317,116 @@ void CS_LDK_Str_free(jstring _res) { Str_free(dummy); } +void CS_LDK_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); +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_RefundBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_RefundBolt12SemanticErrorZ* o_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_RefundBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_RefundBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_RefundBolt12SemanticErrorZ* arg_conv = (LDKCResult_RefundBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_RefundBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_u64Z_some(int64_t o) { LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z"); *ret_copy = COption_u64Z_some(o); @@ -17123,14 +18733,6 @@ int64_t CS_LDK_COption_ThirtyTwoBytesZ_clone(int64_t orig) { return ret_ref; } -void CS_LDK_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); -} - int64_t CS_LDK_COption_CVec_u8ZZ_some(int8_tArray o) { LDKCVec_u8Z o_ref; o_ref.datalen = o->arr_len; @@ -17339,6 +18941,156 @@ int64_t CS_LDK_CResult_RecipientOnionFieldsNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* o_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ* arg_conv = (LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_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); +} + +int64_t CS_LDK_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 CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok(int64_t o) { + LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_SchnorrSignatureNoneZ_free(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr(int64_t arg) { + LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_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 CS_LDK_CVec_ThirtyTwoBytesZ_free(ptrArray _res) { LDKCVec_ThirtyTwoBytesZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -17416,6 +19168,100 @@ int64_t CS_LDK_COption_CVec_ThirtyTwoBytesZZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_COption_AmountZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_AmountZ_none() { + LDKCOption_AmountZ *ret_copy = MALLOC(sizeof(LDKCOption_AmountZ), "LDKCOption_AmountZ"); + *ret_copy = COption_AmountZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_AmountZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_AmountZ_clone_ptr(int64_t arg) { + LDKCOption_AmountZ* arg_conv = (LDKCOption_AmountZ*)untag_ptr(arg); + int64_t ret_conv = COption_AmountZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_AmountZ_clone(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_QuantityZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_QuantityZ_none() { + LDKCOption_QuantityZ *ret_copy = MALLOC(sizeof(LDKCOption_QuantityZ), "LDKCOption_QuantityZ"); + *ret_copy = COption_QuantityZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_QuantityZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_QuantityZ_clone_ptr(int64_t arg) { + LDKCOption_QuantityZ* arg_conv = (LDKCOption_QuantityZ*)untag_ptr(arg); + int64_t ret_conv = COption_QuantityZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_QuantityZ_clone(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_CResult_ThirtyTwoBytesNoneZ_ok(int8_tArray o) { LDKThirtyTwoBytes o_ref; CHECK(o->arr_len == 32); @@ -18053,7 +19899,7 @@ int64_t CS_LDK_COption_BigEndianScalarZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); LDKBigEndianScalar o_conv = *(LDKBigEndianScalar*)(o_ptr); - // WARNING: we may need a move here but no clone is available for LDKBigEndianScalar + 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); int64_t ret_ref = tag_ptr(ret_copy, true); @@ -18161,54 +20007,6 @@ int64_t CS_LDK_CResult_RecoverableSignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_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); -} - -int64_t CS_LDK_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 CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok(int64_t o) { - LDKCResult_SchnorrSignatureNoneZ* o_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_SchnorrSignatureNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_SchnorrSignatureNoneZ_free(int64_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 CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr(int64_t arg) { - LDKCResult_SchnorrSignatureNoneZ* arg_conv = (LDKCResult_SchnorrSignatureNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_SchnorrSignatureNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_SchnorrSignatureNoneZ_clone(int64_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); -} - int64_t CS_LDK_CResult_ECDSASignatureNoneZ_ok(int8_tArray o) { LDKECDSASignature o_ref; CHECK(o->arr_len == 64); @@ -18257,6 +20055,56 @@ int64_t CS_LDK_CResult_ECDSASignatureNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_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 CS_LDK_CResult_TransactionNoneZ_is_ok(int64_t o) { + LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); + jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TransactionNoneZ_free(int64_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 CS_LDK_CResult_TransactionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_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); +} + int64_t CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -18721,56 +20569,6 @@ int64_t CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_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); -} - -int64_t CS_LDK_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 CS_LDK_CResult_TransactionNoneZ_is_ok(int64_t o) { - LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_TransactionNoneZ_free(int64_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 CS_LDK_CResult_TransactionNoneZ_clone_ptr(int64_t arg) { - LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg); - int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_TransactionNoneZ_clone(int64_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); -} - int64_t CS_LDK_COption_WriteableScoreZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -20028,6 +21826,60 @@ void CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_free(int64_t _res) { CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv); } +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_err(int64_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 CS_LDK_CResult_BestBlockDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_BestBlockDecodeErrorZ* o_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_BestBlockDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_BestBlockDecodeErrorZ_free(int64_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 CS_LDK_CResult_BestBlockDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_BestBlockDecodeErrorZ* arg_conv = (LDKCResult_BestBlockDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_BestBlockDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_BestBlockDecodeErrorZ_clone(int64_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); @@ -20212,81 +22064,86 @@ void CS_LDK_CVec_MonitorEventZ_free(int64_tArray _res) { 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 CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(int64_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 CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(int64_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; } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(int64_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); +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(int64_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); } -int64_t CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(int64_t a, int64_tArray b, int8_tArray c) { +int64_t CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(int64_t a, int64_t b, int64_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; - int64_t* b_vals = b->elems; - for (size_t o = 0; o < b_constr.datalen; o++) { - int64_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 CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(int64_t _res) { + c_constr.data = NULL; + int64_t* c_vals = c->elems; + for (size_t o = 0; o < c_constr.datalen; o++) { + int64_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 CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(int64_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 CS_LDK_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(int64_tArray _res) { - LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr; +void CS_LDK_CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(int64_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; int64_t* _res_vals = _res->elems; - for (size_t x = 0; x < _res_constr.datalen; x++) { - int64_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++) { + int64_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); } int64_t CS_LDK_CResult_InitFeaturesDecodeErrorZ_ok(int64_t o) { @@ -20667,6 +22524,225 @@ int64_t CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_err(int64_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 CS_LDK_CResult_OfferIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OfferIdDecodeErrorZ* o_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferIdDecodeErrorZ_free(int64_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 CS_LDK_CResult_OfferIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferIdDecodeErrorZ* arg_conv = (LDKCResult_OfferIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferIdDecodeErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok() { + LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); + *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_NoneBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_OfferBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_OfferBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_ok(int64_t o) { LDKOffer o_conv; o_conv.inner = untag_ptr(o); @@ -20722,55 +22798,6 @@ int64_t CS_LDK_CResult_OfferBolt12ParseErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_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); -} - -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err(int32_t e) { - LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok(int64_t o) { - LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free(int64_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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { - LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone(int64_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); -} - int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_ok(int64_t o) { LDKNodeId o_conv; o_conv.inner = untag_ptr(o); @@ -20825,6 +22852,55 @@ int64_t CS_LDK_CResult_NodeIdDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err(int32_t e) { + LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_cs(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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok(int64_t o) { + LDKCResult_PublicKeySecp256k1ErrorZ* o_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PublicKeySecp256k1ErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free(int64_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 CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PublicKeySecp256k1ErrorZ* arg_conv = (LDKCResult_PublicKeySecp256k1ErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PublicKeySecp256k1ErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_NetworkUpdateZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -21610,6 +23686,34 @@ int64_t CS_LDK_COption_CVec_SocketAddressZZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_CResult_u64ShortChannelIdErrorZ_err(int32_t e) { + LDKShortChannelIdError e_conv = LDKShortChannelIdError_from_cs(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 CS_LDK_CResult_u64ShortChannelIdErrorZ_is_ok(int64_t o) { + LDKCResult_u64ShortChannelIdErrorZ* o_conv = (LDKCResult_u64ShortChannelIdErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_u64ShortChannelIdErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_u64ShortChannelIdErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_ok(int64_t o) { LDKPendingHTLCInfo o_conv; o_conv.inner = untag_ptr(o); @@ -21626,8 +23730,7 @@ int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_err(int64_t e) { 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); @@ -21648,6 +23751,24 @@ void CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_free(int64_t _res) { 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 CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(int64_t arg) { + LDKCResult_PendingHTLCInfoInboundHTLCErrZ* arg_conv = (LDKCResult_PendingHTLCInfoInboundHTLCErrZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone(int64_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 CS_LDK_CVec_HTLCOutputInCommitmentZ_free(int64_tArray _res) { LDKCVec_HTLCOutputInCommitmentZ _res_constr; _res_constr.datalen = _res->arr_len; @@ -21887,6 +24008,53 @@ int64_t CS_LDK_CResult_CVec_UtxoZNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_COption_PaymentContextZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_PaymentContextZ_none() { + LDKCOption_PaymentContextZ *ret_copy = MALLOC(sizeof(LDKCOption_PaymentContextZ), "LDKCOption_PaymentContextZ"); + *ret_copy = COption_PaymentContextZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_PaymentContextZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_PaymentContextZ_clone_ptr(int64_t arg) { + LDKCOption_PaymentContextZ* arg_conv = (LDKCOption_PaymentContextZ*)untag_ptr(arg); + int64_t ret_conv = COption_PaymentContextZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_PaymentContextZ_clone(int64_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); + int64_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); @@ -22011,55 +24179,57 @@ int64_t CS_LDK_COption_ChannelShutdownStateZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_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); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_ok(int64_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); } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err(int64_t e) { +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_err(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(int64_t o) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); +jboolean CS_LDK_CResult_ChannelIdAPIErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdAPIErrorZ* o_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdAPIErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free(int64_t _res) { +void CS_LDK_CResult_ChannelIdAPIErrorZ_free(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(int64_t arg) { - LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdAPIErrorZ* arg_conv = (LDKCResult_ChannelIdAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdAPIErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_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); +int64_t CS_LDK_CResult_ChannelIdAPIErrorZ_clone(int64_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); } @@ -22456,63 +24626,136 @@ int64_t CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFail 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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(int64_t arg) { - LDKC2Tuple_ThirtyTwoBytesPublicKeyZ* arg_conv = (LDKC2Tuple_ThirtyTwoBytesPublicKeyZ*)untag_ptr(arg); - int64_t ret_conv = C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(arg_conv); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone_ptr(int64_t arg) { + LDKC2Tuple_ChannelIdPublicKeyZ* arg_conv = (LDKC2Tuple_ChannelIdPublicKeyZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_ChannelIdPublicKeyZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(int64_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); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone(int64_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); } -int64_t CS_LDK_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); +int64_t CS_LDK_C2Tuple_ChannelIdPublicKeyZ_new(int64_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 CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_free(int64_t _res) { +void CS_LDK_C2Tuple_ChannelIdPublicKeyZ_free(int64_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 CS_LDK_CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res_constr; +void CS_LDK_CVec_C2Tuple_ChannelIdPublicKeyZZ_free(int64_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; int64_t* _res_vals = _res->elems; - for (size_t j = 0; j < _res_constr.datalen; j++) { - int64_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++) { + int64_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 CS_LDK_CVec_ChannelIdZ_free(int64_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; + int64_t* _res_vals = _res->elems; + for (size_t l = 0; l < _res_constr.datalen; l++) { + int64_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); +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ* arg_conv = (LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(int64_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); } int64_t CS_LDK_COption_StrZ_some(jstring o) { @@ -22559,52 +24802,6 @@ int64_t CS_LDK_COption_StrZ_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok() { - LDKCResult_NoneBolt12SemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneBolt12SemanticErrorZ), "LDKCResult_NoneBolt12SemanticErrorZ"); - *ret_conv = CResult_NoneBolt12SemanticErrorZ_ok(); - return tag_ptr(ret_conv, true); -} - -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_err(int32_t e) { - LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok(int64_t o) { - LDKCResult_NoneBolt12SemanticErrorZ* o_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(o); - jboolean ret_conv = CResult_NoneBolt12SemanticErrorZ_is_ok(o_conv); - return ret_conv; -} - -void CS_LDK_CResult_NoneBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr(int64_t arg) { - LDKCResult_NoneBolt12SemanticErrorZ* arg_conv = (LDKCResult_NoneBolt12SemanticErrorZ*)untag_ptr(arg); - int64_t ret_conv = CResult_NoneBolt12SemanticErrorZ_clone_ptr(arg_conv); - return ret_conv; -} - -int64_t CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone(int64_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); -} - int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -22654,6 +24851,58 @@ int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(int64_t return tag_ptr(ret_conv, true); } +int64_t CS_LDK_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); +} + +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok(int64_t o) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* o_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free(int64_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 CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ThirtyTwoBytesAPIErrorZ* arg_conv = (LDKCResult_ThirtyTwoBytesAPIErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_OffersMessageZ_some(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -23976,27 +26225,6 @@ void CS_LDK_CVec_CommitmentTransactionZ_free(int64_tArray _res) { CVec_CommitmentTransactionZ_free(_res_constr); } -void CS_LDK_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 i = 0; i < _res_constr.datalen; i++) { - int8_tArray _res_conv_8 = _res_vals[i]; - LDKTransaction _res_conv_8_ref; - _res_conv_8_ref.datalen = _res_conv_8->arr_len; - _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); - memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); - _res_conv_8_ref.data_is_owned = true; - _res_constr.data[i] = _res_conv_8_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); @@ -24697,64 +26925,24 @@ int64_t CS_LDK_COption_SocketAddressZ_clone(int64_t orig) { 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 CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(int64_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; -} - -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(int64_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); -} - -int64_t CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_new(int8_tArray a, int64_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 CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_free(int64_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 CS_LDK_CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(int64_tArray _res) { - LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res_constr; +void CS_LDK_CVec_PeerDetailsZ_free(int64_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; int64_t* _res_vals = _res->elems; - for (size_t r = 0; r < _res_constr.datalen; r++) { - int64_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++) { + int64_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); } int64_t CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) { @@ -25200,6 +27388,108 @@ int64_t CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(int6 return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_free(int64_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 CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceRequestBolt12SemanticErrorZ* arg_conv = (LDKCResult_InvoiceRequestBolt12SemanticErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone(int64_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); +} + int64_t CS_LDK_COption_SecretKeyZ_some(int8_tArray o) { LDKSecretKey o_ref; CHECK(o->arr_len == 32); @@ -25246,6 +27536,40 @@ int64_t CS_LDK_COption_SecretKeyZ_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_ok(int64_t o) { LDKVerifiedInvoiceRequest o_conv; o_conv.inner = untag_ptr(o); @@ -25296,6 +27620,94 @@ int64_t CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(int32_t e) { + LDKBolt12SemanticError e_conv = LDKBolt12SemanticError_from_cs(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 CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ* o_conv = (LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_err(int64_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 CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* o_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_free(int64_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 CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_InvoiceRequestFieldsDecodeErrorZ* arg_conv = (LDKCResult_InvoiceRequestFieldsDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone(int64_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); +} + int32_t CS_LDK_COption_NoneZ_some() { int32_t ret_conv = LDKCOption_NoneZ_to_cs(COption_NoneZ_some()); return ret_conv; @@ -25332,6 +27744,52 @@ void CS_LDK_CVec_WitnessZ_free(ptrArray _res) { CVec_WitnessZ_free(_res_constr); } +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_ECDSASignatureZ_none() { + LDKCOption_ECDSASignatureZ *ret_copy = MALLOC(sizeof(LDKCOption_ECDSASignatureZ), "LDKCOption_ECDSASignatureZ"); + *ret_copy = COption_ECDSASignatureZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_ECDSASignatureZ_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_COption_ECDSASignatureZ_clone_ptr(int64_t arg) { + LDKCOption_ECDSASignatureZ* arg_conv = (LDKCOption_ECDSASignatureZ*)untag_ptr(arg); + int64_t ret_conv = COption_ECDSASignatureZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_COption_ECDSASignatureZ_clone(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_COption_i64Z_some(int64_t o) { LDKCOption_i64Z *ret_copy = MALLOC(sizeof(LDKCOption_i64Z), "LDKCOption_i64Z"); *ret_copy = COption_i64Z_some(o); @@ -29247,6 +31705,27 @@ int64_t CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(int64_t orig) return tag_ptr(ret_conv, true); } +void CS_LDK_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 i = 0; i < _res_constr.datalen; i++) { + int8_tArray _res_conv_8 = _res_vals[i]; + LDKTransaction _res_conv_8_ref; + _res_conv_8_ref.datalen = _res_conv_8->arr_len; + _res_conv_8_ref.data = MALLOC(_res_conv_8_ref.datalen, "LDKTransaction Bytes"); + memcpy(_res_conv_8_ref.data, _res_conv_8->elems, _res_conv_8_ref.datalen); FREE(_res_conv_8); + _res_conv_8_ref.data_is_owned = true; + _res_constr.data[i] = _res_conv_8_ref; + } + FREE(_res); + CVec_TransactionZ_free(_res_constr); +} + int64_t CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -30759,6 +33238,60 @@ int64_t CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_ok(int64_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_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_ok(o_conv); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_err(int64_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_ChannelIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelIdDecodeErrorZ), "LDKCResult_ChannelIdDecodeErrorZ"); + *ret_conv = CResult_ChannelIdDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_ChannelIdDecodeErrorZ* o_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_ChannelIdDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_ChannelIdDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_ChannelIdDecodeErrorZ _res_conv = *(LDKCResult_ChannelIdDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_ChannelIdDecodeErrorZ_free(_res_conv); +} + +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 CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_ChannelIdDecodeErrorZ* arg_conv = (LDKCResult_ChannelIdDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_ChannelIdDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_ChannelIdDecodeErrorZ_clone(int64_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); +} + 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); @@ -30903,98 +33436,218 @@ int64_t CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone(int64_t orig) { 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); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_ok(int64_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); } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(int64_t arg) { - LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); - int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_err(int64_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_PaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentContextDecodeErrorZ), "LDKCResult_PaymentContextDecodeErrorZ"); + *ret_conv = CResult_PaymentContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_PaymentContextDecodeErrorZ* o_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_PaymentContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(int64_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); +void CS_LDK_CResult_PaymentContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_PaymentContextDecodeErrorZ _res_conv = *(LDKCResult_PaymentContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_PaymentContextDecodeErrorZ_free(_res_conv); +} + +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 CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_PaymentContextDecodeErrorZ* arg_conv = (LDKCResult_PaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PaymentContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, int64_t b, int64_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); +int64_t CS_LDK_CResult_PaymentContextDecodeErrorZ_clone(int64_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); } -void CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(int64_t _res) { +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok(int64_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 = 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); +} + +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err(int64_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_UnknownPaymentContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnknownPaymentContextDecodeErrorZ), "LDKCResult_UnknownPaymentContextDecodeErrorZ"); + *ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* o_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free(int64_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_UnknownPaymentContextDecodeErrorZ _res_conv = *(LDKCResult_UnknownPaymentContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); + CResult_UnknownPaymentContextDecodeErrorZ_free(_res_conv); } -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_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_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 CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_UnknownPaymentContextDecodeErrorZ* arg_conv = (LDKCResult_UnknownPaymentContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err() { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ), "LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ"); - *ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_err(); +int64_t CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone(int64_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); } -jboolean CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(int64_t o) { - LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ* o_conv = (LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ*)untag_ptr(o); - jboolean ret_conv = CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(o_conv); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok(int64_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 = 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); +} + +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err(int64_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_Bolt12OfferContextDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_Bolt12OfferContextDecodeErrorZ), "LDKCResult_Bolt12OfferContextDecodeErrorZ"); + *ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_err(e_conv); + return tag_ptr(ret_conv, true); +} + +jboolean CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_is_ok(o_conv); return ret_conv; } -void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_t _res) { +void CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free(int64_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_Bolt12OfferContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12OfferContextDecodeErrorZ*)(_res_ptr); FREE(untag_ptr(_res)); - CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(_res_conv); + CResult_Bolt12OfferContextDecodeErrorZ_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_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 CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(int64_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 CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12OfferContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12OfferContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(arg_conv); return ret_conv; } -int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(int64_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); +int64_t CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* o_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free(int64_t _res) { + if (!ptr_is_owned(_res)) return; + void* _res_ptr = untag_ptr(_res); + CHECK_ACCESS(_res_ptr); + LDKCResult_Bolt12RefundContextDecodeErrorZ _res_conv = *(LDKCResult_Bolt12RefundContextDecodeErrorZ*)(_res_ptr); + FREE(untag_ptr(_res)); + CResult_Bolt12RefundContextDecodeErrorZ_free(_res_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 CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_Bolt12RefundContextDecodeErrorZ* arg_conv = (LDKCResult_Bolt12RefundContextDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone(int64_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); } @@ -31045,6 +33698,101 @@ int64_t CS_LDK_CResult_StrSecp256k1ErrorZ_clone(int64_t orig) { 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); + return tag_ptr(ret_conv, true); +} +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(int64_t arg) { + LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ* arg_conv = (LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ*)untag_ptr(arg); + int64_t ret_conv = C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(int64_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); +} + +int64_t CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(int8_tArray a, int64_t b, int64_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 CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(int64_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); + FREE(untag_ptr(_res)); + C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_free(_res_conv); +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(int64_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); +} + +int64_t CS_LDK_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); +} + +jboolean CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_is_ok(int64_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; +} + +void CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_free(int64_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); +} + +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 CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(int64_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; +} + +int64_t CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(int64_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); +} + int64_t CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -31175,6 +33923,24 @@ void CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZS CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(_res_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); +} +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(int64_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; +} + +int64_t CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(int64_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); +} + int64_t CS_LDK_CResult_PeeledOnionNoneZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -31206,6 +33972,24 @@ void CS_LDK_CResult_PeeledOnionNoneZ_free(int64_t _res) { CResult_PeeledOnionNoneZ_free(_res_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); +} +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone_ptr(int64_t arg) { + LDKCResult_PeeledOnionNoneZ* arg_conv = (LDKCResult_PeeledOnionNoneZ*)untag_ptr(arg); + int64_t ret_conv = CResult_PeeledOnionNoneZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_PeeledOnionNoneZ_clone(int64_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); +} + int64_t CS_LDK_CResult_SendSuccessSendErrorZ_ok(int64_t o) { void* o_ptr = untag_ptr(o); CHECK_ACCESS(o_ptr); @@ -31241,6 +34025,24 @@ void CS_LDK_CResult_SendSuccessSendErrorZ_free(int64_t _res) { CResult_SendSuccessSendErrorZ_free(_res_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 CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr(int64_t arg) { + LDKCResult_SendSuccessSendErrorZ* arg_conv = (LDKCResult_SendSuccessSendErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_SendSuccessSendErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_SendSuccessSendErrorZ_clone(int64_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 CS_LDK_CResult_BlindedPathNoneZ_ok(int64_t o) { LDKBlindedPath o_conv; o_conv.inner = untag_ptr(o); @@ -31522,6 +34324,261 @@ int64_t CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* o_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free(int64_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); +} + +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); +} +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_TrackedSpendableOutputDecodeErrorZ* arg_conv = (LDKCResult_TrackedSpendableOutputDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone(int64_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); +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSpendStatusDecodeErrorZ* o_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSpendStatusDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free(int64_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); +} + +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 CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(int64_t arg) { + LDKCResult_OutputSpendStatusDecodeErrorZ* arg_conv = (LDKCResult_OutputSpendStatusDecodeErrorZ*)untag_ptr(arg); + int64_t ret_conv = CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone(int64_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 CS_LDK_COption_FilterZ_some(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_COption_FilterZ_none() { + LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); + *ret_copy = COption_FilterZ_none(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_COption_FilterZ_free(int64_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); +} + +void CS_LDK_CVec_TrackedSpendableOutputZ_free(int64_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; + int64_t* _res_vals = _res->elems; + for (size_t y = 0; y < _res_constr.datalen; y++) { + int64_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); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_OutputSweeperDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok(int64_t o) { + LDKCResult_OutputSweeperDecodeErrorZ* o_conv = (LDKCResult_OutputSweeperDecodeErrorZ*)untag_ptr(o); + jboolean ret_conv = CResult_OutputSweeperDecodeErrorZ_is_ok(o_conv); + return ret_conv; +} + +void CS_LDK_CResult_OutputSweeperDecodeErrorZ_free(int64_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); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_new(int64_t a, int64_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); +} + +void CS_LDK_C2Tuple_BestBlockOutputSweeperZ_free(int64_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); +} + +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(int64_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); +} + +int64_t CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(int64_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); +} + +jboolean CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(int64_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; +} + +void CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(int64_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); +} + int64_t CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok(int64_t o) { LDKDelayedPaymentBasepoint o_conv; o_conv.inner = untag_ptr(o); @@ -31846,36 +34903,6 @@ int64_t CS_LDK_CResult_RevocationKeyDecodeErrorZ_clone(int64_t orig) { return tag_ptr(ret_conv, true); } -int64_t CS_LDK_COption_FilterZ_some(int64_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); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -int64_t CS_LDK_COption_FilterZ_none() { - LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ"); - *ret_copy = COption_FilterZ_none(); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_COption_FilterZ_free(int64_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); -} - int64_t CS_LDK_CResult_LockedChannelMonitorNoneZ_ok(int64_t o) { LDKLockedChannelMonitor o_conv; o_conv.inner = untag_ptr(o); @@ -31909,24 +34936,67 @@ void CS_LDK_CResult_LockedChannelMonitorNoneZ_free(int64_t _res) { CResult_LockedChannelMonitorNoneZ_free(_res_conv); } -void CS_LDK_CVec_OutPointZ_free(int64_tArray _res) { - LDKCVec_OutPointZ _res_constr; +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 CS_LDK_C2Tuple_OutPointChannelIdZ_clone_ptr(int64_t arg) { + LDKC2Tuple_OutPointChannelIdZ* arg_conv = (LDKC2Tuple_OutPointChannelIdZ*)untag_ptr(arg); + int64_t ret_conv = C2Tuple_OutPointChannelIdZ_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_clone(int64_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); +} + +int64_t CS_LDK_C2Tuple_OutPointChannelIdZ_new(int64_t a, int64_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 CS_LDK_C2Tuple_OutPointChannelIdZ_free(int64_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); +} + +void CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free(int64_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(LDKOutPoint), "LDKCVec_OutPointZ Elements"); + _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_OutPointChannelIdZ), "LDKCVec_C2Tuple_OutPointChannelIdZZ Elements"); else _res_constr.data = NULL; int64_t* _res_vals = _res->elems; - for (size_t k = 0; k < _res_constr.datalen; k++) { - int64_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; + for (size_t d = 0; d < _res_constr.datalen; d++) { + int64_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_OutPointZ_free(_res_constr); + CVec_C2Tuple_OutPointChannelIdZZ_free(_res_constr); } void CS_LDK_CVec_MonitorUpdateIdZ_free(int64_tArray _res) { @@ -32426,6 +35496,19 @@ int8_tArray CS_LDK_TransactionU16LenLimited_into_transaction(int64_t this_arg) return ret_arr; } +int8_tArray CS_LDK_TransactionU16LenLimited_as_transaction(int64_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; +} + int8_tArray CS_LDK_TransactionU16LenLimited_write(int64_t obj) { LDKTransactionU16LenLimited obj_conv; obj_conv.inner = untag_ptr(obj); @@ -32658,6 +35741,55 @@ int64_t CS_LDK_MonitorUpdatingPersister_as_Persist(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int32_t CS_LDK_ShortChannelIdError_clone(int64_t orig) { + LDKShortChannelIdError* orig_conv = (LDKShortChannelIdError*)untag_ptr(orig); + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_block_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_block_overflow()); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_tx_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_tx_index_overflow()); + return ret_conv; +} + +int32_t CS_LDK_ShortChannelIdError_vout_index_overflow() { + int32_t ret_conv = LDKShortChannelIdError_to_cs(ShortChannelIdError_vout_index_overflow()); + return ret_conv; +} + +jboolean CS_LDK_ShortChannelIdError_eq(int64_t a, int64_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; +} + +int32_t CS_LDK_block_from_scid(int64_t short_channel_id) { + int32_t ret_conv = block_from_scid(short_channel_id); + return ret_conv; +} + +int32_t CS_LDK_tx_index_from_scid(int64_t short_channel_id) { + int32_t ret_conv = tx_index_from_scid(short_channel_id); + return ret_conv; +} + +int16_t CS_LDK_vout_from_scid(int64_t short_channel_id) { + int16_t ret_conv = vout_from_scid(short_channel_id); + return ret_conv; +} + +int64_t CS_LDK_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); +} + void CS_LDK_UntrustedString_free(int64_t this_obj) { LDKUntrustedString this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -32814,53 +35946,647 @@ int64_t CS_LDK_PrintableString_new(jstring a_arg) { return ret_ref; } -void CS_LDK_FutureCallback_free(int64_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 CS_LDK_Future_free(int64_t this_obj) { - LDKFuture this_obj_conv; +void CS_LDK_TrackedSpendableOutput_free(int64_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); - Future_free(this_obj_conv); + TrackedSpendableOutput_free(this_obj_conv); } -static inline uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg) { - LDKFuture ret_var = Future_clone(arg); +int64_t CS_LDK_TrackedSpendableOutput_get_descriptor(int64_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; + LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor"); + *ret_copy = TrackedSpendableOutput_get_descriptor(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_descriptor(int64_t this_ptr, int64_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); + LDKSpendableOutputDescriptor val_conv = *(LDKSpendableOutputDescriptor*)(val_ptr); + val_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(val)); + TrackedSpendableOutput_set_descriptor(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_channel_id(int64_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; + LDKChannelId ret_var = TrackedSpendableOutput_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_TrackedSpendableOutput_set_channel_id(int64_t this_ptr, int64_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; + 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); + TrackedSpendableOutput_set_channel_id(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_get_status(int64_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; + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = TrackedSpendableOutput_get_status(&this_ptr_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TrackedSpendableOutput_set_status(int64_t this_ptr, int64_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); + LDKOutputSpendStatus val_conv = *(LDKOutputSpendStatus*)(val_ptr); + val_conv = OutputSpendStatus_clone((LDKOutputSpendStatus*)untag_ptr(val)); + TrackedSpendableOutput_set_status(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_TrackedSpendableOutput_new(int64_t descriptor_arg, int64_t channel_id_arg, int64_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); + int64_t ret_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 TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg) { + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(arg); int64_t ret_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 CS_LDK_Future_clone_ptr(int64_t arg) { - LDKFuture arg_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone_ptr(int64_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 = Future_clone_ptr(&arg_conv); + int64_t ret_conv = TrackedSpendableOutput_clone_ptr(&arg_conv); return ret_conv; } -int64_t CS_LDK_Future_clone(int64_t orig) { - LDKFuture orig_conv; +int64_t CS_LDK_TrackedSpendableOutput_clone(int64_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; - LDKFuture ret_var = Future_clone(&orig_conv); + LDKTrackedSpendableOutput ret_var = TrackedSpendableOutput_clone(&orig_conv); int64_t ret_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 CS_LDK_TrackedSpendableOutput_eq(int64_t a, int64_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; + 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 = TrackedSpendableOutput_eq(&a_conv, &b_conv); + return ret_conv; +} + +jboolean CS_LDK_TrackedSpendableOutput_is_spent_in(int64_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; +} + +int8_tArray CS_LDK_TrackedSpendableOutput_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_OutputSpendStatus_free(int64_t this_ptr) { + if (!ptr_is_owned(this_ptr)) return; + void* this_ptr_ptr = untag_ptr(this_ptr); + CHECK_ACCESS(this_ptr_ptr); + LDKOutputSpendStatus this_ptr_conv = *(LDKOutputSpendStatus*)(this_ptr_ptr); + FREE(untag_ptr(this_ptr)); + OutputSpendStatus_free(this_ptr_conv); +} + +static inline uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg) { + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_OutputSpendStatus_clone_ptr(int64_t arg) { + LDKOutputSpendStatus* arg_conv = (LDKOutputSpendStatus*)untag_ptr(arg); + int64_t ret_conv = OutputSpendStatus_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_OutputSpendStatus_clone(int64_t orig) { + LDKOutputSpendStatus* orig_conv = (LDKOutputSpendStatus*)untag_ptr(orig); + LDKOutputSpendStatus *ret_copy = MALLOC(sizeof(LDKOutputSpendStatus), "LDKOutputSpendStatus"); + *ret_copy = OutputSpendStatus_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSpendStatus_pending_initial_broadcast(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_OutputSpendStatus_eq(int64_t a, int64_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; +} + +int8_tArray CS_LDK_OutputSpendStatus_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_OutputSweeper_free(int64_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); + OutputSweeper_free(this_obj_conv); +} + +int64_t CS_LDK_OutputSweeper_new(int64_t best_block, int64_t broadcaster, int64_t fee_estimator, int64_t chain_data_source, int64_t output_spender, int64_t change_destination_source, int64_t kv_store, int64_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); + 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* 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); + 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); + } + 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); + int64_t ret_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 CS_LDK_OutputSweeper_track_spendable_outputs(int64_t this_arg, int64_tArray output_descriptors, int64_t channel_id, jboolean exclude_static_outputs, int64_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_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 + output_descriptors_constr.data = NULL; + int64_t* output_descriptors_vals = output_descriptors->elems; + for (size_t b = 0; b < output_descriptors_constr.datalen; b++) { + int64_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); +} + +int64_tArray CS_LDK_OutputSweeper_tracked_spendable_outputs(int64_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_TrackedSpendableOutputZ ret_var = OutputSweeper_tracked_spendable_outputs(&this_arg_conv); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t y = 0; y < ret_var.datalen; y++) { + LDKTrackedSpendableOutput ret_conv_24_var = ret_var.data[y]; + int64_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; +} + +int64_t CS_LDK_OutputSweeper_current_best_block(int64_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; + LDKBestBlock ret_var = OutputSweeper_current_best_block(&this_arg_conv); + int64_t ret_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 CS_LDK_OutputSweeper_as_Listen(int64_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; + LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen"); + *ret_ret = OutputSweeper_as_Listen(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +int64_t CS_LDK_OutputSweeper_as_Confirm(int64_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; + LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm"); + *ret_ret = OutputSweeper_as_Confirm(&this_arg_conv); + return tag_ptr(ret_ret, true); +} + +void CS_LDK_SpendingDelay_free(int64_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); +} + +static inline uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(arg); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SpendingDelay_clone_ptr(int64_t arg) { + LDKSpendingDelay* arg_conv = (LDKSpendingDelay*)untag_ptr(arg); + int64_t ret_conv = SpendingDelay_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SpendingDelay_clone(int64_t orig) { + LDKSpendingDelay* orig_conv = (LDKSpendingDelay*)untag_ptr(orig); + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendingDelay_relative(int32_t num_blocks) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_relative(num_blocks); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SpendingDelay_absolute(int32_t height) { + LDKSpendingDelay *ret_copy = MALLOC(sizeof(LDKSpendingDelay), "LDKSpendingDelay"); + *ret_copy = SpendingDelay_absolute(height); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_OutputSweeper_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_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); +} + +int64_t CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read(int8_tArray ser, int64_t arg_a, int64_t arg_b, int64_t arg_c, int64_t arg_d, int64_t arg_e, int64_t arg_f, int64_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 CS_LDK_FutureCallback_free(int64_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 CS_LDK_Future_free(int64_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 CS_LDK_Future_register_callback_fn(int64_t this_arg, int64_t callback) { LDKFuture this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -32882,8 +36608,8 @@ void CS_LDK_Future_wait(int64_t this_arg) { this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = Future_clone(&this_arg_conv); - Future_wait(this_arg_conv); + this_arg_conv.is_owned = false; + Future_wait(&this_arg_conv); } jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { @@ -32891,8 +36617,8 @@ jboolean CS_LDK_Future_wait_timeout(int64_t this_arg, int64_t max_wait) { this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv); - this_arg_conv = Future_clone(&this_arg_conv); - jboolean ret_conv = Future_wait_timeout(this_arg_conv, max_wait); + this_arg_conv.is_owned = false; + jboolean ret_conv = Future_wait_timeout(&this_arg_conv, max_wait); return ret_conv; } @@ -32909,8 +36635,8 @@ int64_t CS_LDK_Sleeper_from_single_future(int64_t future) { future_conv.inner = untag_ptr(future); future_conv.is_owned = ptr_is_owned(future); CHECK_INNER_FIELD_ACCESS_OR_NULL(future_conv); - future_conv = Future_clone(&future_conv); - LDKSleeper ret_var = Sleeper_from_single_future(future_conv); + future_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_single_future(&future_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -32922,13 +36648,13 @@ int64_t CS_LDK_Sleeper_from_two_futures(int64_t fut_a, int64_t fut_b) { fut_a_conv.inner = untag_ptr(fut_a); fut_a_conv.is_owned = ptr_is_owned(fut_a); CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_a_conv); - fut_a_conv = Future_clone(&fut_a_conv); + fut_a_conv.is_owned = false; LDKFuture fut_b_conv; fut_b_conv.inner = untag_ptr(fut_b); fut_b_conv.is_owned = ptr_is_owned(fut_b); CHECK_INNER_FIELD_ACCESS_OR_NULL(fut_b_conv); - fut_b_conv = Future_clone(&fut_b_conv); - LDKSleeper ret_var = Sleeper_from_two_futures(fut_a_conv, fut_b_conv); + fut_b_conv.is_owned = false; + LDKSleeper ret_var = Sleeper_from_two_futures(&fut_a_conv, &fut_b_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -32949,7 +36675,8 @@ int64_t CS_LDK_Sleeper_new(int64_tArray futures) { futures_conv_8_conv.inner = untag_ptr(futures_conv_8); futures_conv_8_conv.is_owned = ptr_is_owned(futures_conv_8); CHECK_INNER_FIELD_ACCESS_OR_NULL(futures_conv_8_conv); - futures_conv_8_conv = Future_clone(&futures_conv_8_conv); + // WARNING: we need a move here but no clone is available for LDKFuture + futures_constr.data[i] = futures_conv_8_conv; } FREE(futures); @@ -33090,9 +36817,10 @@ int64_t CS_LDK_Record_get_channel_id(int64_t this_ptr) { this_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); - int64_t ret_ref = tag_ptr(ret_copy, true); + LDKChannelId ret_var = Record_get_channel_id(&this_ptr_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); return ret_ref; } @@ -33102,10 +36830,11 @@ void CS_LDK_Record_set_channel_id(int64_t this_ptr, int64_t val) { this_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)); + 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); } @@ -33199,10 +36928,11 @@ int64_t CS_LDK_Record_new(int32_t level_arg, int8_tArray peer_id_arg, int64_t c 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)); + 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); @@ -34461,6 +38191,59 @@ void CS_LDK_BestBlock_free(int64_t this_obj) { BestBlock_free(this_obj_conv); } +int8_tArray CS_LDK_BestBlock_get_block_hash(int64_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; + 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 CS_LDK_BestBlock_set_block_hash(int64_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; + 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); +} + +int32_t CS_LDK_BestBlock_get_height(int64_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 = BestBlock_get_height(&this_ptr_conv); + return ret_conv; +} + +void CS_LDK_BestBlock_set_height(int64_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; + BestBlock_set_height(&this_ptr_conv, val); +} + +int64_t CS_LDK_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); + int64_t ret_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 BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) { LDKBestBlock ret_var = BestBlock_clone(arg); int64_t ret_ref = 0; @@ -34491,6 +38274,16 @@ int64_t CS_LDK_BestBlock_clone(int64_t orig) { return ret_ref; } +int64_t CS_LDK_BestBlock_hash(int64_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; +} + jboolean CS_LDK_BestBlock_eq(int64_t a, int64_t b) { LDKBestBlock a_conv; a_conv.inner = untag_ptr(a); @@ -34515,36 +38308,27 @@ int64_t CS_LDK_BestBlock_from_network(int32_t network) { return ret_ref; } -int64_t CS_LDK_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); - int64_t ret_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 CS_LDK_BestBlock_block_hash(int64_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 CS_LDK_BestBlock_write(int64_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; } -int32_t CS_LDK_BestBlock_height(int64_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; +int64_t CS_LDK_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); } void CS_LDK_Listen_free(int64_t this_ptr) { @@ -34818,6 +38602,11 @@ int32_t CS_LDK_ConfirmationTarget_channel_close_minimum() { return ret_conv; } +int32_t CS_LDK_ConfirmationTarget_output_spending_fee() { + int32_t ret_conv = LDKConfirmationTarget_to_cs(ConfirmationTarget_output_spending_fee()); + return ret_conv; +} + int64_t CS_LDK_ConfirmationTarget_hash(int64_t o) { LDKConfirmationTarget* o_conv = (LDKConfirmationTarget*)untag_ptr(o); int64_t ret_conv = ConfirmationTarget_hash(o_conv); @@ -35035,16 +38824,14 @@ int64_tArray CS_LDK_ChainMonitor_list_monitors(int64_t this_arg) { this_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_C2Tuple_OutPointChannelIdZZ ret_var = ChainMonitor_list_monitors(&this_arg_conv); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t k = 0; k < ret_var.datalen; k++) { - LDKOutPoint ret_conv_10_var = ret_var.data[k]; - int64_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 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); @@ -35114,6 +38901,29 @@ void CS_LDK_ChainMonitor_rebroadcast_pending_claims(int64_t this_arg) { ChainMonitor_rebroadcast_pending_claims(&this_arg_conv); } +void CS_LDK_ChainMonitor_signer_unblocked(int64_t this_arg, int64_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 CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors(int64_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); +} + int64_t CS_LDK_ChainMonitor_as_Listen(int64_t this_arg) { LDKChainMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -35185,6 +38995,33 @@ void CS_LDK_ChannelMonitorUpdate_set_update_id(int64_t this_ptr, int64_t val) { ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val); } +int64_t CS_LDK_ChannelMonitorUpdate_get_channel_id(int64_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; + LDKChannelId ret_var = ChannelMonitorUpdate_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_ChannelMonitorUpdate_set_channel_id(int64_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; + 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); + ChannelMonitorUpdate_set_channel_id(&this_ptr_conv, val_conv); +} + static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) { LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg); int64_t ret_ref = 0; @@ -35294,6 +39131,27 @@ int64_t CS_LDK_MonitorEvent_htlcevent(int64_t a) { return ret_ref; } +int64_t CS_LDK_MonitorEvent_holder_force_closed_with_info(int64_t reason, int64_t outpoint, int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { LDKOutPoint a_conv; a_conv.inner = untag_ptr(a); @@ -35306,14 +39164,19 @@ int64_t CS_LDK_MonitorEvent_holder_force_closed(int64_t a) { return ret_ref; } -int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_t monitor_update_id) { +int64_t CS_LDK_MonitorEvent_completed(int64_t funding_txo, int64_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, monitor_update_id); + *ret_copy = MonitorEvent_completed(funding_txo_conv, channel_id_conv, monitor_update_id); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -35613,6 +39476,19 @@ int64_t CS_LDK_ChannelMonitor_get_funding_txo(int64_t this_arg) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_ChannelMonitor_channel_id(int64_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; + LDKChannelId ret_var = ChannelMonitor_channel_id(&this_arg_conv); + int64_t ret_ref = 0; + CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); + ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); + return ret_ref; +} + int64_tArray CS_LDK_ChannelMonitor_get_outputs_to_watch(int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -35748,119 +39624,112 @@ int8_tArray CS_LDK_ChannelMonitor_get_counterparty_node_id(int64_t this_arg) { return ret_arr; } -ptrArray CS_LDK_ChannelMonitor_get_latest_holder_commitment_txn(int64_t this_arg, int64_t logger) { +void CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_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); + 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; - 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 i = 0; i < ret_var.datalen; i++) { - LDKTransaction ret_conv_8_var = ret_var.data[i]; - int8_tArray ret_conv_8_arr = init_int8_tArray(ret_conv_8_var.datalen, __LINE__); - memcpy(ret_conv_8_arr->elems, ret_conv_8_var.data, ret_conv_8_var.datalen); - Transaction_free(ret_conv_8_var); - ret_arr_ptr[i] = ret_conv_8_arr; + ChannelMonitor_broadcast_latest_holder_commitment_txn(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + +int64_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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; + int64_t* txdata_vals = txdata->elems; + for (size_t c = 0; c < txdata_constr.datalen; c++) { + int64_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); + int64_tArray ret_arr = NULL; + ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); + int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); + for (size_t 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_tArray CS_LDK_ChannelMonitor_block_connected(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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; - int64_t* txdata_vals = txdata->elems; - for (size_t c = 0; c < txdata_constr.datalen; c++) { - int64_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); - int64_tArray ret_arr = NULL; - ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); - int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t 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 CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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); -} - -int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { +void CS_LDK_ChannelMonitor_block_disconnected(int64_t this_arg, int8_tArray header, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_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); +} + +int64_tArray CS_LDK_ChannelMonitor_transactions_confirmed(int64_t this_arg, int8_tArray header, int64_tArray txdata, int32_t height, int64_t broadcaster, int64_t fee_estimator, int64_t logger) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -36047,6 +39916,32 @@ void CS_LDK_ChannelMonitor_rebroadcast_pending_claims(int64_t this_arg, int64_t ChannelMonitor_rebroadcast_pending_claims(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); } +void CS_LDK_ChannelMonitor_signer_unblocked(int64_t this_arg, int64_t broadcaster, int64_t fee_estimator, int64_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_signer_unblocked(&this_arg_conv, broadcaster_conv, fee_estimator_conv, logger_conv); +} + int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8_tArray tx, int32_t confirmation_height) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -36073,6 +39968,19 @@ int64_tArray CS_LDK_ChannelMonitor_get_spendable_outputs(int64_t this_arg, int8 return ret_arr; } +jboolean CS_LDK_ChannelMonitor_is_fully_resolved(int64_t this_arg, int64_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; + jboolean ret_conv = ChannelMonitor_is_fully_resolved(&this_arg_conv, logger_conv); + return ret_conv; +} + int64_tArray CS_LDK_ChannelMonitor_get_claimable_balances(int64_t this_arg) { LDKChannelMonitor this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -36226,17 +40134,6 @@ int64_t CS_LDK_OutPoint_hash(int64_t o) { return ret_conv; } -int8_tArray CS_LDK_OutPoint_to_channel_id(int64_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; -} - int8_tArray CS_LDK_OutPoint_write(int64_t obj) { LDKOutPoint obj_conv; obj_conv.inner = untag_ptr(obj); @@ -36348,6 +40245,61 @@ int64_t CS_LDK_InboundHTLCErr_new(int16_t err_code_arg, int8_tArray err_data_ar return ret_ref; } +static inline uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg) { + LDKInboundHTLCErr ret_var = InboundHTLCErr_clone(arg); + int64_t ret_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 CS_LDK_InboundHTLCErr_clone_ptr(int64_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; +} + +int64_t CS_LDK_InboundHTLCErr_clone(int64_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); + int64_t ret_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 CS_LDK_InboundHTLCErr_hash(int64_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 CS_LDK_InboundHTLCErr_eq(int64_t a, int64_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; +} + int64_t CS_LDK_peel_payment_onion(int64_t msg, int64_t node_signer, int64_t logger, int32_t cur_height, jboolean accept_mpp_keysend, jboolean allow_skimmed_fees) { LDKUpdateAddHTLC msg_conv; msg_conv.inner = untag_ptr(msg); @@ -36411,7 +40363,7 @@ int64_t CS_LDK_PendingHTLCRouting_forward(int64_t onion_packet, int64_t short_c return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_tArray custom_tlvs, jboolean requires_blinded_error) { +int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment_metadata, int64_t payment_context, int32_t incoming_cltv_expiry, int8_tArray phantom_shared_secret, int64_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); @@ -36421,6 +40373,10 @@ int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment 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); @@ -36441,12 +40397,12 @@ int64_t CS_LDK_PendingHTLCRouting_receive(int64_t payment_data, int64_t payment } 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); + *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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_tArray custom_tlvs) { +int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tArray payment_preimage, int64_t payment_metadata, int32_t incoming_cltv_expiry, int64_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); @@ -36476,7 +40432,7 @@ int64_t CS_LDK_PendingHTLCRouting_receive_keysend(int64_t payment_data, int8_tA } 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); + *ret_copy = PendingHTLCRouting_receive_keysend(payment_data_conv, payment_preimage_ref, payment_metadata_conv, incoming_cltv_expiry, custom_tlvs_constr, requires_blinded_error); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -37343,27 +41299,31 @@ void CS_LDK_ChannelDetails_free(int64_t this_obj) { ChannelDetails_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelDetails_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelDetails_get_channel_id(int64_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, *ChannelDetails_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ChannelDetails_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_ChannelDetails_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelDetails_set_channel_id(int64_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; - 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); + 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); } int64_t CS_LDK_ChannelDetails_get_counterparty(int64_t this_ptr) { @@ -37962,83 +41922,6 @@ void CS_LDK_ChannelDetails_set_config(int64_t this_ptr, int64_t val) { ChannelDetails_set_config(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelDetails_new(int8_tArray channel_id_arg, int64_t counterparty_arg, int64_t funding_txo_arg, int64_t channel_type_arg, int64_t short_channel_id_arg, int64_t outbound_scid_alias_arg, int64_t inbound_scid_alias_arg, int64_t channel_value_satoshis_arg, int64_t unspendable_punishment_reserve_arg, int8_tArray user_channel_id_arg, int64_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, int64_t confirmations_required_arg, int64_t confirmations_arg, int64_t force_close_spend_delay_arg, jboolean is_outbound_arg, jboolean is_channel_ready_arg, int64_t channel_shutdown_state_arg, jboolean is_usable_arg, jboolean is_public_arg, int64_t inbound_htlc_minimum_msat_arg, int64_t inbound_htlc_maximum_msat_arg, int64_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); - int64_t ret_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 ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) { LDKChannelDetails ret_var = ChannelDetails_clone(arg); int64_t ret_ref = 0; @@ -38465,16 +42348,17 @@ int64_t CS_LDK_ChannelManager_create_channel(int64_t this_arg, int8_tArray thei 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)); + 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_ThirtyTwoBytesAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ThirtyTwoBytesAPIErrorZ), "LDKCResult_ThirtyTwoBytesAPIErrorZ"); + 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); } @@ -38569,34 +42453,36 @@ int64_tArray CS_LDK_ChannelManager_list_recent_payments(int64_t this_arg) { return ret_arr; } -int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_close_channel(int64_t this_arg, int64_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; - 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; + 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_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_close_channel(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_t shutdown_script) { +int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t this_arg, int64_t channel_id, int8_tArray counterparty_node_id, int64_t target_feerate_sats_per_1000_weight, int64_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; - 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; + 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); @@ -38610,43 +42496,45 @@ int64_t CS_LDK_ChannelManager_close_channel_with_feerate_and_script(int64_t thi 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); + *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); } -int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_force_close_broadcasting_latest_txn(int64_t this_arg, int64_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; - 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; + 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_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int8_tArray channel_id, int8_tArray counterparty_node_id) { +int64_t CS_LDK_ChannelManager_force_close_without_broadcasting_txn(int64_t this_arg, int64_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; - 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; + 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_ref, counterparty_node_id_ref); + *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, &channel_id_conv, counterparty_node_id_ref); return tag_ptr(ret_conv, true); } @@ -38852,16 +42740,17 @@ int64_t CS_LDK_ChannelManager_send_preflight_probes(int64_t this_arg, int64_t r return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray funding_transaction) { +int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, int64_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; - 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; + 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); @@ -38871,7 +42760,7 @@ int64_t CS_LDK_ChannelManager_funding_transaction_generated(int64_t this_arg, i 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); + *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); } @@ -38881,20 +42770,20 @@ int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_ this_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; + 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_ThirtyTwoBytesPublicKeyZ), "LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ Elements"); + temporary_channels_constr.data = MALLOC(temporary_channels_constr.datalen * sizeof(LDKC2Tuple_ChannelIdPublicKeyZ), "LDKCVec_C2Tuple_ChannelIdPublicKeyZZ Elements"); else temporary_channels_constr.data = NULL; int64_t* temporary_channels_vals = temporary_channels->elems; - for (size_t j = 0; j < temporary_channels_constr.datalen; j++) { - int64_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; + for (size_t e = 0; e < temporary_channels_constr.datalen; e++) { + int64_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; @@ -38907,7 +42796,7 @@ int64_t CS_LDK_ChannelManager_batch_funding_transaction_generated(int64_t this_ return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, int64_t config_update) { +int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_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); @@ -38916,19 +42805,21 @@ int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, i 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; + 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(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); else channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t i = 0; i < channel_ids_constr.datalen; i++) { - int8_tArray channel_ids_conv_8 = channel_ids_vals[i]; - LDKThirtyTwoBytes channel_ids_conv_8_ref; - CHECK(channel_ids_conv_8->arr_len == 32); - memcpy(channel_ids_conv_8_ref.data, channel_ids_conv_8->elems, 32); FREE(channel_ids_conv_8); - channel_ids_constr.data[i] = channel_ids_conv_8_ref; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_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; @@ -38941,7 +42832,7 @@ int64_t CS_LDK_ChannelManager_update_partial_channel_config(int64_t this_arg, i return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, ptrArray channel_ids, int64_t config) { +int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArray counterparty_node_id, int64_tArray channel_ids, int64_t config) { LDKChannelManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); this_arg_conv.is_owned = ptr_is_owned(this_arg); @@ -38950,19 +42841,21 @@ int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArr 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; + 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(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements"); + channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKChannelId), "LDKCVec_ChannelIdZ Elements"); else channel_ids_constr.data = NULL; - int8_tArray* channel_ids_vals = (void*) channel_ids->elems; - for (size_t i = 0; i < channel_ids_constr.datalen; i++) { - int8_tArray channel_ids_conv_8 = channel_ids_vals[i]; - LDKThirtyTwoBytes channel_ids_conv_8_ref; - CHECK(channel_ids_conv_8->arr_len == 32); - memcpy(channel_ids_conv_8_ref.data, channel_ids_conv_8->elems, 32); FREE(channel_ids_conv_8); - channel_ids_constr.data[i] = channel_ids_conv_8_ref; + int64_t* channel_ids_vals = channel_ids->elems; + for (size_t l = 0; l < channel_ids_constr.datalen; l++) { + int64_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; @@ -38975,7 +42868,7 @@ int64_t CS_LDK_ChannelManager_update_channel_config(int64_t this_arg, int8_tArr return tag_ptr(ret_conv, true); } -int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int8_tArray next_hop_channel_id, int8_tArray next_node_id, int64_t amt_to_forward_msat) { +int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_tArray intercept_id, int64_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); @@ -38984,15 +42877,16 @@ int64_t CS_LDK_ChannelManager_forward_intercepted_htlc(int64_t this_arg, int8_t 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; + 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_ref, next_node_id_ref, amt_to_forward_msat); + *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); } @@ -39093,16 +42987,17 @@ int8_tArray CS_LDK_ChannelManager_get_our_node_id(int64_t this_arg) { return ret_arr; } -int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { +int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int64_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; - 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; + 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); @@ -39110,20 +43005,21 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel(int64_t this_arg, int8_tAr 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); + *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); } -int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int8_tArray user_channel_id) { +int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(int64_t this_arg, int64_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; - 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; + 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); @@ -39131,7 +43027,40 @@ int64_t CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(in 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); + *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); +} + +int64_t CS_LDK_ChannelManager_create_offer_builder(int64_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); +} + +int64_t CS_LDK_ChannelManager_create_refund_builder(int64_t this_arg, int64_t amount_msats, int64_t absolute_expiry, int8_tArray payment_id, int64_t retry_strategy, int64_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); } @@ -39185,7 +43114,7 @@ int64_t CS_LDK_ChannelManager_request_refund_payment(int64_t this_arg, int64_t 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"); + 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); } @@ -39448,6 +43377,17 @@ int64_t CS_LDK_ChannelManager_as_OffersMessageHandler(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_ChannelManager_as_NodeIdLookUp(int64_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); +} + int64_t CS_LDK_provided_init_features(int64_t config) { LDKUserConfig config_conv; config_conv.inner = untag_ptr(config); @@ -40130,6 +44070,20 @@ int8_tArray CS_LDK_DelayedPaymentBasepoint_to_public_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_DelayedPaymentBasepoint_derive_add_tweak(int64_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; + 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; +} + int8_tArray CS_LDK_DelayedPaymentBasepoint_write(int64_t obj) { LDKDelayedPaymentBasepoint obj_conv; obj_conv.inner = untag_ptr(obj); @@ -40410,6 +44364,20 @@ int8_tArray CS_LDK_HtlcBasepoint_to_public_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_HtlcBasepoint_derive_add_tweak(int64_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; + 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 CS_LDK_HtlcBasepoint_write(int64_t obj) { LDKHtlcBasepoint obj_conv; obj_conv.inner = untag_ptr(obj); @@ -40582,6 +44550,19 @@ int64_t CS_LDK_HtlcKey_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_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; +} + void CS_LDK_RevocationBasepoint_free(int64_t this_obj) { LDKRevocationBasepoint this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -41003,6 +44984,13 @@ int64_t CS_LDK_DecodeError_unsupported_compression() { return ret_ref; } +int64_t CS_LDK_DecodeError_dangerous_value() { + LDKDecodeError *ret_copy = MALLOC(sizeof(LDKDecodeError), "LDKDecodeError"); + *ret_copy = DecodeError_dangerous_value(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_DecodeError_hash(int64_t o) { LDKDecodeError* o_conv = (LDKDecodeError*)untag_ptr(o); int64_t ret_conv = DecodeError_hash(o_conv); @@ -41184,27 +45172,31 @@ void CS_LDK_ErrorMessage_free(int64_t this_obj) { ErrorMessage_free(this_obj_conv); } -int8_tArray CS_LDK_ErrorMessage_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ErrorMessage_get_channel_id(int64_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; - int8_tArray ret_arr = init_int8_tArray(32, __LINE__); - memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32); - return ret_arr; + LDKChannelId ret_var = ErrorMessage_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_ErrorMessage_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ErrorMessage_set_channel_id(int64_t this_ptr, int64_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; - 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); + 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); } jstring CS_LDK_ErrorMessage_get_data(int64_t this_ptr) { @@ -41229,12 +45221,14 @@ void CS_LDK_ErrorMessage_set_data(int64_t this_ptr, jstring val) { ErrorMessage_set_data(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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); +int64_t CS_LDK_ErrorMessage_new(int64_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_ref, data_arg_conv); + LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_conv, data_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41304,27 +45298,31 @@ void CS_LDK_WarningMessage_free(int64_t this_obj) { WarningMessage_free(this_obj_conv); } -int8_tArray CS_LDK_WarningMessage_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_WarningMessage_get_channel_id(int64_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); - return ret_arr; + LDKChannelId ret_var = WarningMessage_get_channel_id(&this_ptr_conv); + int64_t ret_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 CS_LDK_WarningMessage_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_WarningMessage_set_channel_id(int64_t this_ptr, int64_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; - 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); + 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); } jstring CS_LDK_WarningMessage_get_data(int64_t this_ptr) { @@ -41349,12 +45347,14 @@ void CS_LDK_WarningMessage_set_data(int64_t this_ptr, jstring val) { WarningMessage_set_data(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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); +int64_t CS_LDK_WarningMessage_new(int64_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_ref, data_arg_conv); + LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_conv, data_arg_conv); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -41615,27 +45615,27 @@ jboolean CS_LDK_Pong_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_OpenChannel_free(int64_t this_obj) { - LDKOpenChannel this_obj_conv; +void CS_LDK_CommonOpenChannelFields_free(int64_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); - OpenChannel_free(this_obj_conv); + CommonOpenChannelFields_free(this_obj_conv); } -int8_tArray CS_LDK_OpenChannel_get_chain_hash(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_chain_hash(int64_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(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32); + memcpy(ret_arr->elems, *CommonOpenChannelFields_get_chain_hash(&this_ptr_conv), 32); return ret_arr; } -void CS_LDK_OpenChannel_set_chain_hash(int64_t this_ptr, int8_tArray val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_chain_hash(int64_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); @@ -41643,769 +45643,182 @@ void CS_LDK_OpenChannel_set_chain_hash(int64_t this_ptr, int8_tArray val) { 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); -} - -int8_tArray CS_LDK_OpenChannel_get_temporary_channel_id(int64_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(32, __LINE__); - memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_temporary_channel_id(int64_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; - 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); -} - -int64_t CS_LDK_OpenChannel_get_funding_satoshis(int64_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_funding_satoshis(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_funding_satoshis(int64_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_funding_satoshis(&this_ptr_conv, val); -} - -int64_t CS_LDK_OpenChannel_get_push_msat(int64_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 CS_LDK_OpenChannel_set_push_msat(int64_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 CS_LDK_OpenChannel_get_dust_limit_satoshis(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_dust_limit_satoshis(int64_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); -} - -int64_t CS_LDK_OpenChannel_get_max_htlc_value_in_flight_msat(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_max_htlc_value_in_flight_msat(int64_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 CS_LDK_OpenChannel_get_channel_reserve_satoshis(int64_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 CS_LDK_OpenChannel_set_channel_reserve_satoshis(int64_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); -} - -int64_t CS_LDK_OpenChannel_get_htlc_minimum_msat(int64_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_htlc_minimum_msat(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_htlc_minimum_msat(int64_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_htlc_minimum_msat(&this_ptr_conv, val); -} - -int32_t CS_LDK_OpenChannel_get_feerate_per_kw(int64_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; - int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_feerate_per_kw(int64_t this_ptr, int32_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_feerate_per_kw(&this_ptr_conv, val); -} - -int16_t CS_LDK_OpenChannel_get_to_self_delay(int64_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; -} - -void CS_LDK_OpenChannel_set_to_self_delay(int64_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); -} - -int16_t CS_LDK_OpenChannel_get_max_accepted_htlcs(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_max_accepted_htlcs(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_funding_pubkey(int64_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; -} - -void CS_LDK_OpenChannel_set_funding_pubkey(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_revocation_basepoint(int64_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 CS_LDK_OpenChannel_set_revocation_basepoint(int64_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_revocation_basepoint(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannel_get_payment_point(int64_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_payment_point(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_payment_point(int64_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_payment_point(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannel_get_delayed_payment_basepoint(int64_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_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33); - return ret_arr; -} - -void CS_LDK_OpenChannel_set_delayed_payment_basepoint(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_htlc_basepoint(int64_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; -} - -void CS_LDK_OpenChannel_set_htlc_basepoint(int64_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); -} - -int8_tArray CS_LDK_OpenChannel_get_first_per_commitment_point(int64_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; -} - -void CS_LDK_OpenChannel_set_first_per_commitment_point(int64_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); -} - -int8_t CS_LDK_OpenChannel_get_channel_flags(int64_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); - return ret_conv; -} - -void CS_LDK_OpenChannel_set_channel_flags(int64_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); -} - -int64_t CS_LDK_OpenChannel_get_shutdown_scriptpubkey(int64_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; - LDKCOption_CVec_u8ZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_u8ZZ), "LDKCOption_CVec_u8ZZ"); - *ret_copy = OpenChannel_get_shutdown_scriptpubkey(&this_ptr_conv); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_OpenChannel_set_shutdown_scriptpubkey(int64_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; - 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); + CommonOpenChannelFields_set_chain_hash(&this_ptr_conv, val_ref); } -int64_t CS_LDK_OpenChannel_get_channel_type(int64_t this_ptr) { - LDKOpenChannel this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_temporary_channel_id(int64_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 = OpenChannel_get_channel_type(&this_ptr_conv); + LDKChannelId ret_var = CommonOpenChannelFields_get_temporary_channel_id(&this_ptr_conv); int64_t ret_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 CS_LDK_OpenChannel_set_channel_type(int64_t this_ptr, int64_t val) { - LDKOpenChannel this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_temporary_channel_id(int64_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; - LDKChannelTypeFeatures 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 = ChannelTypeFeatures_clone(&val_conv); - OpenChannel_set_channel_type(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_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); - int64_t ret_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); - int64_t ret_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 CS_LDK_OpenChannel_clone_ptr(int64_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; -} - -int64_t CS_LDK_OpenChannel_clone(int64_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); - int64_t ret_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 CS_LDK_OpenChannel_hash(int64_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 CS_LDK_OpenChannel_eq(int64_t a, int64_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 CS_LDK_OpenChannelV2_free(int64_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); -} - -int8_tArray CS_LDK_OpenChannelV2_get_chain_hash(int64_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_chain_hash(&this_ptr_conv), 32); - return ret_arr; -} - -void CS_LDK_OpenChannelV2_set_chain_hash(int64_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_chain_hash(&this_ptr_conv, val_ref); -} - -int8_tArray CS_LDK_OpenChannelV2_get_temporary_channel_id(int64_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; -} - -void CS_LDK_OpenChannelV2_set_temporary_channel_id(int64_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); -} - -int32_t CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(int64_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_commitment_feerate_sat_per_1000_weight(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(int64_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_commitment_feerate_sat_per_1000_weight(&this_ptr_conv, val); + val_conv = ChannelId_clone(&val_conv); + CommonOpenChannelFields_set_temporary_channel_id(&this_ptr_conv, val_conv); } -int64_t CS_LDK_OpenChannelV2_get_funding_satoshis(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_funding_satoshis(int64_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); + int64_t ret_conv = CommonOpenChannelFields_get_funding_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_funding_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_funding_satoshis(int64_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_funding_satoshis(&this_ptr_conv, val); + CommonOpenChannelFields_set_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_dust_limit_satoshis(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_dust_limit_satoshis(int64_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_dust_limit_satoshis(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_dust_limit_satoshis(int64_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_dust_limit_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(int64_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_max_htlc_value_in_flight_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(int64_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_max_htlc_value_in_flight_msat(&this_ptr_conv, val); } -int64_t CS_LDK_OpenChannelV2_get_htlc_minimum_msat(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_htlc_minimum_msat(int64_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_htlc_minimum_msat(&this_ptr_conv); return ret_conv; } -void CS_LDK_OpenChannelV2_set_htlc_minimum_msat(int64_t this_ptr, int64_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_htlc_minimum_msat(&this_ptr_conv, val); -} - -int16_t CS_LDK_OpenChannelV2_get_to_self_delay(int64_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; - int16_t ret_conv = OpenChannelV2_get_to_self_delay(&this_ptr_conv); - return ret_conv; -} - -void CS_LDK_OpenChannelV2_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_htlc_minimum_msat(int64_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 CS_LDK_OpenChannelV2_get_max_accepted_htlcs(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int32_t CS_LDK_CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_get_locktime(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_CommonOpenChannelFields_get_to_self_delay(int64_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 CS_LDK_OpenChannelV2_set_locktime(int64_t this_ptr, int32_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_to_self_delay(int64_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 CS_LDK_OpenChannelV2_get_funding_pubkey(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int16_t CS_LDK_CommonOpenChannelFields_get_max_accepted_htlcs(int64_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 CS_LDK_OpenChannelV2_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_max_accepted_htlcs(int64_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 CS_LDK_OpenChannelV2_get_revocation_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_funding_pubkey(int64_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 CS_LDK_OpenChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_funding_pubkey(int64_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); @@ -42413,22 +45826,22 @@ void CS_LDK_OpenChannelV2_set_revocation_basepoint(int64_t this_ptr, int8_tArra 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 CS_LDK_OpenChannelV2_get_payment_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_revocation_basepoint(int64_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 CS_LDK_OpenChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_revocation_basepoint(int64_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); @@ -42436,22 +45849,22 @@ void CS_LDK_OpenChannelV2_set_payment_basepoint(int64_t this_ptr, int8_tArray v 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 CS_LDK_OpenChannelV2_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_payment_basepoint(int64_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 CS_LDK_OpenChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_payment_basepoint(int64_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); @@ -42459,22 +45872,22 @@ void CS_LDK_OpenChannelV2_set_delayed_payment_basepoint(int64_t this_ptr, int8_ 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 CS_LDK_OpenChannelV2_get_htlc_basepoint(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_delayed_payment_basepoint(int64_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 CS_LDK_OpenChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_delayed_payment_basepoint(int64_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); @@ -42482,22 +45895,22 @@ void CS_LDK_OpenChannelV2_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) 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 CS_LDK_OpenChannelV2_get_first_per_commitment_point(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_htlc_basepoint(int64_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 CS_LDK_OpenChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_htlc_basepoint(int64_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); @@ -42505,22 +45918,22 @@ void CS_LDK_OpenChannelV2_set_first_per_commitment_point(int64_t this_ptr, int8 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 CS_LDK_OpenChannelV2_get_second_per_commitment_point(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_tArray CS_LDK_CommonOpenChannelFields_get_first_per_commitment_point(int64_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 CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_first_per_commitment_point(int64_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); @@ -42528,42 +45941,42 @@ void CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_t this_ptr, int 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 CS_LDK_OpenChannelV2_get_channel_flags(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int8_t CS_LDK_CommonOpenChannelFields_get_channel_flags(int64_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 CS_LDK_OpenChannelV2_set_channel_flags(int64_t this_ptr, int8_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_channel_flags(int64_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); } -int64_t CS_LDK_OpenChannelV2_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_shutdown_scriptpubkey(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_shutdown_scriptpubkey(int64_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); @@ -42572,24 +45985,24 @@ void CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t v 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); } -int64_t CS_LDK_OpenChannelV2_get_channel_type(int64_t this_ptr) { - LDKOpenChannelV2 this_ptr_conv; +int64_t CS_LDK_CommonOpenChannelFields_get_channel_type(int64_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); int64_t ret_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 CS_LDK_OpenChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { - LDKOpenChannelV2 this_ptr_conv; +void CS_LDK_CommonOpenChannelFields_set_channel_type(int64_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); @@ -42599,36 +46012,18 @@ void CS_LDK_OpenChannelV2_set_channel_type(int64_t this_ptr, int64_t val) { 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); -} - -int32_t CS_LDK_OpenChannelV2_get_require_confirmed_inputs(int64_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 = LDKCOption_NoneZ_to_cs(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); - return ret_conv; + CommonOpenChannelFields_set_channel_type(&this_ptr_conv, val_conv); } -void CS_LDK_OpenChannelV2_set_require_confirmed_inputs(int64_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; - LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); - OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); -} - -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg, int32_t require_confirmed_inputs_arg) { +int64_t CS_LDK_CommonOpenChannelFields_new(int8_tArray chain_hash_arg, int64_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, int64_t shutdown_scriptpubkey_arg, int64_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); @@ -42647,9 +46042,6 @@ int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray tempor 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); @@ -42659,8 +46051,336 @@ int64_t CS_LDK_OpenChannelV2_new(int8_tArray chain_hash_arg, int8_tArray tempor 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); + int64_t ret_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); + int64_t ret_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 CS_LDK_CommonOpenChannelFields_clone_ptr(int64_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; +} + +int64_t CS_LDK_CommonOpenChannelFields_clone(int64_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); + int64_t ret_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 CS_LDK_CommonOpenChannelFields_hash(int64_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 CS_LDK_CommonOpenChannelFields_eq(int64_t a, int64_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 CS_LDK_OpenChannel_free(int64_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); +} + +int64_t CS_LDK_OpenChannel_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_OpenChannel_set_common_fields(int64_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; + 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 CS_LDK_OpenChannel_get_push_msat(int64_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 CS_LDK_OpenChannel_set_push_msat(int64_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 CS_LDK_OpenChannel_get_channel_reserve_satoshis(int64_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 CS_LDK_OpenChannel_set_channel_reserve_satoshis(int64_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); +} + +int64_t CS_LDK_OpenChannel_new(int64_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_OpenChannel_clone_ptr(int64_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; +} + +int64_t CS_LDK_OpenChannel_clone(int64_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); + int64_t ret_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 CS_LDK_OpenChannel_hash(int64_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 CS_LDK_OpenChannel_eq(int64_t a, int64_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 CS_LDK_OpenChannelV2_free(int64_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); +} + +int64_t CS_LDK_OpenChannelV2_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_OpenChannelV2_set_common_fields(int64_t this_ptr, int64_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 CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight(int64_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 CS_LDK_OpenChannelV2_get_locktime(int64_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 CS_LDK_OpenChannelV2_set_locktime(int64_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 CS_LDK_OpenChannelV2_get_second_per_commitment_point(int64_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 CS_LDK_OpenChannelV2_set_second_per_commitment_point(int64_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); +} + +int32_t CS_LDK_OpenChannelV2_get_require_confirmed_inputs(int64_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 = LDKCOption_NoneZ_to_cs(OpenChannelV2_get_require_confirmed_inputs(&this_ptr_conv)); + return ret_conv; +} + +void CS_LDK_OpenChannelV2_set_require_confirmed_inputs(int64_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; + LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_cs(val); + OpenChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); +} + +int64_t CS_LDK_OpenChannelV2_new(int64_t common_fields_arg, int32_t funding_feerate_sat_per_1000_weight_arg, int32_t locktime_arg, int8_tArray second_per_commitment_point_arg, int32_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_cs(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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -42722,183 +46442,168 @@ jboolean CS_LDK_OpenChannelV2_eq(int64_t a, int64_t b) { return ret_conv; } -void CS_LDK_AcceptChannel_free(int64_t this_obj) { - LDKAcceptChannel this_obj_conv; +void CS_LDK_CommonAcceptChannelFields_free(int64_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 CS_LDK_AcceptChannel_get_temporary_channel_id(int64_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 CS_LDK_AcceptChannel_set_temporary_channel_id(int64_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 CS_LDK_AcceptChannel_get_dust_limit_satoshis(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_temporary_channel_id(int64_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); + int64_t ret_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 CS_LDK_AcceptChannel_set_dust_limit_satoshis(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_temporary_channel_id(int64_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_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 CS_LDK_AcceptChannel_get_max_htlc_value_in_flight_msat(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannel_set_max_htlc_value_in_flight_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannel_get_channel_reserve_satoshis(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannel_set_channel_reserve_satoshis(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannel_get_htlc_minimum_msat(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannel_set_htlc_minimum_msat(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannel_get_minimum_depth(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int32_t CS_LDK_CommonAcceptChannelFields_get_minimum_depth(int64_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 CS_LDK_AcceptChannel_set_minimum_depth(int64_t this_ptr, int32_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_minimum_depth(int64_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 CS_LDK_AcceptChannel_get_to_self_delay(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t CS_LDK_CommonAcceptChannelFields_get_to_self_delay(int64_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 CS_LDK_AcceptChannel_set_to_self_delay(int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_to_self_delay(int64_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 CS_LDK_AcceptChannel_get_max_accepted_htlcs(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int16_t CS_LDK_CommonAcceptChannelFields_get_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannel_set_max_accepted_htlcs(int64_t this_ptr, int16_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannel_get_funding_pubkey(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_funding_pubkey(int64_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 CS_LDK_AcceptChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_funding_pubkey(int64_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); @@ -42906,22 +46611,22 @@ void CS_LDK_AcceptChannel_set_funding_pubkey(int64_t this_ptr, int8_tArray val) 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 CS_LDK_AcceptChannel_get_revocation_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_revocation_basepoint(int64_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 CS_LDK_AcceptChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_revocation_basepoint(int64_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); @@ -42929,22 +46634,22 @@ void CS_LDK_AcceptChannel_set_revocation_basepoint(int64_t this_ptr, int8_tArra 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 CS_LDK_AcceptChannel_get_payment_point(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_payment_basepoint(int64_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 CS_LDK_AcceptChannel_set_payment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_payment_basepoint(int64_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); @@ -42952,22 +46657,22 @@ void CS_LDK_AcceptChannel_set_payment_point(int64_t this_ptr, int8_tArray val) 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 CS_LDK_AcceptChannel_get_delayed_payment_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_delayed_payment_basepoint(int64_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 CS_LDK_AcceptChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_delayed_payment_basepoint(int64_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); @@ -42975,22 +46680,22 @@ void CS_LDK_AcceptChannel_set_delayed_payment_basepoint(int64_t this_ptr, int8_ 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 CS_LDK_AcceptChannel_get_htlc_basepoint(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_htlc_basepoint(int64_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 CS_LDK_AcceptChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_htlc_basepoint(int64_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); @@ -42998,22 +46703,22 @@ void CS_LDK_AcceptChannel_set_htlc_basepoint(int64_t this_ptr, int8_tArray val) 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 CS_LDK_AcceptChannel_get_first_per_commitment_point(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int8_tArray CS_LDK_CommonAcceptChannelFields_get_first_per_commitment_point(int64_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 CS_LDK_AcceptChannel_set_first_per_commitment_point(int64_t this_ptr, int8_tArray val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_first_per_commitment_point(int64_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); @@ -43021,23 +46726,23 @@ void CS_LDK_AcceptChannel_set_first_per_commitment_point(int64_t this_ptr, int8 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); } -int64_t CS_LDK_AcceptChannel_get_shutdown_scriptpubkey(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_shutdown_scriptpubkey(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_AcceptChannel_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_shutdown_scriptpubkey(int64_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); @@ -43046,24 +46751,24 @@ void CS_LDK_AcceptChannel_set_shutdown_scriptpubkey(int64_t this_ptr, int64_t v 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); } -int64_t CS_LDK_AcceptChannel_get_channel_type(int64_t this_ptr) { - LDKAcceptChannel this_ptr_conv; +int64_t CS_LDK_CommonAcceptChannelFields_get_channel_type(int64_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); int64_t ret_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 CS_LDK_AcceptChannel_set_channel_type(int64_t this_ptr, int64_t val) { - LDKAcceptChannel this_ptr_conv; +void CS_LDK_CommonAcceptChannelFields_set_channel_type(int64_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); @@ -43073,22 +46778,24 @@ void CS_LDK_AcceptChannel_set_channel_type(int64_t this_ptr, int64_t val) { 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); } -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_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); +int64_t CS_LDK_CommonAcceptChannelFields_new(int64_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, int64_t shutdown_scriptpubkey_arg, int64_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); @@ -43107,7 +46814,129 @@ int64_t CS_LDK_AcceptChannel_new(int8_tArray temporary_channel_id_arg, int64_t 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); + int64_t ret_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); + int64_t ret_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 CS_LDK_CommonAcceptChannelFields_clone_ptr(int64_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; +} + +int64_t CS_LDK_CommonAcceptChannelFields_clone(int64_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); + int64_t ret_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 CS_LDK_CommonAcceptChannelFields_hash(int64_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 CS_LDK_CommonAcceptChannelFields_eq(int64_t a, int64_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 CS_LDK_AcceptChannel_free(int64_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); +} + +int64_t CS_LDK_AcceptChannel_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_AcceptChannel_set_common_fields(int64_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; + 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 CS_LDK_AcceptChannel_get_channel_reserve_satoshis(int64_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 CS_LDK_AcceptChannel_set_channel_reserve_satoshis(int64_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); +} + +int64_t CS_LDK_AcceptChannel_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43177,27 +47006,31 @@ void CS_LDK_AcceptChannelV2_free(int64_t this_obj) { AcceptChannelV2_free(this_obj_conv); } -int8_tArray CS_LDK_AcceptChannelV2_get_temporary_channel_id(int64_t this_ptr) { +int64_t CS_LDK_AcceptChannelV2_get_common_fields(int64_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); + int64_t ret_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 CS_LDK_AcceptChannelV2_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_AcceptChannelV2_set_common_fields(int64_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; - 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 CS_LDK_AcceptChannelV2_get_funding_satoshis(int64_t this_ptr) { @@ -43219,258 +47052,6 @@ void CS_LDK_AcceptChannelV2_set_funding_satoshis(int64_t this_ptr, int64_t val) AcceptChannelV2_set_funding_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_AcceptChannelV2_get_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannelV2_set_dust_limit_satoshis(int64_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 CS_LDK_AcceptChannelV2_get_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannelV2_set_max_htlc_value_in_flight_msat(int64_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 CS_LDK_AcceptChannelV2_get_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannelV2_set_htlc_minimum_msat(int64_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 CS_LDK_AcceptChannelV2_get_minimum_depth(int64_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 CS_LDK_AcceptChannelV2_set_minimum_depth(int64_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 CS_LDK_AcceptChannelV2_get_to_self_delay(int64_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 CS_LDK_AcceptChannelV2_set_to_self_delay(int64_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 CS_LDK_AcceptChannelV2_get_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannelV2_set_max_accepted_htlcs(int64_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 CS_LDK_AcceptChannelV2_get_funding_pubkey(int64_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 CS_LDK_AcceptChannelV2_set_funding_pubkey(int64_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 CS_LDK_AcceptChannelV2_get_revocation_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_revocation_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_delayed_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_delayed_payment_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_htlc_basepoint(int64_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 CS_LDK_AcceptChannelV2_set_htlc_basepoint(int64_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 CS_LDK_AcceptChannelV2_get_first_per_commitment_point(int64_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 CS_LDK_AcceptChannelV2_set_first_per_commitment_point(int64_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 CS_LDK_AcceptChannelV2_get_second_per_commitment_point(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43494,58 +47075,6 @@ void CS_LDK_AcceptChannelV2_set_second_per_commitment_point(int64_t this_ptr, i AcceptChannelV2_set_second_per_commitment_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_AcceptChannelV2_get_shutdown_scriptpubkey(int64_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); - int64_t ret_ref = tag_ptr(ret_copy, true); - return ret_ref; -} - -void CS_LDK_AcceptChannelV2_set_shutdown_scriptpubkey(int64_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; - 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); -} - -int64_t CS_LDK_AcceptChannelV2_get_channel_type(int64_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); - int64_t ret_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 CS_LDK_AcceptChannelV2_set_channel_type(int64_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; - 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); -} - int32_t CS_LDK_AcceptChannelV2_get_require_confirmed_inputs(int64_t this_ptr) { LDKAcceptChannelV2 this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -43566,42 +47095,17 @@ void CS_LDK_AcceptChannelV2_set_require_confirmed_inputs(int64_t this_ptr, int3 AcceptChannelV2_set_require_confirmed_inputs(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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, int64_t shutdown_scriptpubkey_arg, int64_t channel_type_arg, int32_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); +int64_t CS_LDK_AcceptChannelV2_new(int64_t common_fields_arg, int64_t funding_satoshis_arg, int8_tArray second_per_commitment_point_arg, int32_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_cs(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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43671,27 +47175,31 @@ void CS_LDK_FundingCreated_free(int64_t this_obj) { FundingCreated_free(this_obj_conv); } -int8_tArray CS_LDK_FundingCreated_get_temporary_channel_id(int64_t this_ptr) { +int64_t CS_LDK_FundingCreated_get_temporary_channel_id(int64_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); + int64_t ret_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 CS_LDK_FundingCreated_set_temporary_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_FundingCreated_set_temporary_channel_id(int64_t this_ptr, int64_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 CS_LDK_FundingCreated_get_funding_txid(int64_t this_ptr) { @@ -43759,17 +47267,19 @@ void CS_LDK_FundingCreated_set_signature(int64_t this_ptr, int8_tArray val) { FundingCreated_set_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_FundingCreated_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43839,27 +47349,31 @@ void CS_LDK_FundingSigned_free(int64_t this_obj) { FundingSigned_free(this_obj_conv); } -int8_tArray CS_LDK_FundingSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_FundingSigned_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_FundingSigned_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_FundingSigned_get_signature(int64_t this_ptr) { @@ -43885,14 +47399,16 @@ void CS_LDK_FundingSigned_set_signature(int64_t this_ptr, int8_tArray val) { FundingSigned_set_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_FundingSigned_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -43962,27 +47478,31 @@ void CS_LDK_ChannelReady_free(int64_t this_obj) { ChannelReady_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelReady_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelReady_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ChannelReady_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelReady_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ChannelReady_get_next_per_commitment_point(int64_t this_ptr) { @@ -44033,10 +47553,12 @@ void CS_LDK_ChannelReady_set_short_channel_id_alias(int64_t this_ptr, int64_t v ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_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); +int64_t CS_LDK_ChannelReady_new(int64_t channel_id_arg, int8_tArray next_per_commitment_point_arg, int64_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); @@ -44044,7 +47566,7 @@ int64_t CS_LDK_ChannelReady_new(int8_tArray channel_id_arg, int8_tArray next_pe 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44114,27 +47636,31 @@ void CS_LDK_Stfu_free(int64_t this_obj) { Stfu_free(this_obj_conv); } -int8_tArray CS_LDK_Stfu_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Stfu_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_Stfu_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Stfu_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_Stfu_get_initiator(int64_t this_ptr) { @@ -44156,11 +47682,13 @@ void CS_LDK_Stfu_set_initiator(int64_t this_ptr, int8_t val) { Stfu_set_initiator(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_Stfu_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44220,27 +47748,31 @@ void CS_LDK_Splice_free(int64_t this_obj) { Splice_free(this_obj_conv); } -int8_tArray CS_LDK_Splice_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Splice_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_Splice_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Splice_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_Splice_get_chain_hash(int64_t this_ptr) { @@ -44346,17 +47878,19 @@ void CS_LDK_Splice_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { Splice_set_funding_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_Splice_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44416,27 +47950,31 @@ void CS_LDK_SpliceAck_free(int64_t this_obj) { SpliceAck_free(this_obj_conv); } -int8_tArray CS_LDK_SpliceAck_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_SpliceAck_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_SpliceAck_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_SpliceAck_get_chain_hash(int64_t this_ptr) { @@ -44504,17 +48042,19 @@ void CS_LDK_SpliceAck_set_funding_pubkey(int64_t this_ptr, int8_tArray val) { SpliceAck_set_funding_pubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_SpliceAck_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44574,34 +48114,40 @@ void CS_LDK_SpliceLocked_free(int64_t this_obj) { SpliceLocked_free(this_obj_conv); } -int8_tArray CS_LDK_SpliceLocked_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_SpliceLocked_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_SpliceLocked_set_channel_id(int64_t this_ptr, int64_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); } -int64_t CS_LDK_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); +int64_t CS_LDK_SpliceLocked_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44661,27 +48207,31 @@ void CS_LDK_TxAddInput_free(int64_t this_obj) { TxAddInput_free(this_obj_conv); } -int8_tArray CS_LDK_TxAddInput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAddInput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAddInput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAddInput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxAddInput_get_serial_id(int64_t this_ptr) { @@ -44768,16 +48318,18 @@ void CS_LDK_TxAddInput_set_sequence(int64_t this_ptr, int32_t val) { TxAddInput_set_sequence(&this_ptr_conv, val); } -int64_t CS_LDK_TxAddInput_new(int8_tArray channel_id_arg, int64_t serial_id_arg, int64_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); +int64_t CS_LDK_TxAddInput_new(int64_t channel_id_arg, int64_t serial_id_arg, int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -44847,27 +48399,31 @@ void CS_LDK_TxAddOutput_free(int64_t this_obj) { TxAddOutput_free(this_obj_conv); } -int8_tArray CS_LDK_TxAddOutput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAddOutput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAddOutput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAddOutput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxAddOutput_get_serial_id(int64_t this_ptr) { @@ -44934,15 +48490,17 @@ void CS_LDK_TxAddOutput_set_script(int64_t this_ptr, int8_tArray val) { TxAddOutput_set_script(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxAddOutput_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45012,27 +48570,31 @@ void CS_LDK_TxRemoveInput_free(int64_t this_obj) { TxRemoveInput_free(this_obj_conv); } -int8_tArray CS_LDK_TxRemoveInput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxRemoveInput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxRemoveInput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxRemoveInput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxRemoveInput_get_serial_id(int64_t this_ptr) { @@ -45054,11 +48616,13 @@ void CS_LDK_TxRemoveInput_set_serial_id(int64_t this_ptr, int64_t val) { TxRemoveInput_set_serial_id(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxRemoveInput_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45128,27 +48692,31 @@ void CS_LDK_TxRemoveOutput_free(int64_t this_obj) { TxRemoveOutput_free(this_obj_conv); } -int8_tArray CS_LDK_TxRemoveOutput_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxRemoveOutput_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxRemoveOutput_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxRemoveOutput_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxRemoveOutput_get_serial_id(int64_t this_ptr) { @@ -45170,11 +48738,13 @@ void CS_LDK_TxRemoveOutput_set_serial_id(int64_t this_ptr, int64_t val) { TxRemoveOutput_set_serial_id(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxRemoveOutput_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45244,34 +48814,40 @@ void CS_LDK_TxComplete_free(int64_t this_obj) { TxComplete_free(this_obj_conv); } -int8_tArray CS_LDK_TxComplete_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxComplete_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxComplete_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxComplete_set_channel_id(int64_t this_ptr, int64_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); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxComplete_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45341,27 +48917,31 @@ void CS_LDK_TxSignatures_free(int64_t this_obj) { TxSignatures_free(this_obj_conv); } -int8_tArray CS_LDK_TxSignatures_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxSignatures_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxSignatures_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxSignatures_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxSignatures_get_tx_hash(int64_t this_ptr) { @@ -45435,10 +49015,37 @@ void CS_LDK_TxSignatures_set_witnesses(int64_t this_ptr, ptrArray val) { TxSignatures_set_witnesses(&this_ptr_conv, val_constr); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxSignatures_get_funding_outpoint_sig(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_TxSignatures_set_funding_outpoint_sig(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_TxSignatures_new(int64_t channel_id_arg, int8_tArray tx_hash_arg, ptrArray witnesses_arg, int64_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); @@ -45459,7 +49066,11 @@ int64_t CS_LDK_TxSignatures_new(int8_tArray channel_id_arg, int8_tArray tx_hash witnesses_arg_constr.data[i] = witnesses_arg_conv_8_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45529,27 +49140,31 @@ void CS_LDK_TxInitRbf_free(int64_t this_obj) { TxInitRbf_free(this_obj_conv); } -int8_tArray CS_LDK_TxInitRbf_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxInitRbf_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxInitRbf_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxInitRbf_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxInitRbf_get_locktime(int64_t this_ptr) { @@ -45615,15 +49230,17 @@ void CS_LDK_TxInitRbf_set_funding_output_contribution(int64_t this_ptr, int64_t TxInitRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxInitRbf_new(int8_tArray channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, int64_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); +int64_t CS_LDK_TxInitRbf_new(int64_t channel_id_arg, int32_t locktime_arg, int32_t feerate_sat_per_1000_weight_arg, int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45693,27 +49310,31 @@ void CS_LDK_TxAckRbf_free(int64_t this_obj) { TxAckRbf_free(this_obj_conv); } -int8_tArray CS_LDK_TxAckRbf_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAckRbf_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAckRbf_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAckRbf_set_channel_id(int64_t this_ptr, int64_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); } int64_t CS_LDK_TxAckRbf_get_funding_output_contribution(int64_t this_ptr) { @@ -45741,15 +49362,17 @@ void CS_LDK_TxAckRbf_set_funding_output_contribution(int64_t this_ptr, int64_t TxAckRbf_set_funding_output_contribution(&this_ptr_conv, val_conv); } -int64_t CS_LDK_TxAckRbf_new(int8_tArray channel_id_arg, int64_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); +int64_t CS_LDK_TxAckRbf_new(int64_t channel_id_arg, int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45819,27 +49442,31 @@ void CS_LDK_TxAbort_free(int64_t this_obj) { TxAbort_free(this_obj_conv); } -int8_tArray CS_LDK_TxAbort_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_TxAbort_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_TxAbort_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_TxAbort_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_TxAbort_get_data(int64_t this_ptr) { @@ -45868,15 +49495,17 @@ void CS_LDK_TxAbort_set_data(int64_t this_ptr, int8_tArray val) { TxAbort_set_data(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_TxAbort_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -45946,27 +49575,31 @@ void CS_LDK_Shutdown_free(int64_t this_obj) { Shutdown_free(this_obj_conv); } -int8_tArray CS_LDK_Shutdown_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_Shutdown_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_Shutdown_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_Shutdown_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_Shutdown_get_scriptpubkey(int64_t this_ptr) { @@ -45995,15 +49628,17 @@ void CS_LDK_Shutdown_set_scriptpubkey(int64_t this_ptr, int8_tArray val) { Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_Shutdown_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46182,27 +49817,31 @@ void CS_LDK_ClosingSigned_free(int64_t this_obj) { ClosingSigned_free(this_obj_conv); } -int8_tArray CS_LDK_ClosingSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ClosingSigned_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ClosingSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ClosingSigned_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ClosingSigned_get_fee_satoshis(int64_t this_ptr) { @@ -46274,10 +49913,12 @@ void CS_LDK_ClosingSigned_set_fee_range(int64_t this_ptr, int64_t val) { ClosingSigned_set_fee_range(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_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); +int64_t CS_LDK_ClosingSigned_new(int64_t channel_id_arg, int64_t fee_satoshis_arg, int8_tArray signature_arg, int64_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); @@ -46286,7 +49927,7 @@ int64_t CS_LDK_ClosingSigned_new(int8_tArray channel_id_arg, int64_t fee_satosh 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46356,27 +49997,31 @@ void CS_LDK_UpdateAddHTLC_free(int64_t this_obj) { UpdateAddHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateAddHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateAddHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateAddHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateAddHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateAddHTLC_get_htlc_id(int64_t this_ptr) { @@ -46534,10 +50179,12 @@ void CS_LDK_UpdateAddHTLC_set_blinding_point(int64_t this_ptr, int8_tArray val) UpdateAddHTLC_set_blinding_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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, int64_t skimmed_fee_msat_arg, int64_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); +int64_t CS_LDK_UpdateAddHTLC_new(int64_t channel_id_arg, int64_t htlc_id_arg, int64_t amount_msat_arg, int8_tArray payment_hash_arg, int32_t cltv_expiry_arg, int64_t skimmed_fee_msat_arg, int64_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); @@ -46553,7 +50200,7 @@ int64_t CS_LDK_UpdateAddHTLC_new(int8_tArray channel_id_arg, int64_t htlc_id_ar 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46752,27 +50399,31 @@ void CS_LDK_UpdateFulfillHTLC_free(int64_t this_obj) { UpdateFulfillHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFulfillHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFulfillHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFulfillHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFulfillHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFulfillHTLC_get_htlc_id(int64_t this_ptr) { @@ -46817,14 +50468,16 @@ void CS_LDK_UpdateFulfillHTLC_set_payment_preimage(int64_t this_ptr, int8_tArra UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_UpdateFulfillHTLC_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -46894,27 +50547,31 @@ void CS_LDK_UpdateFailHTLC_free(int64_t this_obj) { UpdateFailHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFailHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFailHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFailHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFailHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFailHTLC_get_htlc_id(int64_t this_ptr) { @@ -46999,27 +50656,31 @@ void CS_LDK_UpdateFailMalformedHTLC_free(int64_t this_obj) { UpdateFailMalformedHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFailMalformedHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFailMalformedHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFailMalformedHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFailMalformedHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFailMalformedHTLC_get_htlc_id(int64_t this_ptr) { @@ -47123,27 +50784,31 @@ void CS_LDK_CommitmentSigned_free(int64_t this_obj) { CommitmentSigned_free(this_obj_conv); } -int8_tArray CS_LDK_CommitmentSigned_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_CommitmentSigned_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_CommitmentSigned_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_CommitmentSigned_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_CommitmentSigned_get_signature(int64_t this_ptr) { @@ -47213,10 +50878,12 @@ void CS_LDK_CommitmentSigned_set_htlc_signatures(int64_t this_ptr, ptrArray val CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr); } -int64_t CS_LDK_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); +int64_t CS_LDK_CommitmentSigned_new(int64_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); @@ -47235,7 +50902,7 @@ int64_t CS_LDK_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray sig htlc_signatures_arg_constr.data[i] = htlc_signatures_arg_conv_8_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47305,27 +50972,31 @@ void CS_LDK_RevokeAndACK_free(int64_t this_obj) { RevokeAndACK_free(this_obj_conv); } -int8_tArray CS_LDK_RevokeAndACK_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_RevokeAndACK_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_RevokeAndACK_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_RevokeAndACK_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_RevokeAndACK_get_per_commitment_secret(int64_t this_ptr) { @@ -47374,17 +51045,19 @@ void CS_LDK_RevokeAndACK_set_next_per_commitment_point(int64_t this_ptr, int8_t RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_RevokeAndACK_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47454,27 +51127,31 @@ void CS_LDK_UpdateFee_free(int64_t this_obj) { UpdateFee_free(this_obj_conv); } -int8_tArray CS_LDK_UpdateFee_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_UpdateFee_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_UpdateFee_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_UpdateFee_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_UpdateFee_get_feerate_per_kw(int64_t this_ptr) { @@ -47496,11 +51173,13 @@ void CS_LDK_UpdateFee_set_feerate_per_kw(int64_t this_ptr, int32_t val) { UpdateFee_set_feerate_per_kw(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_UpdateFee_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47570,27 +51249,31 @@ void CS_LDK_ChannelReestablish_free(int64_t this_obj) { ChannelReestablish_free(this_obj_conv); } -int8_tArray CS_LDK_ChannelReestablish_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ChannelReestablish_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ChannelReestablish_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ChannelReestablish_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ChannelReestablish_get_next_local_commitment_number(int64_t this_ptr) { @@ -47702,10 +51385,12 @@ void CS_LDK_ChannelReestablish_set_next_funding_txid(int64_t this_ptr, int64_t ChannelReestablish_set_next_funding_txid(&this_ptr_conv, val_conv); } -int64_t CS_LDK_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, int64_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); +int64_t CS_LDK_ChannelReestablish_new(int64_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, int64_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); @@ -47716,7 +51401,7 @@ int64_t CS_LDK_ChannelReestablish_new(int8_tArray channel_id_arg, int64_t next_ 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -47786,27 +51471,31 @@ void CS_LDK_AnnouncementSignatures_free(int64_t this_obj) { AnnouncementSignatures_free(this_obj_conv); } -int8_tArray CS_LDK_AnnouncementSignatures_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_AnnouncementSignatures_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_AnnouncementSignatures_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_AnnouncementSignatures_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_AnnouncementSignatures_get_short_channel_id(int64_t this_ptr) { @@ -47874,17 +51563,19 @@ void CS_LDK_AnnouncementSignatures_set_bitcoin_signature(int64_t this_ptr, int8 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref); } -int64_t CS_LDK_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); +int64_t CS_LDK_AnnouncementSignatures_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -48371,6 +52062,107 @@ void CS_LDK_UnsignedNodeAnnouncement_set_addresses(int64_t this_ptr, int64_tArr UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr); } +int8_tArray CS_LDK_UnsignedNodeAnnouncement_get_excess_address_data(int64_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 CS_LDK_UnsignedNodeAnnouncement_set_excess_address_data(int64_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 CS_LDK_UnsignedNodeAnnouncement_get_excess_data(int64_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 CS_LDK_UnsignedNodeAnnouncement_set_excess_data(int64_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); +} + +int64_t CS_LDK_UnsignedNodeAnnouncement_new(int64_t features_arg, int32_t timestamp_arg, int64_t node_id_arg, int8_tArray rgb_arg, int64_t alias_arg, int64_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; + int64_t* addresses_arg_vals = addresses_arg->elems; + for (size_t p = 0; p < addresses_arg_constr.datalen; p++) { + int64_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); + int64_t ret_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); int64_t ret_ref = 0; @@ -51063,6 +54855,191 @@ jboolean CS_LDK_OnionPacket_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_TrampolineOnionPacket_free(int64_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 CS_LDK_TrampolineOnionPacket_get_version(int64_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 CS_LDK_TrampolineOnionPacket_set_version(int64_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 CS_LDK_TrampolineOnionPacket_get_public_key(int64_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 CS_LDK_TrampolineOnionPacket_set_public_key(int64_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 CS_LDK_TrampolineOnionPacket_get_hop_data(int64_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 CS_LDK_TrampolineOnionPacket_set_hop_data(int64_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 CS_LDK_TrampolineOnionPacket_get_hmac(int64_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 CS_LDK_TrampolineOnionPacket_set_hmac(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_TrampolineOnionPacket_clone_ptr(int64_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; +} + +int64_t CS_LDK_TrampolineOnionPacket_clone(int64_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); + int64_t ret_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 CS_LDK_TrampolineOnionPacket_hash(int64_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 CS_LDK_TrampolineOnionPacket_eq(int64_t a, int64_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 CS_LDK_TrampolineOnionPacket_write(int64_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; +} + int8_tArray CS_LDK_AcceptChannel_write(int64_t obj) { LDKAcceptChannel obj_conv; obj_conv.inner = untag_ptr(obj); @@ -52580,6 +56557,127 @@ void CS_LDK_SocketDescriptor_free(int64_t this_ptr) { SocketDescriptor_free(this_ptr_conv); } +void CS_LDK_PeerDetails_free(int64_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 CS_LDK_PeerDetails_get_counterparty_node_id(int64_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 CS_LDK_PeerDetails_set_counterparty_node_id(int64_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); +} + +int64_t CS_LDK_PeerDetails_get_socket_address(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_PeerDetails_set_socket_address(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_PeerDetails_get_init_features(int64_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); + int64_t ret_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 CS_LDK_PeerDetails_set_init_features(int64_t this_ptr, int64_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 CS_LDK_PeerDetails_get_is_inbound_connection(int64_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 CS_LDK_PeerDetails_set_is_inbound_connection(int64_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); +} + +int64_t CS_LDK_PeerDetails_new(int8_tArray counterparty_node_id_arg, int64_t socket_address_arg, int64_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); + int64_t ret_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 CS_LDK_PeerHandleError_free(int64_t this_obj) { LDKPeerHandleError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -52666,26 +56764,44 @@ int64_t CS_LDK_PeerManager_new(int64_t message_handler, int32_t current_time, i return ret_ref; } -int64_tArray CS_LDK_PeerManager_get_peer_node_ids(int64_t this_arg) { +int64_tArray CS_LDK_PeerManager_list_peers(int64_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); int64_tArray ret_arr = NULL; ret_arr = init_int64_tArray(ret_var.datalen, __LINE__); int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8); - for (size_t 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]; + int64_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; } +int64_t CS_LDK_PeerManager_peer_by_node_id(int64_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); + int64_t ret_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 CS_LDK_PeerManager_new_outbound_connection(int64_t this_arg, int8_tArray their_node_id, int64_t descriptor, int64_t remote_network_address) { LDKPeerManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -58518,6 +62634,120 @@ jboolean CS_LDK_NodeFeatures_requires_keysend(int64_t this_arg) { return ret_conv; } +void CS_LDK_InitFeatures_set_trampoline_routing_optional(int64_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 CS_LDK_InitFeatures_set_trampoline_routing_required(int64_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 CS_LDK_InitFeatures_supports_trampoline_routing(int64_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 CS_LDK_NodeFeatures_set_trampoline_routing_optional(int64_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 CS_LDK_NodeFeatures_set_trampoline_routing_required(int64_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 CS_LDK_NodeFeatures_supports_trampoline_routing(int64_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 CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_optional(int64_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 CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_required(int64_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 CS_LDK_Bolt11InvoiceFeatures_supports_trampoline_routing(int64_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 CS_LDK_InitFeatures_requires_trampoline_routing(int64_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 CS_LDK_NodeFeatures_requires_trampoline_routing(int64_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 CS_LDK_Bolt11InvoiceFeatures_requires_trampoline_routing(int64_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 CS_LDK_ShutdownScript_free(int64_t this_obj) { LDKShutdownScript this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -58743,6 +62973,222 @@ jboolean CS_LDK_ShutdownScript_is_compatible(int64_t this_arg, int64_t features return ret_conv; } +void CS_LDK_ChannelId_free(int64_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 CS_LDK_ChannelId_get_a(int64_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 CS_LDK_ChannelId_set_a(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_ChannelId_clone_ptr(int64_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; +} + +int64_t CS_LDK_ChannelId_clone(int64_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); + int64_t ret_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 CS_LDK_ChannelId_eq(int64_t a, int64_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 CS_LDK_ChannelId_hash(int64_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; +} + +int64_t CS_LDK_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); + int64_t ret_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 CS_LDK_ChannelId_v1_from_funding_outpoint(int64_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); + int64_t ret_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 CS_LDK_ChannelId_temporary_from_entropy_source(int64_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); + int64_t ret_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 CS_LDK_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); + int64_t ret_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 CS_LDK_ChannelId_new_zero() { + LDKChannelId ret_var = ChannelId_new_zero(); + int64_t ret_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 CS_LDK_ChannelId_is_zero(int64_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; +} + +int64_t CS_LDK_ChannelId_v2_from_revocation_basepoints(int64_t ours, int64_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); + int64_t ret_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 CS_LDK_ChannelId_temporary_v2_from_revocation_basepoint(int64_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); + int64_t ret_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 CS_LDK_ChannelId_write(int64_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; +} + +int64_t CS_LDK_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); +} + void CS_LDK_Retry_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -59262,6 +63708,413 @@ void CS_LDK_Type_free(int64_t this_ptr) { Type_free(this_ptr_conv); } +void CS_LDK_OfferId_free(int64_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 CS_LDK_OfferId_get_a(int64_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 CS_LDK_OfferId_set_a(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_OfferId_clone_ptr(int64_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; +} + +int64_t CS_LDK_OfferId_clone(int64_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); + int64_t ret_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 CS_LDK_OfferId_eq(int64_t a, int64_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 CS_LDK_OfferId_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_OfferWithExplicitMetadataBuilder_free(int64_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); + int64_t ret_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 CS_LDK_OfferWithExplicitMetadataBuilder_clone_ptr(int64_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; +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_clone(int64_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); + int64_t ret_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 CS_LDK_OfferWithDerivedMetadataBuilder_free(int64_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); + int64_t ret_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 CS_LDK_OfferWithDerivedMetadataBuilder_clone_ptr(int64_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; +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_clone(int64_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); + int64_t ret_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 CS_LDK_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); + int64_t ret_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 CS_LDK_OfferWithExplicitMetadataBuilder_metadata(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_chain(int64_t this_arg, int32_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_cs(network); + OfferWithExplicitMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_OfferWithExplicitMetadataBuilder_amount_msats(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_absolute_expiry(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_description(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_issuer(int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_path(int64_t this_arg, int64_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 CS_LDK_OfferWithExplicitMetadataBuilder_supported_quantity(int64_t this_arg, int64_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); +} + +int64_t CS_LDK_OfferWithExplicitMetadataBuilder_build(int64_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); +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(int8_tArray node_id, int64_t expanded_key, int64_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); + int64_t ret_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 CS_LDK_OfferWithDerivedMetadataBuilder_chain(int64_t this_arg, int32_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_cs(network); + OfferWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_OfferWithDerivedMetadataBuilder_amount_msats(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_absolute_expiry(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_description(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_issuer(int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_path(int64_t this_arg, int64_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 CS_LDK_OfferWithDerivedMetadataBuilder_supported_quantity(int64_t this_arg, int64_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); +} + +int64_t CS_LDK_OfferWithDerivedMetadataBuilder_build(int64_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 CS_LDK_Offer_free(int64_t this_obj) { LDKOffer this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -59338,10 +64191,9 @@ int64_t CS_LDK_Offer_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59424,10 +64276,9 @@ int64_t CS_LDK_Offer_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59442,6 +64293,19 @@ int8_tArray CS_LDK_Offer_signing_pubkey(int64_t this_arg) { return ret_arr; } +int64_t CS_LDK_Offer_id(int64_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); + int64_t ret_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 CS_LDK_Offer_supports_chain(int64_t this_arg, int8_tArray chain) { LDKOffer this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -59495,6 +64359,89 @@ jboolean CS_LDK_Offer_expects_quantity(int64_t this_arg) { return ret_conv; } +int64_t CS_LDK_Offer_request_invoice_deriving_payer_id(int64_t this_arg, int64_t expanded_key, int64_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); +} + +int64_t CS_LDK_Offer_request_invoice_deriving_metadata(int64_t this_arg, int8_tArray payer_id, int64_t expanded_key, int64_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); +} + +int64_t CS_LDK_Offer_request_invoice(int64_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 CS_LDK_Offer_hash(int64_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 CS_LDK_Offer_write(int64_t obj) { LDKOffer obj_conv; obj_conv.inner = untag_ptr(obj); @@ -59508,95 +64455,316 @@ int8_tArray CS_LDK_Offer_write(int64_t obj) { return ret_arr; } -void CS_LDK_Amount_free(int64_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 CS_LDK_Amount_free(int64_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } int64_t CS_LDK_Amount_clone_ptr(int64_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; } int64_t CS_LDK_Amount_clone(int64_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Amount_bitcoin(int64_t amount_msats) { + LDKAmount *ret_copy = MALLOC(sizeof(LDKAmount), "LDKAmount"); + *ret_copy = Amount_bitcoin(amount_msats); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -void CS_LDK_Quantity_free(int64_t this_obj) { - LDKQuantity this_obj_conv; +void CS_LDK_Quantity_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_Quantity_clone_ptr(int64_t arg) { + LDKQuantity* arg_conv = (LDKQuantity*)untag_ptr(arg); + int64_t ret_conv = Quantity_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_Quantity_clone(int64_t orig) { + LDKQuantity* orig_conv = (LDKQuantity*)untag_ptr(orig); + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_bounded(int64_t a) { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_bounded(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_unbounded() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_unbounded(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_Quantity_one() { + LDKQuantity *ret_copy = MALLOC(sizeof(LDKQuantity), "LDKQuantity"); + *ret_copy = Quantity_one(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_free(int64_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); +} + +int64_t CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_build(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(int64_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 CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(int64_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); +} + +int64_t CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(int64_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 CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(int64_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 CS_LDK_UnsignedBolt12Invoice_free(int64_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); int64_t ret_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 CS_LDK_Quantity_clone_ptr(int64_t arg) { - LDKQuantity arg_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_clone_ptr(int64_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; } -int64_t CS_LDK_Quantity_clone(int64_t orig) { - LDKQuantity orig_conv; +int64_t CS_LDK_UnsignedBolt12Invoice_clone(int64_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); int64_t ret_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 CS_LDK_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 CS_LDK_UnsignedBolt12Invoice_free(int64_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 CS_LDK_SignBolt12InvoiceFn_free(int64_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); } int64_t CS_LDK_UnsignedBolt12Invoice_tagged_hash(int64_t this_arg) { @@ -59691,10 +64859,9 @@ int64_t CS_LDK_UnsignedBolt12Invoice_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59777,10 +64944,9 @@ int64_t CS_LDK_UnsignedBolt12Invoice_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -59961,10 +65127,9 @@ int64_t CS_LDK_Bolt12Invoice_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60047,10 +65212,9 @@ int64_t CS_LDK_Bolt12Invoice_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60228,6 +65392,16 @@ int64_t CS_LDK_Bolt12Invoice_verify(int64_t this_arg, int64_t key) { return tag_ptr(ret_conv, true); } +int64_t CS_LDK_Bolt12Invoice_hash(int64_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 CS_LDK_UnsignedBolt12Invoice_write(int64_t obj) { LDKUnsignedBolt12Invoice obj_conv; obj_conv.inner = untag_ptr(obj); @@ -60711,6 +65885,142 @@ int64_t CS_LDK_InvoiceError_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +void CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_free(int64_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 CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_free(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_build(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_chain(int64_t this_arg, int32_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_cs(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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_quantity(int64_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 CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_payer_note(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_chain(int64_t this_arg, int32_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_cs(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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(int64_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); +} + +int64_t CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_quantity(int64_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 CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_payer_note(int64_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 CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { LDKUnsignedInvoiceRequest this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -60719,6 +66029,45 @@ void CS_LDK_UnsignedInvoiceRequest_free(int64_t this_obj) { UnsignedInvoiceRequest_free(this_obj_conv); } +static inline uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg) { + LDKUnsignedInvoiceRequest ret_var = UnsignedInvoiceRequest_clone(arg); + int64_t ret_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 CS_LDK_UnsignedInvoiceRequest_clone_ptr(int64_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; +} + +int64_t CS_LDK_UnsignedInvoiceRequest_clone(int64_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); + int64_t ret_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 CS_LDK_SignInvoiceRequestFn_free(int64_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); +} + int64_t CS_LDK_UnsignedInvoiceRequest_tagged_hash(int64_t this_arg) { LDKUnsignedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -60778,6 +66127,33 @@ void CS_LDK_VerifiedInvoiceRequest_free(int64_t this_obj) { VerifiedInvoiceRequest_free(this_obj_conv); } +int64_t CS_LDK_VerifiedInvoiceRequest_get_offer_id(int64_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); + int64_t ret_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 CS_LDK_VerifiedInvoiceRequest_set_offer_id(int64_t this_ptr, int64_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); +} + int64_t CS_LDK_VerifiedInvoiceRequest_get_keys(int64_t this_ptr) { LDKVerifiedInvoiceRequest this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -60871,10 +66247,9 @@ int64_t CS_LDK_UnsignedInvoiceRequest_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -60957,10 +66332,9 @@ int64_t CS_LDK_UnsignedInvoiceRequest_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61097,10 +66471,9 @@ int64_t CS_LDK_InvoiceRequest_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61183,10 +66556,9 @@ int64_t CS_LDK_InvoiceRequest_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61285,15 +66657,64 @@ int64_t CS_LDK_InvoiceRequest_payer_note(int64_t this_arg) { return ret_ref; } -int8_tArray CS_LDK_InvoiceRequest_signature(int64_t this_arg) { +int64_t CS_LDK_InvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_InvoiceRequest_respond_with_no_std(int64_t this_arg, int64_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; + 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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); } int64_t CS_LDK_InvoiceRequest_verify(int64_t this_arg, int64_t key) { @@ -61312,6 +66733,17 @@ int64_t CS_LDK_InvoiceRequest_verify(int64_t this_arg, int64_t key) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_InvoiceRequest_signature(int64_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 CS_LDK_VerifiedInvoiceRequest_chains(int64_t this_arg) { LDKVerifiedInvoiceRequest this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -61350,10 +66782,9 @@ int64_t CS_LDK_VerifiedInvoiceRequest_amount(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61436,10 +66867,9 @@ int64_t CS_LDK_VerifiedInvoiceRequest_supported_quantity(int64_t this_arg) { this_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); - int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -61538,6 +66968,126 @@ int64_t CS_LDK_VerifiedInvoiceRequest_payer_note(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_VerifiedInvoiceRequest_respond_with(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_with_no_std(int64_t this_arg, int64_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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys(int64_t this_arg, int64_tArray payment_paths, int8_tArray payment_hash) { + 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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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(&this_arg_conv, payment_paths_constr, payment_hash_ref); + return tag_ptr(ret_conv, true); +} + +int64_t CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std(int64_t this_arg, int64_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; + int64_t* payment_paths_vals = payment_paths->elems; + for (size_t l = 0; l < payment_paths_constr.datalen; l++) { + int64_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 CS_LDK_UnsignedInvoiceRequest_write(int64_t obj) { LDKUnsignedInvoiceRequest obj_conv; obj_conv.inner = untag_ptr(obj); @@ -61564,6 +67114,177 @@ int8_tArray CS_LDK_InvoiceRequest_write(int64_t obj) { return ret_arr; } +void CS_LDK_InvoiceRequestFields_free(int64_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 CS_LDK_InvoiceRequestFields_get_payer_id(int64_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 CS_LDK_InvoiceRequestFields_set_payer_id(int64_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); +} + +int64_t CS_LDK_InvoiceRequestFields_get_quantity(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_InvoiceRequestFields_set_quantity(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_InvoiceRequestFields_get_payer_note_truncated(int64_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); + int64_t ret_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 CS_LDK_InvoiceRequestFields_set_payer_note_truncated(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_InvoiceRequestFields_new(int8_tArray payer_id_arg, int64_t quantity_arg, int64_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_InvoiceRequestFields_clone_ptr(int64_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; +} + +int64_t CS_LDK_InvoiceRequestFields_clone(int64_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); + int64_t ret_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 CS_LDK_InvoiceRequestFields_eq(int64_t a, int64_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 CS_LDK_InvoiceRequestFields_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_TaggedHash_free(int64_t this_obj) { LDKTaggedHash this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -61636,6 +67357,50 @@ int8_tArray CS_LDK_TaggedHash_merkle_root(int64_t this_arg) { return ret_arr; } +void CS_LDK_SignError_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_SignError_clone_ptr(int64_t arg) { + LDKSignError* arg_conv = (LDKSignError*)untag_ptr(arg); + int64_t ret_conv = SignError_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_SignError_clone(int64_t orig) { + LDKSignError* orig_conv = (LDKSignError*)untag_ptr(orig); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SignError_signing() { + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_signing(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_SignError_verification(int32_t a) { + LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_cs(a); + LDKSignError *ret_copy = MALLOC(sizeof(LDKSignError), "LDKSignError"); + *ret_copy = SignError_verification(a_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + void CS_LDK_Bolt12ParseError_free(int64_t this_obj) { LDKBolt12ParseError this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -61795,6 +67560,11 @@ int32_t CS_LDK_Bolt12SemanticError_missing_paths() { return ret_conv; } +int32_t CS_LDK_Bolt12SemanticError_unexpected_paths() { + int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_unexpected_paths()); + return ret_conv; +} + int32_t CS_LDK_Bolt12SemanticError_invalid_pay_info() { int32_t ret_conv = LDKBolt12SemanticError_to_cs(Bolt12SemanticError_invalid_pay_info()); return ret_conv; @@ -61815,6 +67585,164 @@ int32_t CS_LDK_Bolt12SemanticError_missing_signature() { return ret_conv; } +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_free(int64_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); + int64_t ret_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone_ptr(int64_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; +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone(int64_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); + int64_t ret_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 CS_LDK_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); +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(int8_tArray node_id, int64_t expanded_key, int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_description(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_issuer(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_path(int64_t this_arg, int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_chain(int64_t this_arg, int32_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_cs(network); + RefundMaybeWithDerivedMetadataBuilder_chain(this_arg_conv, network_conv); +} + +void CS_LDK_RefundMaybeWithDerivedMetadataBuilder_quantity(int64_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 CS_LDK_RefundMaybeWithDerivedMetadataBuilder_payer_note(int64_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); +} + +int64_t CS_LDK_RefundMaybeWithDerivedMetadataBuilder_build(int64_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 CS_LDK_Refund_free(int64_t this_obj) { LDKRefund this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -62015,6 +67943,16 @@ int64_t CS_LDK_Refund_payer_note(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_Refund_hash(int64_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 CS_LDK_Refund_write(int64_t obj) { LDKRefund obj_conv; obj_conv.inner = untag_ptr(obj); @@ -62246,6 +68184,16 @@ int64_t CS_LDK_NodeId_from_pubkey(int8_tArray pubkey) { return ret_ref; } +int64_t CS_LDK_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 CS_LDK_NodeId_as_slice(int64_t this_arg) { LDKNodeId this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -63119,6 +69067,32 @@ int64_t CS_LDK_DirectedChannelInfo_effective_capacity(int64_t this_arg) { return ret_ref; } +int64_t CS_LDK_DirectedChannelInfo_source(int64_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); + int64_t ret_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 CS_LDK_DirectedChannelInfo_target(int64_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); + int64_t ret_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 CS_LDK_EffectiveCapacity_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -63839,6 +69813,16 @@ jboolean CS_LDK_NodeInfo_eq(int64_t a, int64_t b) { return ret_conv; } +jboolean CS_LDK_NodeInfo_is_tor_only(int64_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; +} + int8_tArray CS_LDK_NodeInfo_write(int64_t obj) { LDKNodeInfo obj_conv; obj_conv.inner = untag_ptr(obj); @@ -67995,7 +73979,34 @@ void CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(int64_t t DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val); } -int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg) { +int64_t CS_LDK_DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(int64_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); + int64_t ret_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 CS_LDK_DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tArray per_commitment_point_arg, int16_t to_self_delay_arg, int64_t output_arg, int64_t revocation_pubkey_arg, int8_tArray channel_keys_id_arg, int64_t channel_value_satoshis_arg, int64_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); @@ -68016,7 +74027,12 @@ int64_t CS_LDK_DelayedPaymentOutputDescriptor_new(int64_t outpoint_arg, int8_tA 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -68700,6 +74716,29 @@ void CS_LDK_HTLCDescriptor_set_channel_derivation_parameters(int64_t this_ptr, HTLCDescriptor_set_channel_derivation_parameters(&this_ptr_conv, val_conv); } +int8_tArray CS_LDK_HTLCDescriptor_get_commitment_txid(int64_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 CS_LDK_HTLCDescriptor_set_commitment_txid(int64_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 CS_LDK_HTLCDescriptor_get_per_commitment_number(int64_t this_ptr) { LDKHTLCDescriptor this_ptr_conv; this_ptr_conv.inner = untag_ptr(this_ptr); @@ -68836,6 +74875,37 @@ void CS_LDK_HTLCDescriptor_set_counterparty_sig(int64_t this_ptr, int8_tArray v HTLCDescriptor_set_counterparty_sig(&this_ptr_conv, val_ref); } +int64_t CS_LDK_HTLCDescriptor_new(int64_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, int64_t htlc_arg, int64_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); + int64_t ret_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); int64_t ret_ref = 0; @@ -69040,6 +75110,15 @@ void CS_LDK_NodeSigner_free(int64_t this_ptr) { NodeSigner_free(this_ptr_conv); } +void CS_LDK_OutputSpender_free(int64_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 CS_LDK_SignerProvider_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -69049,6 +75128,15 @@ void CS_LDK_SignerProvider_free(int64_t this_ptr) { SignerProvider_free(this_ptr_conv); } +void CS_LDK_ChangeDestinationSource_free(int64_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 CS_LDK_InMemorySigner_free(int64_t this_obj) { LDKInMemorySigner this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -69540,76 +75628,36 @@ int64_t CS_LDK_KeysManager_sign_spendable_outputs_psbt(int64_t this_arg, int64_ return tag_ptr(ret_conv, true); } -int64_t CS_LDK_KeysManager_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_t locktime) { +int64_t CS_LDK_KeysManager_as_EntropySource(int64_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; - int64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_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; - int64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_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); } -int64_t CS_LDK_KeysManager_as_EntropySource(int64_t this_arg) { +int64_t CS_LDK_KeysManager_as_NodeSigner(int64_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); } -int64_t CS_LDK_KeysManager_as_NodeSigner(int64_t this_arg) { +int64_t CS_LDK_KeysManager_as_OutputSpender(int64_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); } @@ -69654,6 +75702,17 @@ int64_t CS_LDK_PhantomKeysManager_as_NodeSigner(int64_t this_arg) { return tag_ptr(ret_ret, true); } +int64_t CS_LDK_PhantomKeysManager_as_OutputSpender(int64_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); +} + int64_t CS_LDK_PhantomKeysManager_as_SignerProvider(int64_t this_arg) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -69681,57 +75740,6 @@ int64_t CS_LDK_PhantomKeysManager_new(int8_tArray seed, int64_t starting_time_s return ret_ref; } -int64_t CS_LDK_PhantomKeysManager_spend_spendable_outputs(int64_t this_arg, int64_tArray descriptors, int64_tArray outputs, int8_tArray change_destination_script, int32_t feerate_sat_per_1000_weight, int64_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; - int64_t* descriptors_vals = descriptors->elems; - for (size_t b = 0; b < descriptors_constr.datalen; b++) { - int64_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; - int64_t* outputs_vals = outputs->elems; - for (size_t h = 0; h < outputs_constr.datalen; h++) { - int64_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); -} - int64_t CS_LDK_PhantomKeysManager_derive_channel_keys(int64_t this_arg, int64_t channel_value_satoshis, int8_tArray params) { LDKPhantomKeysManager this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); @@ -69771,6 +75779,36 @@ int8_tArray CS_LDK_PhantomKeysManager_get_phantom_node_secret_key(int64_t this_ return ret_arr; } +void CS_LDK_RandomBytes_free(int64_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); +} + +int64_t CS_LDK_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); + int64_t ret_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 CS_LDK_RandomBytes_as_EntropySource(int64_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 CS_LDK_EcdsaChannelSigner_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -70091,6 +76129,29 @@ int64_t CS_LDK_Destination_blinded_path(int64_t a) { return ret_ref; } +int64_t CS_LDK_Destination_hash(int64_t o) { + LDKDestination* o_conv = (LDKDestination*)untag_ptr(o); + int64_t ret_conv = Destination_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_Destination_eq(int64_t a, int64_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 CS_LDK_Destination_resolve(int64_t this_arg, int64_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 CS_LDK_SendSuccess_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -70137,6 +76198,12 @@ int64_t CS_LDK_SendSuccess_buffered_awaiting_connection(int8_tArray a) { return ret_ref; } +int64_t CS_LDK_SendSuccess_hash(int64_t o) { + LDKSendSuccess* o_conv = (LDKSendSuccess*)untag_ptr(o); + int64_t ret_conv = SendSuccess_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SendSuccess_eq(int64_t a, int64_t b) { LDKSendSuccess* a_conv = (LDKSendSuccess*)untag_ptr(a); LDKSendSuccess* b_conv = (LDKSendSuccess*)untag_ptr(b); @@ -70233,6 +76300,13 @@ int64_t CS_LDK_SendError_get_node_id_failed() { return ret_ref; } +int64_t CS_LDK_SendError_unresolved_introduction_node() { + LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); + *ret_copy = SendError_unresolved_introduction_node(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_SendError_blinded_path_advance_failed() { LDKSendError *ret_copy = MALLOC(sizeof(LDKSendError), "LDKSendError"); *ret_copy = SendError_blinded_path_advance_failed(); @@ -70240,6 +76314,12 @@ int64_t CS_LDK_SendError_blinded_path_advance_failed() { return ret_ref; } +int64_t CS_LDK_SendError_hash(int64_t o) { + LDKSendError* o_conv = (LDKSendError*)untag_ptr(o); + int64_t ret_conv = SendError_hash(o_conv); + return ret_conv; +} + jboolean CS_LDK_SendError_eq(int64_t a, int64_t b) { LDKSendError* a_conv = (LDKSendError*)untag_ptr(a); LDKSendError* b_conv = (LDKSendError*)untag_ptr(b); @@ -70285,17 +76365,18 @@ int64_t CS_LDK_PeeledOnion_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_PeeledOnion_forward(int8_tArray a, int64_t b) { - LDKPublicKey a_ref; - CHECK(a->arr_len == 33); - memcpy(a_ref.compressed_form, a->elems, 33); FREE(a); +int64_t CS_LDK_PeeledOnion_forward(int64_t a, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -70319,13 +76400,53 @@ int64_t CS_LDK_PeeledOnion_receive(int64_t a, int8_tArray b, int64_t c) { return ret_ref; } -int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer, int64_t path, int64_t contents, int64_t reply_path) { +int64_t CS_LDK_create_onion_message_resolving_destination(int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t network_graph, int64_t path, int64_t contents, int64_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); +} + +int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer, int64_t node_id_lookup, int64_t path, int64_t contents, int64_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); @@ -70344,7 +76465,7 @@ int64_t CS_LDK_create_onion_message(int64_t entropy_source, int64_t node_signer 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); } @@ -70380,7 +76501,7 @@ int64_t CS_LDK_peel_onion_message(int64_t msg, int64_t node_signer, int64_t log return tag_ptr(ret_conv, true); } -int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { +int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, int64_t logger, int64_t node_id_lookup, int64_t message_router, int64_t offers_handler, int64_t custom_handler) { void* entropy_source_ptr = untag_ptr(entropy_source); CHECK_ACCESS(entropy_source_ptr); LDKEntropySource entropy_source_conv = *(LDKEntropySource*)(entropy_source_ptr); @@ -70402,6 +76523,13 @@ int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, // 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); @@ -70423,7 +76551,7 @@ int64_t CS_LDK_OnionMessenger_new(int64_t entropy_source, int64_t node_signer, // 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -70862,6 +76990,65 @@ void CS_LDK_OnionMessageContents_free(int64_t this_ptr) { OnionMessageContents_free(this_ptr_conv); } +void CS_LDK_NextMessageHop_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_NextMessageHop_clone_ptr(int64_t arg) { + LDKNextMessageHop* arg_conv = (LDKNextMessageHop*)untag_ptr(arg); + int64_t ret_conv = NextMessageHop_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_NextMessageHop_clone(int64_t orig) { + LDKNextMessageHop* orig_conv = (LDKNextMessageHop*)untag_ptr(orig); + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_short_channel_id(int64_t a) { + LDKNextMessageHop *ret_copy = MALLOC(sizeof(LDKNextMessageHop), "LDKNextMessageHop"); + *ret_copy = NextMessageHop_short_channel_id(a); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_NextMessageHop_hash(int64_t o) { + LDKNextMessageHop* o_conv = (LDKNextMessageHop*)untag_ptr(o); + int64_t ret_conv = NextMessageHop_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_NextMessageHop_eq(int64_t a, int64_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 CS_LDK_BlindedPath_free(int64_t this_obj) { LDKBlindedPath this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -70870,27 +77057,29 @@ void CS_LDK_BlindedPath_free(int64_t this_obj) { BlindedPath_free(this_obj_conv); } -int8_tArray CS_LDK_BlindedPath_get_introduction_node_id(int64_t this_ptr) { +int64_t CS_LDK_BlindedPath_get_introduction_node(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; } -void CS_LDK_BlindedPath_set_introduction_node_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_BlindedPath_set_introduction_node(int64_t this_ptr, int64_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 CS_LDK_BlindedPath_get_blinding_point(int64_t this_ptr) { @@ -70964,10 +77153,11 @@ void CS_LDK_BlindedPath_set_blinded_hops(int64_t this_ptr, int64_tArray val) { BlindedPath_set_blinded_hops(&this_ptr_conv, val_constr); } -int64_t CS_LDK_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArray blinding_point_arg, int64_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); +int64_t CS_LDK_BlindedPath_new(int64_t introduction_node_arg, int8_tArray blinding_point_arg, int64_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); @@ -70988,7 +77178,7 @@ int64_t CS_LDK_BlindedPath_new(int8_tArray introduction_node_id_arg, int8_tArra 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -71050,6 +77240,131 @@ jboolean CS_LDK_BlindedPath_eq(int64_t a, int64_t b) { return ret_conv; } +void CS_LDK_IntroductionNode_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_IntroductionNode_clone_ptr(int64_t arg) { + LDKIntroductionNode* arg_conv = (LDKIntroductionNode*)untag_ptr(arg); + int64_t ret_conv = IntroductionNode_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_IntroductionNode_clone(int64_t orig) { + LDKIntroductionNode* orig_conv = (LDKIntroductionNode*)untag_ptr(orig); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_directed_short_channel_id(int32_t a, int64_t b) { + LDKDirection a_conv = LDKDirection_from_cs(a); + LDKIntroductionNode *ret_copy = MALLOC(sizeof(LDKIntroductionNode), "LDKIntroductionNode"); + *ret_copy = IntroductionNode_directed_short_channel_id(a_conv, b); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_IntroductionNode_hash(int64_t o) { + LDKIntroductionNode* o_conv = (LDKIntroductionNode*)untag_ptr(o); + int64_t ret_conv = IntroductionNode_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_IntroductionNode_eq(int64_t a, int64_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; +} + +int32_t CS_LDK_Direction_clone(int64_t orig) { + LDKDirection* orig_conv = (LDKDirection*)untag_ptr(orig); + int32_t ret_conv = LDKDirection_to_cs(Direction_clone(orig_conv)); + return ret_conv; +} + +int32_t CS_LDK_Direction_node_one() { + int32_t ret_conv = LDKDirection_to_cs(Direction_node_one()); + return ret_conv; +} + +int32_t CS_LDK_Direction_node_two() { + int32_t ret_conv = LDKDirection_to_cs(Direction_node_two()); + return ret_conv; +} + +int64_t CS_LDK_Direction_hash(int64_t o) { + LDKDirection* o_conv = (LDKDirection*)untag_ptr(o); + int64_t ret_conv = Direction_hash(o_conv); + return ret_conv; +} + +jboolean CS_LDK_Direction_eq(int64_t a, int64_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 CS_LDK_NodeIdLookUp_free(int64_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 CS_LDK_EmptyNodeIdLookUp_free(int64_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); +} + +int64_t CS_LDK_EmptyNodeIdLookUp_new() { + LDKEmptyNodeIdLookUp ret_var = EmptyNodeIdLookUp_new(); + int64_t ret_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 CS_LDK_EmptyNodeIdLookUp_as_NodeIdLookUp(int64_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 CS_LDK_BlindedHop_free(int64_t this_obj) { LDKBlindedHop this_obj_conv; this_obj_conv.inner = untag_ptr(this_obj); @@ -71182,8 +77497,12 @@ int64_t CS_LDK_BlindedPath_one_hop_for_message(int8_tArray recipient_node_id, i 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); @@ -71206,14 +77525,18 @@ int64_t CS_LDK_BlindedPath_new_for_message(ptrArray node_pks, int64_t entropy_s } 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); } -int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64_t payee_tlvs, int64_t entropy_source) { +int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64_t payee_tlvs, int16_t min_final_cltv_expiry_delta, int64_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); @@ -71223,14 +77546,18 @@ int64_t CS_LDK_BlindedPath_one_hop_for_payment(int8_tArray payee_node_id, int64 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); } -int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int64_t entropy_source) { +int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int8_tArray payee_node_id, int64_t payee_tlvs, int64_t htlc_maximum_msat, int16_t min_final_cltv_expiry_delta, int64_t entropy_source) { LDKCVec_ForwardNodeZ intermediate_nodes_constr; intermediate_nodes_constr.datalen = intermediate_nodes->arr_len; if (intermediate_nodes_constr.datalen > 0) @@ -71257,13 +77584,35 @@ int64_t CS_LDK_BlindedPath_new_for_payment(int64_tArray intermediate_nodes, int 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); } +int64_t CS_LDK_BlindedPath_public_introduction_node_id(int64_t this_arg, int64_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); + int64_t ret_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 CS_LDK_BlindedPath_write(int64_t obj) { LDKBlindedPath obj_conv; obj_conv.inner = untag_ptr(obj); @@ -71652,7 +78001,32 @@ void CS_LDK_ReceiveTlvs_set_payment_constraints(int64_t this_ptr, int64_t val) ReceiveTlvs_set_payment_constraints(&this_ptr_conv, val_conv); } -int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_constraints_arg) { +int64_t CS_LDK_ReceiveTlvs_get_payment_context(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +void CS_LDK_ReceiveTlvs_set_payment_context(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_constraints_arg, int64_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); @@ -71661,7 +78035,11 @@ int64_t CS_LDK_ReceiveTlvs_new(int8_tArray payment_secret_arg, int64_t payment_ 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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -71885,6 +78263,317 @@ int64_t CS_LDK_PaymentConstraints_clone(int64_t orig) { return ret_ref; } +void CS_LDK_PaymentContext_free(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} +int64_t CS_LDK_PaymentContext_clone_ptr(int64_t arg) { + LDKPaymentContext* arg_conv = (LDKPaymentContext*)untag_ptr(arg); + int64_t ret_conv = PaymentContext_clone_ptr(arg_conv); + return ret_conv; +} + +int64_t CS_LDK_PaymentContext_clone(int64_t orig) { + LDKPaymentContext* orig_conv = (LDKPaymentContext*)untag_ptr(orig); + LDKPaymentContext *ret_copy = MALLOC(sizeof(LDKPaymentContext), "LDKPaymentContext"); + *ret_copy = PaymentContext_clone(orig_conv); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_unknown(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_bolt12_offer(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentContext_bolt12_refund(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +jboolean CS_LDK_PaymentContext_eq(int64_t a, int64_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 CS_LDK_UnknownPaymentContext_free(int64_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); + int64_t ret_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 CS_LDK_UnknownPaymentContext_clone_ptr(int64_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; +} + +int64_t CS_LDK_UnknownPaymentContext_clone(int64_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); + int64_t ret_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 CS_LDK_UnknownPaymentContext_eq(int64_t a, int64_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 CS_LDK_Bolt12OfferContext_free(int64_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); +} + +int64_t CS_LDK_Bolt12OfferContext_get_offer_id(int64_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_set_offer_id(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_Bolt12OfferContext_get_invoice_request(int64_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_set_invoice_request(int64_t this_ptr, int64_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); +} + +int64_t CS_LDK_Bolt12OfferContext_new(int64_t offer_id_arg, int64_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); + int64_t ret_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_clone_ptr(int64_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; +} + +int64_t CS_LDK_Bolt12OfferContext_clone(int64_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); + int64_t ret_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 CS_LDK_Bolt12OfferContext_eq(int64_t a, int64_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 CS_LDK_Bolt12RefundContext_free(int64_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); +} + +int64_t CS_LDK_Bolt12RefundContext_new() { + LDKBolt12RefundContext ret_var = Bolt12RefundContext_new(); + int64_t ret_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); + int64_t ret_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 CS_LDK_Bolt12RefundContext_clone_ptr(int64_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; +} + +int64_t CS_LDK_Bolt12RefundContext_clone(int64_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); + int64_t ret_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 CS_LDK_Bolt12RefundContext_eq(int64_t a, int64_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 CS_LDK_ForwardTlvs_write(int64_t obj) { LDKForwardTlvs obj_conv; obj_conv.inner = untag_ptr(obj); @@ -71957,6 +78646,94 @@ int64_t CS_LDK_PaymentConstraints_read(int8_tArray ser) { return tag_ptr(ret_conv, true); } +int8_tArray CS_LDK_PaymentContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_UnknownPaymentContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_Bolt12OfferContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_Bolt12RefundContext_write(int64_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; +} + +int64_t CS_LDK_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 CS_LDK_PaymentPurpose_free(int64_t this_ptr) { if (!ptr_is_owned(this_ptr)) return; void* this_ptr_ptr = untag_ptr(this_ptr); @@ -71986,7 +78763,21 @@ int64_t CS_LDK_PaymentPurpose_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_PaymentPurpose_invoice_payment(int64_t payment_preimage, int8_tArray payment_secret) { +int64_t CS_LDK_PaymentPurpose_bolt11_invoice_payment(int64_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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentPurpose_bolt12_offer_payment(int64_t payment_preimage, int8_tArray payment_secret, int64_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); @@ -71994,8 +78785,32 @@ int64_t CS_LDK_PaymentPurpose_invoice_payment(int64_t payment_preimage, int8_tA 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); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_PaymentPurpose_bolt12_refund_payment(int64_t payment_preimage, int8_tArray payment_secret, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72052,27 +78867,31 @@ void CS_LDK_ClaimedHTLC_free(int64_t this_obj) { ClaimedHTLC_free(this_obj_conv); } -int8_tArray CS_LDK_ClaimedHTLC_get_channel_id(int64_t this_ptr) { +int64_t CS_LDK_ClaimedHTLC_get_channel_id(int64_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); + int64_t ret_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 CS_LDK_ClaimedHTLC_set_channel_id(int64_t this_ptr, int8_tArray val) { +void CS_LDK_ClaimedHTLC_set_channel_id(int64_t this_ptr, int64_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 CS_LDK_ClaimedHTLC_get_user_channel_id(int64_t this_ptr) { @@ -72155,14 +78974,16 @@ void CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat(int64_t this_ptr, int ClaimedHTLC_set_counterparty_skimmed_fee_msat(&this_ptr_conv, val); } -int64_t CS_LDK_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); +int64_t CS_LDK_ClaimedHTLC_new(int64_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); int64_t ret_ref = 0; CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var); ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned); @@ -72362,9 +79183,23 @@ int64_t CS_LDK_ClosureReason_holder_force_closed() { return ret_ref; } -int64_t CS_LDK_ClosureReason_cooperative_closure() { +int64_t CS_LDK_ClosureReason_legacy_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_legacy_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure() { LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); - *ret_copy = ClosureReason_cooperative_closure(); + *ret_copy = ClosureReason_counterparty_initiated_cooperative_closure(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + +int64_t CS_LDK_ClosureReason_locally_initiated_cooperative_closure() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_locally_initiated_cooperative_closure(); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72419,6 +79254,13 @@ int64_t CS_LDK_ClosureReason_funding_batch_closure() { return ret_ref; } +int64_t CS_LDK_ClosureReason_htlcs_timed_out() { + LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason"); + *ret_copy = ClosureReason_htlcs_timed_out(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + jboolean CS_LDK_ClosureReason_eq(int64_t a, int64_t b) { LDKClosureReason* a_conv = (LDKClosureReason*)untag_ptr(a); LDKClosureReason* b_conv = (LDKClosureReason*)untag_ptr(b); @@ -72474,15 +79316,17 @@ int64_t CS_LDK_HTLCDestination_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) { +int64_t CS_LDK_HTLCDestination_next_hop_channel(int8_tArray node_id, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72501,6 +79345,13 @@ int64_t CS_LDK_HTLCDestination_invalid_forward(int64_t requested_forward_scid) return ret_ref; } +int64_t CS_LDK_HTLCDestination_invalid_onion() { + LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination"); + *ret_copy = HTLCDestination_invalid_onion(); + int64_t ret_ref = tag_ptr(ret_copy, true); + return ret_ref; +} + int64_t CS_LDK_HTLCDestination_failed_payment(int8_tArray payment_hash) { LDKThirtyTwoBytes payment_hash_ref; CHECK(payment_hash->arr_len == 32); @@ -72628,10 +79479,12 @@ int64_t CS_LDK_Event_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_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); +int64_t CS_LDK_Event_funding_generation_ready(int64_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); @@ -72643,7 +79496,7 @@ int64_t CS_LDK_Event_funding_generation_ready(int8_tArray temporary_channel_id, 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -72664,10 +79517,11 @@ int64_t CS_LDK_Event_payment_claimable(int8_tArray receiver_node_id, int8_tArra 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); @@ -72916,50 +79770,68 @@ int64_t CS_LDK_Event_spendable_outputs(int64_tArray outputs, int64_t channel_id 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_payment_forwarded(int64_t prev_channel_id, int64_t next_channel_id, int64_t fee_earned_msat, jboolean claim_from_onchain_tx, int64_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)); +int64_t CS_LDK_Event_payment_forwarded(int64_t prev_channel_id, int64_t next_channel_id, int64_t prev_user_channel_id, int64_t next_user_channel_id, int64_t total_fee_earned_msat, int64_t skimmed_fee_msat, jboolean claim_from_onchain_tx, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_pending(int8_tArray channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_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); +int64_t CS_LDK_Event_channel_pending(int64_t channel_id, int8_tArray user_channel_id, int64_t former_temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_txo, int64_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); @@ -72968,16 +79840,23 @@ int64_t CS_LDK_Event_channel_pending(int8_tArray channel_id, int8_tArray user_c 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_ready(int8_tArray channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_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); +int64_t CS_LDK_Event_channel_ready(int64_t channel_id, int8_tArray user_channel_id, int8_tArray counterparty_node_id, int64_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); @@ -72990,15 +79869,17 @@ int64_t CS_LDK_Event_channel_ready(int8_tArray channel_id, int8_tArray user_cha 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_channel_closed(int8_tArray channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_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); +int64_t CS_LDK_Event_channel_closed(int64_t channel_id, int8_tArray user_channel_id, int64_t reason, int8_tArray counterparty_node_id, int64_t channel_capacity_sats, int64_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); @@ -73019,30 +79900,34 @@ int64_t CS_LDK_Event_channel_closed(int8_tArray channel_id, int8_tArray user_ch 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_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); +int64_t CS_LDK_Event_discard_funding(int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_open_channel_request(int8_tArray temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_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); +int64_t CS_LDK_Event_open_channel_request(int64_t temporary_channel_id, int8_tArray counterparty_node_id, int64_t funding_satoshis, int64_t push_msat, int64_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); @@ -73052,21 +79937,23 @@ int64_t CS_LDK_Event_open_channel_request(int8_tArray temporary_channel_id, int 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_Event_htlchandling_failed(int8_tArray prev_channel_id, int64_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); +int64_t CS_LDK_Event_htlchandling_failed(int64_t prev_channel_id, int64_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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -73923,7 +80810,15 @@ int64_t CS_LDK_BumpTransactionEvent_clone(int64_t orig) { return ret_ref; } -int64_t CS_LDK_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, int64_t anchor_descriptor, int64_tArray pending_htlcs) { +int64_t CS_LDK_BumpTransactionEvent_channel_close(int64_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, int64_t anchor_descriptor, int64_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); @@ -73955,12 +80850,20 @@ int64_t CS_LDK_BumpTransactionEvent_channel_close(int8_tArray claim_id, int32_t } 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } -int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_tArray htlc_descriptors, int32_t tx_lock_time) { +int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int64_t channel_id, int8_tArray counterparty_node_id, int8_tArray claim_id, int32_t target_feerate_sat_per_1000_weight, int64_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); @@ -73982,7 +80885,7 @@ int64_t CS_LDK_BumpTransactionEvent_htlcresolution(int8_tArray claim_id, int32_ } 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); int64_t ret_ref = tag_ptr(ret_copy, true); return ret_ref; } @@ -76428,6 +83331,17 @@ int8_tArray CS_LDK_Bolt11Invoice_recover_payee_pub_key(int64_t this_arg) { return ret_arr; } +int8_tArray CS_LDK_Bolt11Invoice_get_payee_pub_key(int64_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; +} + int64_t CS_LDK_Bolt11Invoice_expires_at(int64_t this_arg) { LDKBolt11Invoice this_arg_conv; this_arg_conv.inner = untag_ptr(this_arg); diff --git a/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs b/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs index df1e8103..5d26fe2f 100644 --- a/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs +++ b/c_sharp/src/org/ldk/enums/Bolt12SemanticError.cs @@ -94,6 +94,10 @@ public enum Bolt12SemanticError { * Blinded paths were expected but were missing. */ LDKBolt12SemanticError_MissingPaths, + /** + * Blinded paths were provided but were not expected. + */ + LDKBolt12SemanticError_UnexpectedPaths, /** * The blinded payinfo given does not match the number of blinded path hops. */ diff --git a/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs b/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs index c5b9fcde..d2a4d73a 100644 --- a/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs +++ b/c_sharp/src/org/ldk/enums/ConfirmationTarget.cs @@ -90,4 +90,17 @@ public enum ConfirmationTarget { * [`ChannelManager::close_channel_with_feerate_and_script`]: crate::ln::channelmanager::ChannelManager::close_channel_with_feerate_and_script */ LDKConfirmationTarget_ChannelCloseMinimum, + /** + * The feerate [`OutputSweeper`] will use on transactions spending + * [`SpendableOutputDescriptor`]s after a channel closure. + * + * Generally spending these outputs is safe as long as they eventually confirm, so a value + * (slightly above) the mempool minimum should suffice. However, as this value will influence + * how long funds will be unavailable after channel closure, [`FeeEstimator`] implementors + * might want to choose a higher feerate to regain control over funds faster. + * + * [`OutputSweeper`]: crate::util::sweep::OutputSweeper + * [`SpendableOutputDescriptor`]: crate::sign::SpendableOutputDescriptor + */ + LDKConfirmationTarget_OutputSpendingFee, }} } } diff --git a/c_sharp/src/org/ldk/enums/Direction.cs b/c_sharp/src/org/ldk/enums/Direction.cs new file mode 100644 index 00000000..2bf28ee5 --- /dev/null +++ b/c_sharp/src/org/ldk/enums/Direction.cs @@ -0,0 +1,17 @@ +namespace org { namespace ldk { namespace enums {/** + * The side of a channel that is the [`IntroductionNode`] in a [`BlindedPath`]. [BOLT 7] defines + * which nodes is which in the [`ChannelAnnouncement`] message. + * + * [BOLT 7]: https://github.com/lightning/bolts/blob/master/07-routing-gossip.md#the-channel_announcement-message + * [`ChannelAnnouncement`]: crate::ln::msgs::ChannelAnnouncement + */ +public enum Direction { + /** + * The lesser node id when compared lexicographically in ascending order. + */ + LDKDirection_NodeOne, + /** + * The greater node id when compared lexicographically in ascending order. + */ + LDKDirection_NodeTwo, +}} } } diff --git a/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs b/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs index d0e5774f..2b1f21d5 100644 --- a/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs +++ b/c_sharp/src/org/ldk/enums/PaymentFailureReason.cs @@ -30,6 +30,10 @@ public enum PaymentFailureReason { LDKPaymentFailureReason_PaymentExpired, /** * We failed to find a route while retrying the payment. + * + * Note that this generally indicates that we've exhausted the available set of possible + * routes - we tried the payment over a few routes but were not able to find any further + * candidate routes beyond those. */ LDKPaymentFailureReason_RouteNotFound, /** diff --git a/c_sharp/src/org/ldk/enums/ShortChannelIdError.cs b/c_sharp/src/org/ldk/enums/ShortChannelIdError.cs new file mode 100644 index 00000000..7413ae4b --- /dev/null +++ b/c_sharp/src/org/ldk/enums/ShortChannelIdError.cs @@ -0,0 +1,17 @@ +namespace org { namespace ldk { namespace enums {/** + * A `short_channel_id` construction error + */ +public enum ShortChannelIdError { + /** + * Block height too high + */ + LDKShortChannelIdError_BlockOverflow, + /** + * Tx index too high + */ + LDKShortChannelIdError_TxIndexOverflow, + /** + * Vout index too high + */ + LDKShortChannelIdError_VoutIndexOverflow, +}} } } diff --git a/c_sharp/src/org/ldk/impl/bindings.cs b/c_sharp/src/org/ldk/impl/bindings.cs index e3c3a6e4..4e16b9cb 100644 --- a/c_sharp/src/org/ldk/impl/bindings.cs +++ b/c_sharp/src/org/ldk/impl/bindings.cs @@ -25,6 +25,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBech32Error_ty_from_ptr")] public static extern long LDKBech32Error_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBech32Error_InvalidChar_get_invalid_char")] public static extern int LDKBech32Error_InvalidChar_get_invalid_char(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBech32Error_InvalidData_get_invalid_data")] public static extern byte LDKBech32Error_InvalidData_get_invalid_data(long ptr); + // struct LDKRefundMaybeWithDerivedMetadataBuilder CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok")] public static extern long CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKRefund CResult_RefundBolt12SemanticErrorZ_get_ok(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_ok")] public static extern long CResult_RefundBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_RefundBolt12SemanticErrorZ_get_err(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_RefundBolt12SemanticErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u64Z_ty_from_ptr")] public static extern long LDKCOption_u64Z_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_u64Z_Some_get_some")] public static extern long LDKCOption_u64Z_Some_get_some(long ptr); // struct LDKRefund CResult_RefundBolt12ParseErrorZ_get_ok(LDKCResult_RefundBolt12ParseErrorZ *NONNULL_PTR owner); @@ -67,8 +75,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsNoneZ_get_ok")] public static extern long CResult_RecipientOnionFieldsNoneZ_get_ok(long _owner); // void CResult_RecipientOnionFieldsNoneZ_get_err(LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsNoneZ_get_err")] public static extern void CResult_RecipientOnionFieldsNoneZ_get_err(long _owner); + // struct LDKUnsignedBolt12Invoice CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok")] public static extern long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKBolt12Invoice CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok")] public static extern long CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok")] public static extern long CResult_SchnorrSignatureNoneZ_get_ok(long _owner); + // void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_get_err")] public static extern void CResult_SchnorrSignatureNoneZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_ThirtyTwoBytesZZ_ty_from_ptr")] public static extern long LDKCOption_CVec_ThirtyTwoBytesZZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_ThirtyTwoBytesZZ_Some_get_some")] public static extern long LDKCOption_CVec_ThirtyTwoBytesZZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAmount_ty_from_ptr")] public static extern long LDKAmount_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAmount_Bitcoin_get_amount_msats")] public static extern long LDKAmount_Bitcoin_get_amount_msats(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAmount_Currency_get_iso4217_code")] public static extern long LDKAmount_Currency_get_iso4217_code(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKAmount_Currency_get_amount")] public static extern long LDKAmount_Currency_get_amount(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_AmountZ_ty_from_ptr")] public static extern long LDKCOption_AmountZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_AmountZ_Some_get_some")] public static extern long LDKCOption_AmountZ_Some_get_some(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKQuantity_ty_from_ptr")] public static extern long LDKQuantity_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKQuantity_Bounded_get_bounded")] public static extern long LDKQuantity_Bounded_get_bounded(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_QuantityZ_ty_from_ptr")] public static extern long LDKCOption_QuantityZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_QuantityZ_Some_get_some")] public static extern long LDKCOption_QuantityZ_Some_get_some(long ptr); // struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesNoneZ_get_ok(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesNoneZ_get_ok")] public static extern long CResult_ThirtyTwoBytesNoneZ_get_ok(long _owner); // void CResult_ThirtyTwoBytesNoneZ_get_err(LDKCResult_ThirtyTwoBytesNoneZ *NONNULL_PTR owner); @@ -127,14 +157,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_get_ok")] public static extern long CResult_RecoverableSignatureNoneZ_get_ok(long _owner); // void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_get_err")] public static extern void CResult_RecoverableSignatureNoneZ_get_err(long _owner); - // struct LDKSchnorrSignature CResult_SchnorrSignatureNoneZ_get_ok(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_get_ok")] public static extern long CResult_SchnorrSignatureNoneZ_get_ok(long _owner); - // void CResult_SchnorrSignatureNoneZ_get_err(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_get_err")] public static extern void CResult_SchnorrSignatureNoneZ_get_err(long _owner); // struct LDKECDSASignature CResult_ECDSASignatureNoneZ_get_ok(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ECDSASignatureNoneZ_get_ok")] public static extern long CResult_ECDSASignatureNoneZ_get_ok(long _owner); // void CResult_ECDSASignatureNoneZ_get_err(LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ECDSASignatureNoneZ_get_err")] public static extern void CResult_ECDSASignatureNoneZ_get_err(long _owner); + // struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_ok")] public static extern long CResult_TransactionNoneZ_get_ok(long _owner); + // void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_err")] public static extern void CResult_TransactionNoneZ_get_err(long _owner); // struct LDKECDSASignature C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a")] public static extern long C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_a(long _owner); // struct LDKCVec_ECDSASignatureZ C2Tuple_ECDSASignatureCVec_ECDSASignatureZZ_get_b(LDKC2Tuple_ECDSASignatureCVec_ECDSASignatureZZ *NONNULL_PTR owner); @@ -274,10 +304,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_ok")] public static extern long CResult_InMemorySignerDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_get_err")] public static extern long CResult_InMemorySignerDecodeErrorZ_get_err(long _owner); - // struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_ok")] public static extern long CResult_TransactionNoneZ_get_ok(long _owner); - // void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_get_err")] public static extern void CResult_TransactionNoneZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCandidateRouteHop_ty_from_ptr")] public static extern long LDKCandidateRouteHop_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCandidateRouteHop_FirstHop_get_first_hop")] public static extern long LDKCandidateRouteHop_FirstHop_get_first_hop(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCandidateRouteHop_PublicHop_get_public_hop")] public static extern long LDKCandidateRouteHop_PublicHop_get_public_hop(long ptr); @@ -491,6 +517,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_ok")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_get_err")] public static extern long CResult_ProbabilisticScorerDecodeErrorZ_get_err(long _owner); + // struct LDKBestBlock CResult_BestBlockDecodeErrorZ_get_ok(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_get_ok")] public static extern long CResult_BestBlockDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_BestBlockDecodeErrorZ_get_err(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_get_err")] public static extern long CResult_BestBlockDecodeErrorZ_get_err(long _owner); // uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_get_a")] public static extern long C2Tuple_usizeTransactionZ_get_a(long _owner); // struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner); @@ -505,17 +535,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_get_ok")] public static extern ChannelMonitorUpdateStatus CResult_ChannelMonitorUpdateStatusNoneZ_get_ok(long _owner); // void CResult_ChannelMonitorUpdateStatusNoneZ_get_err(LDKCResult_ChannelMonitorUpdateStatusNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_get_err")] public static extern void CResult_ChannelMonitorUpdateStatusNoneZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ty_from_ptr")] public static extern long LDKClosureReason_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg")] public static extern long LDKClosureReason_CounterpartyForceClosed_get_peer_msg(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ProcessingError_get_err")] public static extern long LDKClosureReason_ProcessingError_get_err(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_ty_from_ptr")] public static extern long LDKMonitorEvent_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HTLCEvent_get_htlc_event")] public static extern long LDKMonitorEvent_HTLCEvent_get_htlc_event(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_reason")] public static extern long LDKMonitorEvent_HolderForceClosedWithInfo_get_reason(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint")] public static extern long LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id")] public static extern long LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_HolderForceClosed_get_holder_force_closed")] public static extern long LDKMonitorEvent_HolderForceClosed_get_holder_force_closed(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_funding_txo")] public static extern long LDKMonitorEvent_Completed_get_funding_txo(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_channel_id")] public static extern long LDKMonitorEvent_Completed_get_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKMonitorEvent_Completed_get_monitor_update_id")] public static extern long LDKMonitorEvent_Completed_get_monitor_update_id(long ptr); - // struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(long _owner); - // struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(long _owner); - // struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(long _owner); + // struct LDKOutPoint C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(long _owner); + // struct LDKChannelId C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(long _owner); + // struct LDKCVec_MonitorEventZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(long _owner); + // struct LDKPublicKey C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(long _owner); // struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_InitFeaturesDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner); @@ -544,18 +583,38 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(long _owner); + // struct LDKOfferId CResult_OfferIdDecodeErrorZ_get_ok(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_get_ok")] public static extern long CResult_OfferIdDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OfferIdDecodeErrorZ_get_err(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_get_err")] public static extern long CResult_OfferIdDecodeErrorZ_get_err(long _owner); + // void CResult_NoneBolt12SemanticErrorZ_get_ok(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok")] public static extern void CResult_NoneBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKOffer CResult_OfferBolt12SemanticErrorZ_get_ok(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_ok")] public static extern long CResult_OfferBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_OfferBolt12SemanticErrorZ_get_err(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_OfferBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKInvoiceRequestWithDerivedPayerIdBuilder CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok")] public static extern long CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKInvoiceRequestWithExplicitPayerIdBuilder CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok")] public static extern long CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(long _owner); // struct LDKOffer CResult_OfferBolt12ParseErrorZ_get_ok(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_get_ok")] public static extern long CResult_OfferBolt12ParseErrorZ_get_ok(long _owner); // struct LDKBolt12ParseError CResult_OfferBolt12ParseErrorZ_get_err(LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_get_err")] public static extern long CResult_OfferBolt12ParseErrorZ_get_err(long _owner); - // struct LDKPublicKey CResult_PublicKeySecp256k1ErrorZ_get_ok(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok")] public static extern long CResult_PublicKeySecp256k1ErrorZ_get_ok(long _owner); - // enum LDKSecp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err")] public static extern Secp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(long _owner); // struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_get_ok")] public static extern long CResult_NodeIdDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_get_err")] public static extern long CResult_NodeIdDecodeErrorZ_get_err(long _owner); + // struct LDKPublicKey CResult_PublicKeySecp256k1ErrorZ_get_ok(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_ok")] public static extern long CResult_PublicKeySecp256k1ErrorZ_get_ok(long _owner); + // enum LDKSecp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_get_err")] public static extern Secp256k1Error CResult_PublicKeySecp256k1ErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ty_from_ptr")] public static extern long LDKNetworkUpdate_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ChannelUpdateMessage_get_msg")] public static extern long LDKNetworkUpdate_ChannelUpdateMessage_get_msg(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNetworkUpdate_ChannelFailure_get_short_channel_id")] public static extern long LDKNetworkUpdate_ChannelFailure_get_short_channel_id(long ptr); @@ -736,6 +795,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NetworkGraphDecodeErrorZ_get_err")] public static extern long CResult_NetworkGraphDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_SocketAddressZZ_ty_from_ptr")] public static extern long LDKCOption_CVec_SocketAddressZZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_CVec_SocketAddressZZ_Some_get_some")] public static extern long LDKCOption_CVec_SocketAddressZZ_Some_get_some(long ptr); + // uint64_t CResult_u64ShortChannelIdErrorZ_get_ok(LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u64ShortChannelIdErrorZ_get_ok")] public static extern long CResult_u64ShortChannelIdErrorZ_get_ok(long _owner); + // enum LDKShortChannelIdError CResult_u64ShortChannelIdErrorZ_get_err(LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u64ShortChannelIdErrorZ_get_err")] public static extern ShortChannelIdError CResult_u64ShortChannelIdErrorZ_get_err(long _owner); // struct LDKPendingHTLCInfo CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok")] public static extern long CResult_PendingHTLCInfoInboundHTLCErrZ_get_ok(long _owner); // struct LDKInboundHTLCErr CResult_PendingHTLCInfoInboundHTLCErrZ_get_err(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR owner); @@ -750,6 +813,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_get_ok")] public static extern long CResult_CVec_UtxoZNoneZ_get_ok(long _owner); // void CResult_CVec_UtxoZNoneZ_get_err(LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_get_err")] public static extern void CResult_CVec_UtxoZNoneZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentContext_ty_from_ptr")] public static extern long LDKPaymentContext_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentContext_Unknown_get_unknown")] public static extern long LDKPaymentContext_Unknown_get_unknown(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentContext_Bolt12Offer_get_bolt12_offer")] public static extern long LDKPaymentContext_Bolt12Offer_get_bolt12_offer(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentContext_Bolt12Refund_get_bolt12_refund")] public static extern long LDKPaymentContext_Bolt12Refund_get_bolt12_refund(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentContextZ_ty_from_ptr")] public static extern long LDKCOption_PaymentContextZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentContextZ_Some_get_some")] public static extern long LDKCOption_PaymentContextZ_Some_get_some(long ptr); // uint64_t C2Tuple_u64u16Z_get_a(LDKC2Tuple_u64u16Z *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u16Z_get_a")] public static extern long C2Tuple_u64u16Z_get_a(long _owner); // uint16_t C2Tuple_u64u16Z_get_b(LDKC2Tuple_u64u16Z *NONNULL_PTR owner); @@ -758,10 +827,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_C2Tuple_u64u16ZZ_Some_get_some")] public static extern long LDKCOption_C2Tuple_u64u16ZZ_Some_get_some(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_ty_from_ptr")] public static extern long LDKCOption_ChannelShutdownStateZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ChannelShutdownStateZ_Some_get_some")] public static extern ChannelShutdownState LDKCOption_ChannelShutdownStateZ_Some_get_some(long ptr); - // struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesAPIErrorZ_get_ok(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_get_ok(long _owner); - // struct LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_get_err(long _owner); + // struct LDKChannelId CResult_ChannelIdAPIErrorZ_get_ok(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_get_ok")] public static extern long CResult_ChannelIdAPIErrorZ_get_ok(long _owner); + // struct LDKAPIError CResult_ChannelIdAPIErrorZ_get_err(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_get_err")] public static extern long CResult_ChannelIdAPIErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_ty_from_ptr")] public static extern long LDKRecentPaymentDetails_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_AwaitingInvoice_get_payment_id")] public static extern long LDKRecentPaymentDetails_AwaitingInvoice_get_payment_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKRecentPaymentDetails_Pending_get_payment_id")] public static extern long LDKRecentPaymentDetails_Pending_get_payment_id(long ptr); @@ -808,20 +877,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_ok")] public static extern long CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_ok(long _owner); // struct LDKProbeSendFailure CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_err(LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_err")] public static extern long CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_get_err(long _owner); - // struct LDKThirtyTwoBytes C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a")] public static extern long C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(long _owner); - // struct LDKPublicKey C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b")] public static extern long C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(long _owner); + // struct LDKChannelId C2Tuple_ChannelIdPublicKeyZ_get_a(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_a")] public static extern long C2Tuple_ChannelIdPublicKeyZ_get_a(long _owner); + // struct LDKPublicKey C2Tuple_ChannelIdPublicKeyZ_get_b(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ChannelIdPublicKeyZ_get_b")] public static extern long C2Tuple_ChannelIdPublicKeyZ_get_b(long _owner); + // struct LDKOfferWithDerivedMetadataBuilder CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok")] public static extern long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_StrZ_ty_from_ptr")] public static extern long LDKCOption_StrZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_StrZ_Some_get_some")] public static extern long LDKCOption_StrZ_Some_get_some(long ptr); - // void CResult_NoneBolt12SemanticErrorZ_get_ok(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_ok")] public static extern void CResult_NoneBolt12SemanticErrorZ_get_ok(long _owner); - // enum LDKBolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_NoneBolt12SemanticErrorZ_get_err(long _owner); // struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok")] public static extern long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_ok(long _owner); // void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err")] public static extern void CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_get_err(long _owner); + // struct LDKThirtyTwoBytes CResult_ThirtyTwoBytesAPIErrorZ_get_ok(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_ok")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_get_ok(long _owner); + // struct LDKAPIError CResult_ThirtyTwoBytesAPIErrorZ_get_err(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_get_err")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_ty_from_ptr")] public static extern long LDKOffersMessage_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_InvoiceRequest_get_invoice_request")] public static extern long LDKOffersMessage_InvoiceRequest_get_invoice_request(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOffersMessage_Invoice_get_invoice")] public static extern long LDKOffersMessage_Invoice_get_invoice(long ptr); @@ -863,6 +936,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Forward_get_blinded")] public static extern long LDKPendingHTLCRouting_Forward_get_blinded(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_data")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_data(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_metadata")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_metadata(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_payment_context")] public static extern long LDKPendingHTLCRouting_Receive_get_payment_context(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry")] public static extern int LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_phantom_shared_secret")] public static extern long LDKPendingHTLCRouting_Receive_get_phantom_shared_secret(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_Receive_get_custom_tlvs")] public static extern long LDKPendingHTLCRouting_Receive_get_custom_tlvs(long ptr); @@ -872,6 +946,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_payment_metadata")] public static extern long LDKPendingHTLCRouting_ReceiveKeysend_get_payment_metadata(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_incoming_cltv_expiry")] public static extern int LDKPendingHTLCRouting_ReceiveKeysend_get_incoming_cltv_expiry(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_custom_tlvs")] public static extern long LDKPendingHTLCRouting_ReceiveKeysend_get_custom_tlvs(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error")] public static extern bool LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error(long ptr); // struct LDKPendingHTLCRouting CResult_PendingHTLCRoutingDecodeErrorZ_get_ok(LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCRoutingDecodeErrorZ_get_ok")] public static extern long CResult_PendingHTLCRoutingDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_PendingHTLCRoutingDecodeErrorZ_get_err(LDKCResult_PendingHTLCRoutingDecodeErrorZ *NONNULL_PTR owner); @@ -914,7 +989,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Watch_watch_channel")] public static extern long Watch_watch_channel(long _this_arg, long _funding_txo, long _monitor); // LDKChannelMonitorUpdateStatus Watch_update_channel LDKWatch *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo, const struct LDKChannelMonitorUpdate *NONNULL_PTR update [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Watch_update_channel")] public static extern ChannelMonitorUpdateStatus Watch_update_channel(long _this_arg, long _funding_txo, long _update); - // LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg + // LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ Watch_release_pending_monitor_events LDKWatch *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Watch_release_pending_monitor_events")] public static extern long Watch_release_pending_monitor_events(long _this_arg); public interface LDKBroadcasterInterface { void broadcast_transactions(long txs); @@ -1281,10 +1356,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_TypeZDecodeErrorZ_get_err")] public static extern long CResult_COption_TypeZDecodeErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_SocketAddressZ_ty_from_ptr")] public static extern long LDKCOption_SocketAddressZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_SocketAddressZ_Some_get_some")] public static extern long LDKCOption_SocketAddressZ_Some_get_some(long ptr); - // struct LDKPublicKey C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a")] public static extern long C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(long _owner); - // struct LDKCOption_SocketAddressZ C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b")] public static extern long C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(long _owner); // struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_get_ok")] public static extern long CResult_CVec_u8ZPeerHandleErrorZ_get_ok(long _owner); // struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner); @@ -1320,12 +1391,34 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_ok")] public static extern long CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_ok(long _owner); // enum LDKIOError CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err")] public static extern IOError CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_get_err(long _owner); + // struct LDKUnsignedInvoiceRequest CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok")] public static extern long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKInvoiceRequest CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok")] public static extern long CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_SecretKeyZ_ty_from_ptr")] public static extern long LDKCOption_SecretKeyZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_SecretKeyZ_Some_get_some")] public static extern long LDKCOption_SecretKeyZ_Some_get_some(long ptr); + // struct LDKInvoiceWithExplicitSigningPubkeyBuilder CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok")] public static extern long CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(long _owner); // struct LDKVerifiedInvoiceRequest CResult_VerifiedInvoiceRequestNoneZ_get_ok(LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_get_ok")] public static extern long CResult_VerifiedInvoiceRequestNoneZ_get_ok(long _owner); // void CResult_VerifiedInvoiceRequestNoneZ_get_err(LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_get_err")] public static extern void CResult_VerifiedInvoiceRequestNoneZ_get_err(long _owner); + // struct LDKInvoiceWithDerivedSigningPubkeyBuilder CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok")] public static extern long CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(long _owner); + // enum LDKBolt12SemanticError CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err")] public static extern Bolt12SemanticError CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(long _owner); + // struct LDKInvoiceRequestFields CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok")] public static extern long CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_get_err")] public static extern long CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ECDSASignatureZ_ty_from_ptr")] public static extern long LDKCOption_ECDSASignatureZ_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ECDSASignatureZ_Some_get_some")] public static extern long LDKCOption_ECDSASignatureZ_Some_get_some(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_i64Z_ty_from_ptr")] public static extern long LDKCOption_i64Z_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_i64Z_Some_get_some")] public static extern long LDKCOption_i64Z_Some_get_some(long ptr); // struct LDKSocketAddress CResult_SocketAddressDecodeErrorZ_get_ok(LDKCResult_SocketAddressDecodeErrorZ *NONNULL_PTR owner); @@ -1611,8 +1704,14 @@ internal class bindings { // struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(long _owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_ty_from_ptr")] public static extern long LDKPaymentPurpose_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_preimage")] public static extern long LDKPaymentPurpose_InvoicePayment_get_payment_preimage(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_InvoicePayment_get_payment_secret")] public static extern long LDKPaymentPurpose_InvoicePayment_get_payment_secret(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage")] public static extern long LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret")] public static extern long LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage")] public static extern long LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret")] public static extern long LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context")] public static extern long LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage")] public static extern long LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret")] public static extern long LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context")] public static extern long LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment")] public static extern long LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(long ptr); // struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_get_ok")] public static extern long CResult_PaymentPurposeDecodeErrorZ_get_ok(long _owner); @@ -1631,9 +1730,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_ok")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_COption_PathFailureZDecodeErrorZ_get_err(LDKCResult_COption_PathFailureZDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_COption_PathFailureZDecodeErrorZ_get_err")] public static extern long CResult_COption_PathFailureZDecodeErrorZ_get_err(long _owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ty_from_ptr")] public static extern long LDKClosureReason_ty_from_ptr(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_CounterpartyForceClosed_get_peer_msg")] public static extern long LDKClosureReason_CounterpartyForceClosed_get_peer_msg(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKClosureReason_ProcessingError_get_err")] public static extern long LDKClosureReason_ProcessingError_get_err(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ClosureReasonZ_ty_from_ptr")] public static extern long LDKCOption_ClosureReasonZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_ClosureReasonZ_Some_get_some")] public static extern long LDKCOption_ClosureReasonZ_Some_get_some(long ptr); // struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner); @@ -1661,12 +1757,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentFailureReasonZ_ty_from_ptr")] public static extern long LDKCOption_PaymentFailureReasonZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_PaymentFailureReasonZ_Some_get_some")] public static extern PaymentFailureReason LDKCOption_PaymentFailureReasonZ_Some_get_some(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ty_from_ptr")] public static extern long LDKBumpTransactionEvent_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_channel_id")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_claim_id")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_claim_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_package_target_feerate_sat_per_1000_weight")] public static extern int LDKBumpTransactionEvent_ChannelClose_get_package_target_feerate_sat_per_1000_weight(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_commitment_tx")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_commitment_tx(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_commitment_tx_fee_satoshis")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_commitment_tx_fee_satoshis(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_anchor_descriptor")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_anchor_descriptor(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs")] public static extern long LDKBumpTransactionEvent_ChannelClose_get_pending_htlcs(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_channel_id")] public static extern long LDKBumpTransactionEvent_HTLCResolution_get_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id")] public static extern long LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_claim_id")] public static extern long LDKBumpTransactionEvent_HTLCResolution_get_claim_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_target_feerate_sat_per_1000_weight")] public static extern int LDKBumpTransactionEvent_HTLCResolution_get_target_feerate_sat_per_1000_weight(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKBumpTransactionEvent_HTLCResolution_get_htlc_descriptors")] public static extern long LDKBumpTransactionEvent_HTLCResolution_get_htlc_descriptors(long ptr); @@ -1728,7 +1828,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_SpendableOutputs_get_channel_id")] public static extern long LDKEvent_SpendableOutputs_get_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_prev_channel_id")] public static extern long LDKEvent_PaymentForwarded_get_prev_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_next_channel_id")] public static extern long LDKEvent_PaymentForwarded_get_next_channel_id(long ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_fee_earned_msat")] public static extern long LDKEvent_PaymentForwarded_get_fee_earned_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_prev_user_channel_id")] public static extern long LDKEvent_PaymentForwarded_get_prev_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_next_user_channel_id")] public static extern long LDKEvent_PaymentForwarded_get_next_user_channel_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_total_fee_earned_msat")] public static extern long LDKEvent_PaymentForwarded_get_total_fee_earned_msat(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_skimmed_fee_msat")] public static extern long LDKEvent_PaymentForwarded_get_skimmed_fee_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx")] public static extern bool LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat")] public static extern long LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_channel_id")] public static extern long LDKEvent_ChannelPending_get_channel_id(long ptr); @@ -1736,6 +1839,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_former_temporary_channel_id")] public static extern long LDKEvent_ChannelPending_get_former_temporary_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_counterparty_node_id")] public static extern long LDKEvent_ChannelPending_get_counterparty_node_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_funding_txo")] public static extern long LDKEvent_ChannelPending_get_funding_txo(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelPending_get_channel_type")] public static extern long LDKEvent_ChannelPending_get_channel_type(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_channel_id")] public static extern long LDKEvent_ChannelReady_get_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_user_channel_id")] public static extern long LDKEvent_ChannelReady_get_user_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEvent_ChannelReady_get_counterparty_node_id")] public static extern long LDKEvent_ChannelReady_get_counterparty_node_id(long ptr); @@ -1837,6 +1941,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_ok")] public static extern long CResult_UntrustedStringDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_UntrustedStringDecodeErrorZ_get_err(LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_get_err")] public static extern long CResult_UntrustedStringDecodeErrorZ_get_err(long _owner); + // struct LDKChannelId CResult_ChannelIdDecodeErrorZ_get_ok(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_get_ok")] public static extern long CResult_ChannelIdDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_ChannelIdDecodeErrorZ_get_err(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_get_err")] public static extern long CResult_ChannelIdDecodeErrorZ_get_err(long _owner); // struct LDKThirtyTwoBytes C2Tuple__u832u16Z_get_a(LDKC2Tuple__u832u16Z *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u832u16Z_get_a")] public static extern long C2Tuple__u832u16Z_get_a(long _owner); // uint16_t C2Tuple__u832u16Z_get_b(LDKC2Tuple__u832u16Z *NONNULL_PTR owner); @@ -1849,6 +1957,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_get_ok")] public static extern long CResult_PaymentConstraintsDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_PaymentConstraintsDecodeErrorZ_get_err(LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_get_err")] public static extern long CResult_PaymentConstraintsDecodeErrorZ_get_err(long _owner); + // struct LDKPaymentContext CResult_PaymentContextDecodeErrorZ_get_ok(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_get_ok")] public static extern long CResult_PaymentContextDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_PaymentContextDecodeErrorZ_get_err(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_get_err")] public static extern long CResult_PaymentContextDecodeErrorZ_get_err(long _owner); + // struct LDKUnknownPaymentContext CResult_UnknownPaymentContextDecodeErrorZ_get_ok(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_ok")] public static extern long CResult_UnknownPaymentContextDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_UnknownPaymentContextDecodeErrorZ_get_err(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_get_err")] public static extern long CResult_UnknownPaymentContextDecodeErrorZ_get_err(long _owner); + // struct LDKBolt12OfferContext CResult_Bolt12OfferContextDecodeErrorZ_get_ok(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_ok")] public static extern long CResult_Bolt12OfferContextDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_Bolt12OfferContextDecodeErrorZ_get_err(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_get_err")] public static extern long CResult_Bolt12OfferContextDecodeErrorZ_get_err(long _owner); + // struct LDKBolt12RefundContext CResult_Bolt12RefundContextDecodeErrorZ_get_ok(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_ok")] public static extern long CResult_Bolt12RefundContextDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_Bolt12RefundContextDecodeErrorZ_get_err(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_get_err")] public static extern long CResult_Bolt12RefundContextDecodeErrorZ_get_err(long _owner); + // struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_get_ok")] public static extern long CResult_StrSecp256k1ErrorZ_get_ok(long _owner); + // enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_get_err")] public static extern Secp256k1Error CResult_StrSecp256k1ErrorZ_get_err(long _owner); // struct LDKThirtyTwoBytes C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_a(long _owner); // struct LDKRecipientOnionFields C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_get_b(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR owner); @@ -1859,10 +1987,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_ok(long _owner); // void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err")] public static extern void CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_get_err(long _owner); - // struct LDKStr CResult_StrSecp256k1ErrorZ_get_ok(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_get_ok")] public static extern long CResult_StrSecp256k1ErrorZ_get_ok(long _owner); - // enum LDKSecp256k1Error CResult_StrSecp256k1ErrorZ_get_err(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_get_err")] public static extern Secp256k1Error CResult_StrSecp256k1ErrorZ_get_err(long _owner); // struct LDKPublicKey C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a")] public static extern long C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_a(long _owner); // struct LDKOnionMessage C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_get_b(LDKC3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ *NONNULL_PTR owner); @@ -1876,6 +2000,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_ok")] public static extern long CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_ok(long _owner); // struct LDKSendError CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_err(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_err")] public static extern long CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNextMessageHop_ty_from_ptr")] public static extern long LDKNextMessageHop_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNextMessageHop_NodeId_get_node_id")] public static extern long LDKNextMessageHop_NodeId_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNextMessageHop_ShortChannelId_get_short_channel_id")] public static extern long LDKNextMessageHop_ShortChannelId_get_short_channel_id(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParsedOnionMessageContents_ty_from_ptr")] public static extern long LDKParsedOnionMessageContents_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParsedOnionMessageContents_Offers_get_offers")] public static extern long LDKParsedOnionMessageContents_Offers_get_offers(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKParsedOnionMessageContents_Custom_get_custom")] public static extern long LDKParsedOnionMessageContents_Custom_get_custom(long ptr); @@ -1915,30 +2042,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_ok")] public static extern long CResult_InvoiceErrorDecodeErrorZ_get_ok(long _owner); // struct LDKDecodeError CResult_InvoiceErrorDecodeErrorZ_get_err(LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR owner); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_get_err")] public static extern long CResult_InvoiceErrorDecodeErrorZ_get_err(long _owner); - // struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err")] public static extern long CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(long _owner); - // struct LDKDelayedPaymentKey CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_DelayedPaymentKeyDecodeErrorZ_get_err(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err")] public static extern long CResult_DelayedPaymentKeyDecodeErrorZ_get_err(long _owner); - // struct LDKHtlcBasepoint CResult_HtlcBasepointDecodeErrorZ_get_ok(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok")] public static extern long CResult_HtlcBasepointDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_HtlcBasepointDecodeErrorZ_get_err(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err")] public static extern long CResult_HtlcBasepointDecodeErrorZ_get_err(long _owner); - // struct LDKHtlcKey CResult_HtlcKeyDecodeErrorZ_get_ok(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok")] public static extern long CResult_HtlcKeyDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_HtlcKeyDecodeErrorZ_get_err(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err")] public static extern long CResult_HtlcKeyDecodeErrorZ_get_err(long _owner); - // struct LDKRevocationBasepoint CResult_RevocationBasepointDecodeErrorZ_get_ok(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok")] public static extern long CResult_RevocationBasepointDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_RevocationBasepointDecodeErrorZ_get_err(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err")] public static extern long CResult_RevocationBasepointDecodeErrorZ_get_err(long _owner); - // struct LDKRevocationKey CResult_RevocationKeyDecodeErrorZ_get_ok(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok")] public static extern long CResult_RevocationKeyDecodeErrorZ_get_ok(long _owner); - // struct LDKDecodeError CResult_RevocationKeyDecodeErrorZ_get_err(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err")] public static extern long CResult_RevocationKeyDecodeErrorZ_get_err(long _owner); + // struct LDKTrackedSpendableOutput CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_ok")] public static extern long CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_TrackedSpendableOutputDecodeErrorZ_get_err(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_get_err")] public static extern long CResult_TrackedSpendableOutputDecodeErrorZ_get_err(long _owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_ty_from_ptr")] public static extern long LDKOutputSpendStatus_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height")] public static extern long LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash")] public static extern long LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height")] public static extern int LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx")] public static extern long LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash")] public static extern long LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height")] public static extern int LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx")] public static extern long LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height")] public static extern int LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash")] public static extern long LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash(long ptr); + // struct LDKOutputSpendStatus CResult_OutputSpendStatusDecodeErrorZ_get_ok(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_ok")] public static extern long CResult_OutputSpendStatusDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OutputSpendStatusDecodeErrorZ_get_err(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_get_err")] public static extern long CResult_OutputSpendStatusDecodeErrorZ_get_err(long _owner); public interface LDKFilter { void register_tx(long txid, long script_pubkey); void register_output(long output); @@ -1966,14 +2087,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Filter_register_output")] public static extern void Filter_register_output(long _this_arg, long _output); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_FilterZ_ty_from_ptr")] public static extern long LDKCOption_FilterZ_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKCOption_FilterZ_Some_get_some")] public static extern long LDKCOption_FilterZ_Some_get_some(long ptr); - // struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_get_ok(long _owner); - // void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err")] public static extern void CResult_LockedChannelMonitorNoneZ_get_err(long _owner); - // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(long _owner); - // struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(long _owner); + public interface LDKChangeDestinationSource { + long get_change_destination_script(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKChangeDestinationSource_new")] public static extern long LDKChangeDestinationSource_new_native(long impl_idx); + public static long[] LDKChangeDestinationSource_new(LDKChangeDestinationSource impl) { + long new_obj_idx = js_objs.Count; + int i = 0; + for (; i < js_objs.Count; i++) { + if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } + } + if (i == js_objs.Count) { + js_objs.Add(new WeakReference(impl)); + } else { + js_objs[i] = new WeakReference(impl); + } + long[] ret = new long[2]; + ret[0] = LDKChangeDestinationSource_new_native(i); + ret[1] = i; + return ret; + } + // LDKCResult_CVec_u8ZNoneZ ChangeDestinationSource_get_change_destination_script LDKChangeDestinationSource *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChangeDestinationSource_get_change_destination_script")] public static extern long ChangeDestinationSource_get_change_destination_script(long _this_arg); public interface LDKKVStore { long read(long primary_namespace, long secondary_namespace, long key); long write(long primary_namespace, long secondary_namespace, long key, long buf); @@ -2005,6 +2140,76 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KVStore_remove")] public static extern long KVStore_remove(long _this_arg, long _primary_namespace, long _secondary_namespace, long _key, bool _lazy); // LDKCResult_CVec_StrZIOErrorZ KVStore_list LDKKVStore *NONNULL_PTR this_arg, struct LDKStr primary_namespace, struct LDKStr secondary_namespace [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KVStore_list")] public static extern long KVStore_list(long _this_arg, long _primary_namespace, long _secondary_namespace); + public interface LDKOutputSpender { + long spend_spendable_outputs(long descriptors, long outputs, long change_destination_script, int feerate_sat_per_1000_weight, long locktime); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKOutputSpender_new")] public static extern long LDKOutputSpender_new_native(long impl_idx); + public static long[] LDKOutputSpender_new(LDKOutputSpender impl) { + long new_obj_idx = js_objs.Count; + int i = 0; + for (; i < js_objs.Count; i++) { + if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } + } + if (i == js_objs.Count) { + js_objs.Add(new WeakReference(impl)); + } else { + js_objs[i] = new WeakReference(impl); + } + long[] ret = new long[2]; + ret[0] = LDKOutputSpender_new_native(i); + ret[1] = i; + return ret; + } + // LDKCResult_TransactionNoneZ OutputSpender_spend_spendable_outputs LDKOutputSpender *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpender_spend_spendable_outputs")] public static extern long OutputSpender_spend_spendable_outputs(long _this_arg, long _descriptors, long _outputs, long _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime); + // struct LDKOutputSweeper CResult_OutputSweeperDecodeErrorZ_get_ok(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_ok")] public static extern long CResult_OutputSweeperDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_OutputSweeperDecodeErrorZ_get_err(LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSweeperDecodeErrorZ_get_err")] public static extern long CResult_OutputSweeperDecodeErrorZ_get_err(long _owner); + // struct LDKBestBlock C2Tuple_BestBlockOutputSweeperZ_get_a(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_a")] public static extern long C2Tuple_BestBlockOutputSweeperZ_get_a(long _owner); + // struct LDKOutputSweeper C2Tuple_BestBlockOutputSweeperZ_get_b(LDKC2Tuple_BestBlockOutputSweeperZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BestBlockOutputSweeperZ_get_b")] public static extern long C2Tuple_BestBlockOutputSweeperZ_get_b(long _owner); + // struct LDKC2Tuple_BestBlockOutputSweeperZ *CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok")] public static extern long CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err")] public static extern long CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(long _owner); + // struct LDKDelayedPaymentBasepoint CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentBasepointDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(LDKCResult_DelayedPaymentBasepointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_get_err")] public static extern long CResult_DelayedPaymentBasepointDecodeErrorZ_get_err(long _owner); + // struct LDKDelayedPaymentKey CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_ok")] public static extern long CResult_DelayedPaymentKeyDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_DelayedPaymentKeyDecodeErrorZ_get_err(LDKCResult_DelayedPaymentKeyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentKeyDecodeErrorZ_get_err")] public static extern long CResult_DelayedPaymentKeyDecodeErrorZ_get_err(long _owner); + // struct LDKHtlcBasepoint CResult_HtlcBasepointDecodeErrorZ_get_ok(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_ok")] public static extern long CResult_HtlcBasepointDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_HtlcBasepointDecodeErrorZ_get_err(LDKCResult_HtlcBasepointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcBasepointDecodeErrorZ_get_err")] public static extern long CResult_HtlcBasepointDecodeErrorZ_get_err(long _owner); + // struct LDKHtlcKey CResult_HtlcKeyDecodeErrorZ_get_ok(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_ok")] public static extern long CResult_HtlcKeyDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_HtlcKeyDecodeErrorZ_get_err(LDKCResult_HtlcKeyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_HtlcKeyDecodeErrorZ_get_err")] public static extern long CResult_HtlcKeyDecodeErrorZ_get_err(long _owner); + // struct LDKRevocationBasepoint CResult_RevocationBasepointDecodeErrorZ_get_ok(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_ok")] public static extern long CResult_RevocationBasepointDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_RevocationBasepointDecodeErrorZ_get_err(LDKCResult_RevocationBasepointDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationBasepointDecodeErrorZ_get_err")] public static extern long CResult_RevocationBasepointDecodeErrorZ_get_err(long _owner); + // struct LDKRevocationKey CResult_RevocationKeyDecodeErrorZ_get_ok(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_ok")] public static extern long CResult_RevocationKeyDecodeErrorZ_get_ok(long _owner); + // struct LDKDecodeError CResult_RevocationKeyDecodeErrorZ_get_err(LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationKeyDecodeErrorZ_get_err")] public static extern long CResult_RevocationKeyDecodeErrorZ_get_err(long _owner); + // struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_get_ok(long _owner); + // void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_get_err")] public static extern void CResult_LockedChannelMonitorNoneZ_get_err(long _owner); + // struct LDKOutPoint C2Tuple_OutPointChannelIdZ_get_a(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointChannelIdZ_get_a")] public static extern long C2Tuple_OutPointChannelIdZ_get_a(long _owner); + // struct LDKChannelId C2Tuple_OutPointChannelIdZ_get_b(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointChannelIdZ_get_b")] public static extern long C2Tuple_OutPointChannelIdZ_get_b(long _owner); + // struct LDKOutPoint C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_a(long _owner); + // struct LDKCVec_MonitorUpdateIdZ C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR owner); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b")] public static extern long C2Tuple_OutPointCVec_MonitorUpdateIdZZ_get_b(long _owner); public interface LDKPersister { long persist_manager(long channel_manager); long persist_graph(long network_graph); @@ -2034,8 +2239,9 @@ internal class bindings { // LDKCResult_NoneIOErrorZ Persister_persist_scorer LDKPersister *NONNULL_PTR this_arg, const struct LDKWriteableScore *NONNULL_PTR scorer [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persister_persist_scorer")] public static extern long Persister_persist_scorer(long _this_arg, long _scorer); public interface LDKPersist { - ChannelMonitorUpdateStatus persist_new_channel(long channel_id, long data, long update_id); - ChannelMonitorUpdateStatus update_persisted_channel(long channel_id, long update, long data, long update_id); + ChannelMonitorUpdateStatus persist_new_channel(long channel_funding_outpoint, long data, long update_id); + ChannelMonitorUpdateStatus update_persisted_channel(long channel_funding_outpoint, long update, long data, long update_id); + void archive_persisted_channel(long channel_funding_outpoint); } [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKPersist_new")] public static extern long LDKPersist_new_native(long impl_idx); public static long[] LDKPersist_new(LDKPersist impl) { @@ -2054,32 +2260,12 @@ internal class bindings { ret[1] = i; return ret; } - // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_persist_new_channel")] public static extern ChannelMonitorUpdateStatus Persist_persist_new_channel(long _this_arg, long _channel_id, long _data, long _update_id); - // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_id, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_update_persisted_channel")] public static extern ChannelMonitorUpdateStatus Persist_update_persisted_channel(long _this_arg, long _channel_id, long _update, long _data, long _update_id); - public interface LDKFutureCallback { - void call(); - } - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFutureCallback_new")] public static extern long LDKFutureCallback_new_native(long impl_idx); - public static long[] LDKFutureCallback_new(LDKFutureCallback impl) { - long new_obj_idx = js_objs.Count; - int i = 0; - for (; i < js_objs.Count; i++) { - if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } - } - if (i == js_objs.Count) { - js_objs.Add(new WeakReference(impl)); - } else { - js_objs[i] = new WeakReference(impl); - } - long[] ret = new long[2]; - ret[0] = LDKFutureCallback_new_native(i); - ret[1] = i; - return ret; - } - // void FutureCallback_call LDKFutureCallback *NONNULL_PTR this_arg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FutureCallback_call")] public static extern void FutureCallback_call(long _this_arg); + // LDKChannelMonitorUpdateStatus Persist_persist_new_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_persist_new_channel")] public static extern ChannelMonitorUpdateStatus Persist_persist_new_channel(long _this_arg, long _channel_funding_outpoint, long _data, long _update_id); + // LDKChannelMonitorUpdateStatus Persist_update_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint, struct LDKChannelMonitorUpdate update, const struct LDKChannelMonitor *NONNULL_PTR data, struct LDKMonitorUpdateId update_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_update_persisted_channel")] public static extern ChannelMonitorUpdateStatus Persist_update_persisted_channel(long _this_arg, long _channel_funding_outpoint, long _update, long _data, long _update_id); + // void Persist_archive_persisted_channel LDKPersist *NONNULL_PTR this_arg, struct LDKOutPoint channel_funding_outpoint + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Persist_archive_persisted_channel")] public static extern void Persist_archive_persisted_channel(long _this_arg, long _channel_funding_outpoint); public interface LDKListen { void filtered_block_connected(long header, long txdata, int height); void block_connected(long block, int height); @@ -2139,6 +2325,31 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_best_block_updated")] public static extern void Confirm_best_block_updated(long _this_arg, long _header, int _height); // LDKCVec_C3Tuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZZ Confirm_get_relevant_txids LDKConfirm *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Confirm_get_relevant_txids")] public static extern long Confirm_get_relevant_txids(long _this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendingDelay_ty_from_ptr")] public static extern long LDKSpendingDelay_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendingDelay_Relative_get_num_blocks")] public static extern int LDKSpendingDelay_Relative_get_num_blocks(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSpendingDelay_Absolute_get_height")] public static extern int LDKSpendingDelay_Absolute_get_height(long ptr); + public interface LDKFutureCallback { + void call(); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKFutureCallback_new")] public static extern long LDKFutureCallback_new_native(long impl_idx); + public static long[] LDKFutureCallback_new(LDKFutureCallback impl) { + long new_obj_idx = js_objs.Count; + int i = 0; + for (; i < js_objs.Count; i++) { + if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } + } + if (i == js_objs.Count) { + js_objs.Add(new WeakReference(impl)); + } else { + js_objs[i] = new WeakReference(impl); + } + long[] ret = new long[2]; + ret[0] = LDKFutureCallback_new_native(i); + ret[1] = i; + return ret; + } + // void FutureCallback_call LDKFutureCallback *NONNULL_PTR this_arg + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FutureCallback_call")] public static extern void FutureCallback_call(long _this_arg); public interface LDKEventHandler { void handle_event(long _event); } @@ -2218,9 +2429,6 @@ internal class bindings { void handle_shutdown(long their_node_id, long msg); void handle_closing_signed(long their_node_id, long msg); void handle_stfu(long their_node_id, long msg); - void handle_splice(long their_node_id, long msg); - void handle_splice_ack(long their_node_id, long msg); - void handle_splice_locked(long their_node_id, long msg); void handle_tx_add_input(long their_node_id, long msg); void handle_tx_add_output(long their_node_id, long msg); void handle_tx_remove_input(long their_node_id, long msg); @@ -2284,12 +2492,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_closing_signed")] public static extern void ChannelMessageHandler_handle_closing_signed(long _this_arg, long _their_node_id, long _msg); // void ChannelMessageHandler_handle_stfu LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKStfu *NONNULL_PTR msg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_stfu")] public static extern void ChannelMessageHandler_handle_stfu(long _this_arg, long _their_node_id, long _msg); - // void ChannelMessageHandler_handle_splice LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKSplice *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_splice")] public static extern void ChannelMessageHandler_handle_splice(long _this_arg, long _their_node_id, long _msg); - // void ChannelMessageHandler_handle_splice_ack LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKSpliceAck *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_splice_ack")] public static extern void ChannelMessageHandler_handle_splice_ack(long _this_arg, long _their_node_id, long _msg); - // void ChannelMessageHandler_handle_splice_locked LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKSpliceLocked *NONNULL_PTR msg - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_splice_locked")] public static extern void ChannelMessageHandler_handle_splice_locked(long _this_arg, long _their_node_id, long _msg); // void ChannelMessageHandler_handle_tx_add_input LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddInput *NONNULL_PTR msg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMessageHandler_handle_tx_add_input")] public static extern void ChannelMessageHandler_handle_tx_add_input(long _this_arg, long _their_node_id, long _msg); // void ChannelMessageHandler_handle_tx_add_output LDKChannelMessageHandler *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, const struct LDKTxAddOutput *NONNULL_PTR msg @@ -2365,6 +2567,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageHandler_handle_message")] public static extern long OffersMessageHandler_handle_message(long _this_arg, long _message); // LDKCVec_C3Tuple_OffersMessageDestinationBlindedPathZZ OffersMessageHandler_release_pending_messages LDKOffersMessageHandler *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OffersMessageHandler_release_pending_messages")] public static extern long OffersMessageHandler_release_pending_messages(long _this_arg); + public interface LDKNodeIdLookUp { + long next_node_id(long short_channel_id); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKNodeIdLookUp_new")] public static extern long LDKNodeIdLookUp_new_native(long impl_idx); + public static long[] LDKNodeIdLookUp_new(LDKNodeIdLookUp impl) { + long new_obj_idx = js_objs.Count; + int i = 0; + for (; i < js_objs.Count; i++) { + if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } + } + if (i == js_objs.Count) { + js_objs.Add(new WeakReference(impl)); + } else { + js_objs[i] = new WeakReference(impl); + } + long[] ret = new long[2]; + ret[0] = LDKNodeIdLookUp_new_native(i); + ret[1] = i; + return ret; + } + // LDKPublicKey NodeIdLookUp_next_node_id LDKNodeIdLookUp *NONNULL_PTR this_arg, uint64_t short_channel_id + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeIdLookUp_next_node_id")] public static extern long NodeIdLookUp_next_node_id(long _this_arg, long _short_channel_id); public interface LDKRoutingMessageHandler { long handle_node_announcement(long msg); long handle_channel_announcement(long msg); @@ -2576,6 +2800,52 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_disconnect_socket")] public static extern void SocketDescriptor_disconnect_socket(long _this_arg); // uint64_t SocketDescriptor_hash LDKSocketDescriptor *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_hash")] public static extern long SocketDescriptor_hash(long _this_arg); + public interface LDKSignBolt12InvoiceFn { + long sign_invoice(long message); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignBolt12InvoiceFn_new")] public static extern long LDKSignBolt12InvoiceFn_new_native(long impl_idx); + public static long[] LDKSignBolt12InvoiceFn_new(LDKSignBolt12InvoiceFn impl) { + long new_obj_idx = js_objs.Count; + int i = 0; + for (; i < js_objs.Count; i++) { + if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } + } + if (i == js_objs.Count) { + js_objs.Add(new WeakReference(impl)); + } else { + js_objs[i] = new WeakReference(impl); + } + long[] ret = new long[2]; + ret[0] = LDKSignBolt12InvoiceFn_new_native(i); + ret[1] = i; + return ret; + } + // LDKCResult_SchnorrSignatureNoneZ SignBolt12InvoiceFn_sign_invoice LDKSignBolt12InvoiceFn *NONNULL_PTR this_arg, const struct LDKUnsignedBolt12Invoice *NONNULL_PTR message + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignBolt12InvoiceFn_sign_invoice")] public static extern long SignBolt12InvoiceFn_sign_invoice(long _this_arg, long _message); + public interface LDKSignInvoiceRequestFn { + long sign_invoice_request(long message); + } + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignInvoiceRequestFn_new")] public static extern long LDKSignInvoiceRequestFn_new_native(long impl_idx); + public static long[] LDKSignInvoiceRequestFn_new(LDKSignInvoiceRequestFn impl) { + long new_obj_idx = js_objs.Count; + int i = 0; + for (; i < js_objs.Count; i++) { + if (js_objs[i] == null || !js_objs[i].IsAlive) { new_obj_idx = i; break; } + } + if (i == js_objs.Count) { + js_objs.Add(new WeakReference(impl)); + } else { + js_objs[i] = new WeakReference(impl); + } + long[] ret = new long[2]; + ret[0] = LDKSignInvoiceRequestFn_new_native(i); + ret[1] = i; + return ret; + } + // LDKCResult_SchnorrSignatureNoneZ SignInvoiceRequestFn_sign_invoice_request LDKSignInvoiceRequestFn *NONNULL_PTR this_arg, const struct LDKUnsignedInvoiceRequest *NONNULL_PTR message + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignInvoiceRequestFn_sign_invoice_request")] public static extern long SignInvoiceRequestFn_sign_invoice_request(long _this_arg, long _message); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignError_ty_from_ptr")] public static extern long LDKSignError_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKSignError_Verification_get_verification")] public static extern Secp256k1Error LDKSignError_Verification_get_verification(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_ty_from_ptr")] public static extern long LDKEffectiveCapacity_ty_from_ptr(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat")] public static extern long LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(long ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKEffectiveCapacity_AdvertisedMaxHTLC_get_amount_msat")] public static extern long LDKEffectiveCapacity_AdvertisedMaxHTLC_get_amount_msat(long ptr); @@ -2611,6 +2881,10 @@ internal class bindings { } // LDKCVec_u8Z Score_write LDKScore *NONNULL_PTR this_arg [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Score_write")] public static extern long Score_write(long _this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKIntroductionNode_ty_from_ptr")] public static extern long LDKIntroductionNode_ty_from_ptr(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKIntroductionNode_NodeId_get_node_id")] public static extern long LDKIntroductionNode_NodeId_get_node_id(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__0")] public static extern Direction LDKIntroductionNode_DirectedShortChannelId_get__0(long ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_LDKIntroductionNode_DirectedShortChannelId_get__1")] public static extern long LDKIntroductionNode_DirectedShortChannelId_get__1(long ptr); public interface LDKCoinSelectionSource { long select_confirmed_utxos(long claim_id, long must_spend, long must_pay_to, int target_feerate_sat_per_1000_weight); long sign_psbt(long psbt); @@ -2694,6 +2968,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WitnessProgram_free")] public static extern void WitnessProgram_free(long _o); // struct LDKBigEndianScalar BigEndianScalar_new(struct LDKThirtyTwoBytes big_endian_bytes); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigEndianScalar_new")] public static extern long BigEndianScalar_new(long _big_endian_bytes); + // uint64_t BigEndianScalar_clone_ptr(LDKBigEndianScalar *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigEndianScalar_clone_ptr")] public static extern long BigEndianScalar_clone_ptr(long _arg); + // struct LDKBigEndianScalar BigEndianScalar_clone(const struct LDKBigEndianScalar *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BigEndianScalar_clone")] public static extern long BigEndianScalar_clone(long _orig); // uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bech32Error_clone_ptr")] public static extern long Bech32Error_clone_ptr(long _arg); // struct LDKBech32Error Bech32Error_clone(const struct LDKBech32Error *NONNULL_PTR orig); @@ -2732,6 +3010,32 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxOut_clone")] public static extern long TxOut_clone(long _orig); // void Str_free(struct LDKStr _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Str_free")] public static extern void Str_free(long __res); + // void CVec_u8Z_free(struct LDKCVec_u8Z _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_u8Z_free")] public static extern void CVec_u8Z_free(long __res); + // struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKRefundMaybeWithDerivedMetadataBuilder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok")] public static extern long CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err")] public static extern long CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free")] public static extern void CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone")] public static extern long CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(long _orig); + // struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_ok(struct LDKRefund o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_ok")] public static extern long CResult_RefundBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_err")] public static extern long CResult_RefundBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_RefundBolt12SemanticErrorZ_is_ok(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_RefundBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_RefundBolt12SemanticErrorZ_free(struct LDKCResult_RefundBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_free")] public static extern void CResult_RefundBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_RefundBolt12SemanticErrorZ_clone_ptr(LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_RefundBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_RefundBolt12SemanticErrorZ CResult_RefundBolt12SemanticErrorZ_clone(const struct LDKCResult_RefundBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RefundBolt12SemanticErrorZ_clone")] public static extern long CResult_RefundBolt12SemanticErrorZ_clone(long _orig); // struct LDKCOption_u64Z COption_u64Z_some(uint64_t o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_u64Z_some")] public static extern long COption_u64Z_some(long _o); // struct LDKCOption_u64Z COption_u64Z_none(void); @@ -2794,8 +3098,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ThirtyTwoBytesZ_clone_ptr")] public static extern long COption_ThirtyTwoBytesZ_clone_ptr(long _arg); // struct LDKCOption_ThirtyTwoBytesZ COption_ThirtyTwoBytesZ_clone(const struct LDKCOption_ThirtyTwoBytesZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ThirtyTwoBytesZ_clone")] public static extern long COption_ThirtyTwoBytesZ_clone(long _orig); - // void CVec_u8Z_free(struct LDKCVec_u8Z _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_u8Z_free")] public static extern void CVec_u8Z_free(long __res); // struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_some(struct LDKCVec_u8Z o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_u8ZZ_some")] public static extern long COption_CVec_u8ZZ_some(long _o); // struct LDKCOption_CVec_u8ZZ COption_CVec_u8ZZ_none(void); @@ -2840,6 +3142,42 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsNoneZ_clone_ptr")] public static extern long CResult_RecipientOnionFieldsNoneZ_clone_ptr(long _arg); // struct LDKCResult_RecipientOnionFieldsNoneZ CResult_RecipientOnionFieldsNoneZ_clone(const struct LDKCResult_RecipientOnionFieldsNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecipientOnionFieldsNoneZ_clone")] public static extern long CResult_RecipientOnionFieldsNoneZ_clone(long _orig); + // struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKUnsignedBolt12Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok")] public static extern long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err")] public static extern long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free")] public static extern void CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone")] public static extern long CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(long _orig); + // struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(struct LDKBolt12Invoice o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok")] public static extern long CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_err")] public static extern long CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_free")] public static extern void CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(const struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone")] public static extern long CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(long _orig); + // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_ok")] public static extern long CResult_SchnorrSignatureNoneZ_ok(long _o); + // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_err")] public static extern long CResult_SchnorrSignatureNoneZ_err(); + // bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok")] public static extern bool CResult_SchnorrSignatureNoneZ_is_ok(long _o); + // void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_free")] public static extern void CResult_SchnorrSignatureNoneZ_free(long __res); + // uint64_t CResult_SchnorrSignatureNoneZ_clone_ptr(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr")] public static extern long CResult_SchnorrSignatureNoneZ_clone_ptr(long _arg); + // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_clone")] public static extern long CResult_SchnorrSignatureNoneZ_clone(long _orig); // void CVec_ThirtyTwoBytesZ_free(struct LDKCVec_ThirtyTwoBytesZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ThirtyTwoBytesZ_free")] public static extern void CVec_ThirtyTwoBytesZ_free(long __res); // struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_some(struct LDKCVec_ThirtyTwoBytesZ o); @@ -2852,6 +3190,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ThirtyTwoBytesZZ_clone_ptr")] public static extern long COption_CVec_ThirtyTwoBytesZZ_clone_ptr(long _arg); // struct LDKCOption_CVec_ThirtyTwoBytesZZ COption_CVec_ThirtyTwoBytesZZ_clone(const struct LDKCOption_CVec_ThirtyTwoBytesZZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_ThirtyTwoBytesZZ_clone")] public static extern long COption_CVec_ThirtyTwoBytesZZ_clone(long _orig); + // struct LDKCOption_AmountZ COption_AmountZ_some(struct LDKAmount o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AmountZ_some")] public static extern long COption_AmountZ_some(long _o); + // struct LDKCOption_AmountZ COption_AmountZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AmountZ_none")] public static extern long COption_AmountZ_none(); + // void COption_AmountZ_free(struct LDKCOption_AmountZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AmountZ_free")] public static extern void COption_AmountZ_free(long __res); + // uint64_t COption_AmountZ_clone_ptr(LDKCOption_AmountZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AmountZ_clone_ptr")] public static extern long COption_AmountZ_clone_ptr(long _arg); + // struct LDKCOption_AmountZ COption_AmountZ_clone(const struct LDKCOption_AmountZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_AmountZ_clone")] public static extern long COption_AmountZ_clone(long _orig); + // struct LDKCOption_QuantityZ COption_QuantityZ_some(struct LDKQuantity o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_QuantityZ_some")] public static extern long COption_QuantityZ_some(long _o); + // struct LDKCOption_QuantityZ COption_QuantityZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_QuantityZ_none")] public static extern long COption_QuantityZ_none(); + // void COption_QuantityZ_free(struct LDKCOption_QuantityZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_QuantityZ_free")] public static extern void COption_QuantityZ_free(long __res); + // uint64_t COption_QuantityZ_clone_ptr(LDKCOption_QuantityZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_QuantityZ_clone_ptr")] public static extern long COption_QuantityZ_clone_ptr(long _arg); + // struct LDKCOption_QuantityZ COption_QuantityZ_clone(const struct LDKCOption_QuantityZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_QuantityZ_clone")] public static extern long COption_QuantityZ_clone(long _orig); // struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_ok(struct LDKThirtyTwoBytes o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesNoneZ_ok")] public static extern long CResult_ThirtyTwoBytesNoneZ_ok(long _o); // struct LDKCResult_ThirtyTwoBytesNoneZ CResult_ThirtyTwoBytesNoneZ_err(void); @@ -3018,18 +3376,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_clone_ptr")] public static extern long CResult_RecoverableSignatureNoneZ_clone_ptr(long _arg); // struct LDKCResult_RecoverableSignatureNoneZ CResult_RecoverableSignatureNoneZ_clone(const struct LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RecoverableSignatureNoneZ_clone")] public static extern long CResult_RecoverableSignatureNoneZ_clone(long _orig); - // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_ok(struct LDKSchnorrSignature o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_ok")] public static extern long CResult_SchnorrSignatureNoneZ_ok(long _o); - // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_err")] public static extern long CResult_SchnorrSignatureNoneZ_err(); - // bool CResult_SchnorrSignatureNoneZ_is_ok(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_is_ok")] public static extern bool CResult_SchnorrSignatureNoneZ_is_ok(long _o); - // void CResult_SchnorrSignatureNoneZ_free(struct LDKCResult_SchnorrSignatureNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_free")] public static extern void CResult_SchnorrSignatureNoneZ_free(long __res); - // uint64_t CResult_SchnorrSignatureNoneZ_clone_ptr(LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_clone_ptr")] public static extern long CResult_SchnorrSignatureNoneZ_clone_ptr(long _arg); - // struct LDKCResult_SchnorrSignatureNoneZ CResult_SchnorrSignatureNoneZ_clone(const struct LDKCResult_SchnorrSignatureNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SchnorrSignatureNoneZ_clone")] public static extern long CResult_SchnorrSignatureNoneZ_clone(long _orig); // struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_ok(struct LDKECDSASignature o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ECDSASignatureNoneZ_ok")] public static extern long CResult_ECDSASignatureNoneZ_ok(long _o); // struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_err(void); @@ -3042,6 +3388,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ECDSASignatureNoneZ_clone_ptr")] public static extern long CResult_ECDSASignatureNoneZ_clone_ptr(long _arg); // struct LDKCResult_ECDSASignatureNoneZ CResult_ECDSASignatureNoneZ_clone(const struct LDKCResult_ECDSASignatureNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ECDSASignatureNoneZ_clone")] public static extern long CResult_ECDSASignatureNoneZ_clone(long _orig); + // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_ok")] public static extern long CResult_TransactionNoneZ_ok(long _o); + // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_err")] public static extern long CResult_TransactionNoneZ_err(); + // bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_is_ok")] public static extern bool CResult_TransactionNoneZ_is_ok(long _o); + // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_free")] public static extern void CResult_TransactionNoneZ_free(long __res); + // uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_clone_ptr")] public static extern long CResult_TransactionNoneZ_clone_ptr(long _arg); + // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_clone")] public static extern long CResult_TransactionNoneZ_clone(long _orig); // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(struct LDKWriteableEcdsaChannelSigner o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok")] public static extern long CResult_WriteableEcdsaChannelSignerDecodeErrorZ_ok(long _o); // struct LDKCResult_WriteableEcdsaChannelSignerDecodeErrorZ CResult_WriteableEcdsaChannelSignerDecodeErrorZ_err(struct LDKDecodeError e); @@ -3144,18 +3502,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone_ptr")] public static extern long CResult_InMemorySignerDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_InMemorySignerDecodeErrorZ CResult_InMemorySignerDecodeErrorZ_clone(const struct LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InMemorySignerDecodeErrorZ_clone")] public static extern long CResult_InMemorySignerDecodeErrorZ_clone(long _orig); - // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_ok(struct LDKTransaction o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_ok")] public static extern long CResult_TransactionNoneZ_ok(long _o); - // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_err(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_err")] public static extern long CResult_TransactionNoneZ_err(); - // bool CResult_TransactionNoneZ_is_ok(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_is_ok")] public static extern bool CResult_TransactionNoneZ_is_ok(long _o); - // void CResult_TransactionNoneZ_free(struct LDKCResult_TransactionNoneZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_free")] public static extern void CResult_TransactionNoneZ_free(long __res); - // uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_clone_ptr")] public static extern long CResult_TransactionNoneZ_clone_ptr(long _arg); - // struct LDKCResult_TransactionNoneZ CResult_TransactionNoneZ_clone(const struct LDKCResult_TransactionNoneZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TransactionNoneZ_clone")] public static extern long CResult_TransactionNoneZ_clone(long _orig); // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_some(struct LDKWriteableScore o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_WriteableScoreZ_some")] public static extern long COption_WriteableScoreZ_some(long _o); // struct LDKCOption_WriteableScoreZ COption_WriteableScoreZ_none(void); @@ -3408,6 +3754,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_is_ok")] public static extern bool CResult_ProbabilisticScorerDecodeErrorZ_is_ok(long _o); // void CResult_ProbabilisticScorerDecodeErrorZ_free(struct LDKCResult_ProbabilisticScorerDecodeErrorZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ProbabilisticScorerDecodeErrorZ_free")] public static extern void CResult_ProbabilisticScorerDecodeErrorZ_free(long __res); + // struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_ok(struct LDKBestBlock o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_ok")] public static extern long CResult_BestBlockDecodeErrorZ_ok(long _o); + // struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_err")] public static extern long CResult_BestBlockDecodeErrorZ_err(long _e); + // bool CResult_BestBlockDecodeErrorZ_is_ok(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_is_ok")] public static extern bool CResult_BestBlockDecodeErrorZ_is_ok(long _o); + // void CResult_BestBlockDecodeErrorZ_free(struct LDKCResult_BestBlockDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_free")] public static extern void CResult_BestBlockDecodeErrorZ_free(long __res); + // uint64_t CResult_BestBlockDecodeErrorZ_clone_ptr(LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_clone_ptr")] public static extern long CResult_BestBlockDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_BestBlockDecodeErrorZ CResult_BestBlockDecodeErrorZ_clone(const struct LDKCResult_BestBlockDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BestBlockDecodeErrorZ_clone")] public static extern long CResult_BestBlockDecodeErrorZ_clone(long _orig); // uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_usizeTransactionZ_clone_ptr")] public static extern long C2Tuple_usizeTransactionZ_clone_ptr(long _arg); // struct LDKC2Tuple_usizeTransactionZ C2Tuple_usizeTransactionZ_clone(const struct LDKC2Tuple_usizeTransactionZ *NONNULL_PTR orig); @@ -3442,16 +3800,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelMonitorUpdateStatusNoneZ_clone")] public static extern long CResult_ChannelMonitorUpdateStatusNoneZ_clone(long _orig); // void CVec_MonitorEventZ_free(struct LDKCVec_MonitorEventZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MonitorEventZ_free")] public static extern void CVec_MonitorEventZ_free(long __res); - // uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(long _arg); - // struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(long _orig); - // struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKCVec_MonitorEventZ b, struct LDKPublicKey c); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new")] public static extern long C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(long _a, long _b, long _c); - // void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(struct LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free")] public static extern void C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(long __res); - // void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free")] public static extern void CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(long __res); + // uint64_t C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(long _arg); + // struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(const struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(long _orig); + // struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(struct LDKOutPoint a, struct LDKChannelId b, struct LDKCVec_MonitorEventZ c, struct LDKPublicKey d); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new")] public static extern long C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(long _a, long _b, long _c, long _d); + // void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(struct LDKC4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free")] public static extern void C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(long __res); + // void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(struct LDKCVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free")] public static extern void CVec_C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZZ_free(long __res); // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_ok(struct LDKInitFeatures o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InitFeaturesDecodeErrorZ_ok")] public static extern long CResult_InitFeaturesDecodeErrorZ_ok(long _o); // struct LDKCResult_InitFeaturesDecodeErrorZ CResult_InitFeaturesDecodeErrorZ_err(struct LDKDecodeError e); @@ -3536,6 +3894,58 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ CResult_ChannelTypeFeaturesDecodeErrorZ_clone(const struct LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelTypeFeaturesDecodeErrorZ_clone")] public static extern long CResult_ChannelTypeFeaturesDecodeErrorZ_clone(long _orig); + // struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_ok(struct LDKOfferId o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_ok")] public static extern long CResult_OfferIdDecodeErrorZ_ok(long _o); + // struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_err")] public static extern long CResult_OfferIdDecodeErrorZ_err(long _e); + // bool CResult_OfferIdDecodeErrorZ_is_ok(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_is_ok")] public static extern bool CResult_OfferIdDecodeErrorZ_is_ok(long _o); + // void CResult_OfferIdDecodeErrorZ_free(struct LDKCResult_OfferIdDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_free")] public static extern void CResult_OfferIdDecodeErrorZ_free(long __res); + // uint64_t CResult_OfferIdDecodeErrorZ_clone_ptr(LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_clone_ptr")] public static extern long CResult_OfferIdDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OfferIdDecodeErrorZ CResult_OfferIdDecodeErrorZ_clone(const struct LDKCResult_OfferIdDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferIdDecodeErrorZ_clone")] public static extern long CResult_OfferIdDecodeErrorZ_clone(long _orig); + // struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok")] public static extern long CResult_NoneBolt12SemanticErrorZ_ok(); + // struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_err")] public static extern long CResult_NoneBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_NoneBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_free")] public static extern void CResult_NoneBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_NoneBolt12SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_NoneBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone")] public static extern long CResult_NoneBolt12SemanticErrorZ_clone(long _orig); + // struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_ok(struct LDKOffer o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_ok")] public static extern long CResult_OfferBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_err")] public static extern long CResult_OfferBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_OfferBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_OfferBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_OfferBolt12SemanticErrorZ_free(struct LDKCResult_OfferBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_free")] public static extern void CResult_OfferBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_OfferBolt12SemanticErrorZ_clone_ptr(LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_OfferBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OfferBolt12SemanticErrorZ CResult_OfferBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12SemanticErrorZ_clone")] public static extern long CResult_OfferBolt12SemanticErrorZ_clone(long _orig); + // struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithDerivedPayerIdBuilder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok")] public static extern long CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err")] public static extern long CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free")] public static extern void CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(long __res); + // struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceRequestWithExplicitPayerIdBuilder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok")] public static extern long CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err")] public static extern long CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free")] public static extern void CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(long __res); // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_ok(struct LDKOffer o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_ok")] public static extern long CResult_OfferBolt12ParseErrorZ_ok(long _o); // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_err(struct LDKBolt12ParseError e); @@ -3548,18 +3958,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_clone_ptr")] public static extern long CResult_OfferBolt12ParseErrorZ_clone_ptr(long _arg); // struct LDKCResult_OfferBolt12ParseErrorZ CResult_OfferBolt12ParseErrorZ_clone(const struct LDKCResult_OfferBolt12ParseErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferBolt12ParseErrorZ_clone")] public static extern long CResult_OfferBolt12ParseErrorZ_clone(long _orig); - // struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_ok")] public static extern long CResult_PublicKeySecp256k1ErrorZ_ok(long _o); - // struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err")] public static extern long CResult_PublicKeySecp256k1ErrorZ_err(Secp256k1Error _e); - // bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok")] public static extern bool CResult_PublicKeySecp256k1ErrorZ_is_ok(long _o); - // void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free")] public static extern void CResult_PublicKeySecp256k1ErrorZ_free(long __res); - // uint64_t CResult_PublicKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr")] public static extern long CResult_PublicKeySecp256k1ErrorZ_clone_ptr(long _arg); - // struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone")] public static extern long CResult_PublicKeySecp256k1ErrorZ_clone(long _orig); // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_ok(struct LDKNodeId o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_ok")] public static extern long CResult_NodeIdDecodeErrorZ_ok(long _o); // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_err(struct LDKDecodeError e); @@ -3572,6 +3970,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_clone_ptr")] public static extern long CResult_NodeIdDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_NodeIdDecodeErrorZ CResult_NodeIdDecodeErrorZ_clone(const struct LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NodeIdDecodeErrorZ_clone")] public static extern long CResult_NodeIdDecodeErrorZ_clone(long _orig); + // struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_ok(struct LDKPublicKey o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_ok")] public static extern long CResult_PublicKeySecp256k1ErrorZ_ok(long _o); + // struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_err(enum LDKSecp256k1Error e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_err")] public static extern long CResult_PublicKeySecp256k1ErrorZ_err(Secp256k1Error _e); + // bool CResult_PublicKeySecp256k1ErrorZ_is_ok(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_is_ok")] public static extern bool CResult_PublicKeySecp256k1ErrorZ_is_ok(long _o); + // void CResult_PublicKeySecp256k1ErrorZ_free(struct LDKCResult_PublicKeySecp256k1ErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_free")] public static extern void CResult_PublicKeySecp256k1ErrorZ_free(long __res); + // uint64_t CResult_PublicKeySecp256k1ErrorZ_clone_ptr(LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone_ptr")] public static extern long CResult_PublicKeySecp256k1ErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PublicKeySecp256k1ErrorZ CResult_PublicKeySecp256k1ErrorZ_clone(const struct LDKCResult_PublicKeySecp256k1ErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PublicKeySecp256k1ErrorZ_clone")] public static extern long CResult_PublicKeySecp256k1ErrorZ_clone(long _orig); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_some(struct LDKNetworkUpdate o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NetworkUpdateZ_some")] public static extern long COption_NetworkUpdateZ_some(long _o); // struct LDKCOption_NetworkUpdateZ COption_NetworkUpdateZ_none(void); @@ -3736,6 +4146,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_SocketAddressZZ_clone_ptr")] public static extern long COption_CVec_SocketAddressZZ_clone_ptr(long _arg); // struct LDKCOption_CVec_SocketAddressZZ COption_CVec_SocketAddressZZ_clone(const struct LDKCOption_CVec_SocketAddressZZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_CVec_SocketAddressZZ_clone")] public static extern long COption_CVec_SocketAddressZZ_clone(long _orig); + // struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_ok(uint64_t o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u64ShortChannelIdErrorZ_ok")] public static extern long CResult_u64ShortChannelIdErrorZ_ok(long _o); + // struct LDKCResult_u64ShortChannelIdErrorZ CResult_u64ShortChannelIdErrorZ_err(enum LDKShortChannelIdError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u64ShortChannelIdErrorZ_err")] public static extern long CResult_u64ShortChannelIdErrorZ_err(ShortChannelIdError _e); + // bool CResult_u64ShortChannelIdErrorZ_is_ok(const struct LDKCResult_u64ShortChannelIdErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u64ShortChannelIdErrorZ_is_ok")] public static extern bool CResult_u64ShortChannelIdErrorZ_is_ok(long _o); + // void CResult_u64ShortChannelIdErrorZ_free(struct LDKCResult_u64ShortChannelIdErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_u64ShortChannelIdErrorZ_free")] public static extern void CResult_u64ShortChannelIdErrorZ_free(long __res); // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_ok(struct LDKPendingHTLCInfo o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_ok")] public static extern long CResult_PendingHTLCInfoInboundHTLCErrZ_ok(long _o); // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_err(struct LDKInboundHTLCErr e); @@ -3744,6 +4162,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok")] public static extern bool CResult_PendingHTLCInfoInboundHTLCErrZ_is_ok(long _o); // void CResult_PendingHTLCInfoInboundHTLCErrZ_free(struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_free")] public static extern void CResult_PendingHTLCInfoInboundHTLCErrZ_free(long __res); + // uint64_t CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr")] public static extern long CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(long _arg); + // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ CResult_PendingHTLCInfoInboundHTLCErrZ_clone(const struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PendingHTLCInfoInboundHTLCErrZ_clone")] public static extern long CResult_PendingHTLCInfoInboundHTLCErrZ_clone(long _orig); // void CVec_HTLCOutputInCommitmentZ_free(struct LDKCVec_HTLCOutputInCommitmentZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_HTLCOutputInCommitmentZ_free")] public static extern void CVec_HTLCOutputInCommitmentZ_free(long __res); // void CVec_HTLCDescriptorZ_free(struct LDKCVec_HTLCDescriptorZ _res); @@ -3786,6 +4208,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_clone_ptr")] public static extern long CResult_CVec_UtxoZNoneZ_clone_ptr(long _arg); // struct LDKCResult_CVec_UtxoZNoneZ CResult_CVec_UtxoZNoneZ_clone(const struct LDKCResult_CVec_UtxoZNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_UtxoZNoneZ_clone")] public static extern long CResult_CVec_UtxoZNoneZ_clone(long _orig); + // struct LDKCOption_PaymentContextZ COption_PaymentContextZ_some(struct LDKPaymentContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentContextZ_some")] public static extern long COption_PaymentContextZ_some(long _o); + // struct LDKCOption_PaymentContextZ COption_PaymentContextZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentContextZ_none")] public static extern long COption_PaymentContextZ_none(); + // void COption_PaymentContextZ_free(struct LDKCOption_PaymentContextZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentContextZ_free")] public static extern void COption_PaymentContextZ_free(long __res); + // uint64_t COption_PaymentContextZ_clone_ptr(LDKCOption_PaymentContextZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentContextZ_clone_ptr")] public static extern long COption_PaymentContextZ_clone_ptr(long _arg); + // struct LDKCOption_PaymentContextZ COption_PaymentContextZ_clone(const struct LDKCOption_PaymentContextZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_PaymentContextZ_clone")] public static extern long COption_PaymentContextZ_clone(long _orig); // uint64_t C2Tuple_u64u16Z_clone_ptr(LDKC2Tuple_u64u16Z *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u64u16Z_clone_ptr")] public static extern long C2Tuple_u64u16Z_clone_ptr(long _arg); // struct LDKC2Tuple_u64u16Z C2Tuple_u64u16Z_clone(const struct LDKC2Tuple_u64u16Z *NONNULL_PTR orig); @@ -3814,18 +4246,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone_ptr")] public static extern long COption_ChannelShutdownStateZ_clone_ptr(long _arg); // struct LDKCOption_ChannelShutdownStateZ COption_ChannelShutdownStateZ_clone(const struct LDKCOption_ChannelShutdownStateZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ChannelShutdownStateZ_clone")] public static extern long COption_ChannelShutdownStateZ_clone(long _orig); - // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_ok")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_ok(long _o); - // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_err(long _e); - // bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok")] public static extern bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(long _o); - // void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free")] public static extern void CResult_ThirtyTwoBytesAPIErrorZ_free(long __res); - // uint64_t CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(long _arg); - // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_clone(long _orig); + // struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_ok(struct LDKChannelId o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_ok")] public static extern long CResult_ChannelIdAPIErrorZ_ok(long _o); + // struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_err(struct LDKAPIError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_err")] public static extern long CResult_ChannelIdAPIErrorZ_err(long _e); + // bool CResult_ChannelIdAPIErrorZ_is_ok(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_is_ok")] public static extern bool CResult_ChannelIdAPIErrorZ_is_ok(long _o); + // void CResult_ChannelIdAPIErrorZ_free(struct LDKCResult_ChannelIdAPIErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_free")] public static extern void CResult_ChannelIdAPIErrorZ_free(long __res); + // uint64_t CResult_ChannelIdAPIErrorZ_clone_ptr(LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_clone_ptr")] public static extern long CResult_ChannelIdAPIErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelIdAPIErrorZ CResult_ChannelIdAPIErrorZ_clone(const struct LDKCResult_ChannelIdAPIErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdAPIErrorZ_clone")] public static extern long CResult_ChannelIdAPIErrorZ_clone(long _orig); // void CVec_RecentPaymentDetailsZ_free(struct LDKCVec_RecentPaymentDetailsZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_RecentPaymentDetailsZ_free")] public static extern void CVec_RecentPaymentDetailsZ_free(long __res); // struct LDKCResult_NonePaymentSendFailureZ CResult_NonePaymentSendFailureZ_ok(void); @@ -3910,16 +4342,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone_ptr")] public static extern long CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone_ptr(long _arg); // struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(const struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone")] public static extern long CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_clone(long _orig); - // uint64_t C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr")] public static extern long C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(long _arg); - // struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(const struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_clone")] public static extern long C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(long _orig); - // struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ C2Tuple_ThirtyTwoBytesPublicKeyZ_new(struct LDKThirtyTwoBytes a, struct LDKPublicKey b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_new")] public static extern long C2Tuple_ThirtyTwoBytesPublicKeyZ_new(long _a, long _b); - // void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(struct LDKC2Tuple_ThirtyTwoBytesPublicKeyZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ThirtyTwoBytesPublicKeyZ_free")] public static extern void C2Tuple_ThirtyTwoBytesPublicKeyZ_free(long __res); - // void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free")] public static extern void CVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ_free(long __res); + // uint64_t C2Tuple_ChannelIdPublicKeyZ_clone_ptr(LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone_ptr")] public static extern long C2Tuple_ChannelIdPublicKeyZ_clone_ptr(long _arg); + // struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_clone(const struct LDKC2Tuple_ChannelIdPublicKeyZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ChannelIdPublicKeyZ_clone")] public static extern long C2Tuple_ChannelIdPublicKeyZ_clone(long _orig); + // struct LDKC2Tuple_ChannelIdPublicKeyZ C2Tuple_ChannelIdPublicKeyZ_new(struct LDKChannelId a, struct LDKPublicKey b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ChannelIdPublicKeyZ_new")] public static extern long C2Tuple_ChannelIdPublicKeyZ_new(long _a, long _b); + // void C2Tuple_ChannelIdPublicKeyZ_free(struct LDKC2Tuple_ChannelIdPublicKeyZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_ChannelIdPublicKeyZ_free")] public static extern void C2Tuple_ChannelIdPublicKeyZ_free(long __res); + // void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_ChannelIdPublicKeyZZ_free")] public static extern void CVec_C2Tuple_ChannelIdPublicKeyZZ_free(long __res); + // void CVec_ChannelIdZ_free(struct LDKCVec_ChannelIdZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_ChannelIdZ_free")] public static extern void CVec_ChannelIdZ_free(long __res); + // struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(struct LDKOfferWithDerivedMetadataBuilder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok")] public static extern long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err")] public static extern long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free")] public static extern void CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(const struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone")] public static extern long CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(long _orig); // struct LDKCOption_StrZ COption_StrZ_some(struct LDKStr o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_StrZ_some")] public static extern long COption_StrZ_some(long _o); // struct LDKCOption_StrZ COption_StrZ_none(void); @@ -3930,18 +4376,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_StrZ_clone_ptr")] public static extern long COption_StrZ_clone_ptr(long _arg); // struct LDKCOption_StrZ COption_StrZ_clone(const struct LDKCOption_StrZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_StrZ_clone")] public static extern long COption_StrZ_clone(long _orig); - // struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_ok(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_ok")] public static extern long CResult_NoneBolt12SemanticErrorZ_ok(); - // struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_err")] public static extern long CResult_NoneBolt12SemanticErrorZ_err(Bolt12SemanticError _e); - // bool CResult_NoneBolt12SemanticErrorZ_is_ok(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_NoneBolt12SemanticErrorZ_is_ok(long _o); - // void CResult_NoneBolt12SemanticErrorZ_free(struct LDKCResult_NoneBolt12SemanticErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_free")] public static extern void CResult_NoneBolt12SemanticErrorZ_free(long __res); - // uint64_t CResult_NoneBolt12SemanticErrorZ_clone_ptr(LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_NoneBolt12SemanticErrorZ_clone_ptr(long _arg); - // struct LDKCResult_NoneBolt12SemanticErrorZ CResult_NoneBolt12SemanticErrorZ_clone(const struct LDKCResult_NoneBolt12SemanticErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_NoneBolt12SemanticErrorZ_clone")] public static extern long CResult_NoneBolt12SemanticErrorZ_clone(long _orig); // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(struct LDKC2Tuple_ThirtyTwoBytesThirtyTwoBytesZ o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok")] public static extern long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(long _o); // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_err(void); @@ -3954,6 +4388,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone_ptr")] public static extern long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone_ptr(long _arg); // struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone")] public static extern long CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_clone(long _orig); + // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_ok(struct LDKThirtyTwoBytes o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_ok")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_ok(long _o); + // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_err(struct LDKAPIError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_err")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_err(long _e); + // bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_is_ok")] public static extern bool CResult_ThirtyTwoBytesAPIErrorZ_is_ok(long _o); + // void CResult_ThirtyTwoBytesAPIErrorZ_free(struct LDKCResult_ThirtyTwoBytesAPIErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_free")] public static extern void CResult_ThirtyTwoBytesAPIErrorZ_free(long __res); + // uint64_t CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ThirtyTwoBytesAPIErrorZ CResult_ThirtyTwoBytesAPIErrorZ_clone(const struct LDKCResult_ThirtyTwoBytesAPIErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ThirtyTwoBytesAPIErrorZ_clone")] public static extern long CResult_ThirtyTwoBytesAPIErrorZ_clone(long _orig); // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_some(struct LDKOffersMessage o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_OffersMessageZ_some")] public static extern long COption_OffersMessageZ_some(long _o); // struct LDKCOption_OffersMessageZ COption_OffersMessageZ_none(void); @@ -4228,8 +4674,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free")] public static extern void CVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ_free(long __res); // void CVec_CommitmentTransactionZ_free(struct LDKCVec_CommitmentTransactionZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_CommitmentTransactionZ_free")] public static extern void CVec_CommitmentTransactionZ_free(long __res); - // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TransactionZ_free")] public static extern void CVec_TransactionZ_free(long __res); // uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_u32TxOutZ_clone_ptr")] public static extern long C2Tuple_u32TxOutZ_clone_ptr(long _arg); // struct LDKC2Tuple_u32TxOutZ C2Tuple_u32TxOutZ_clone(const struct LDKC2Tuple_u32TxOutZ *NONNULL_PTR orig); @@ -4356,16 +4800,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SocketAddressZ_clone_ptr")] public static extern long COption_SocketAddressZ_clone_ptr(long _arg); // struct LDKCOption_SocketAddressZ COption_SocketAddressZ_clone(const struct LDKCOption_SocketAddressZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SocketAddressZ_clone")] public static extern long COption_SocketAddressZ_clone(long _orig); - // uint64_t C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr")] public static extern long C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(long _arg); - // struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(const struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_clone")] public static extern long C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(long _orig); - // struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ C2Tuple_PublicKeyCOption_SocketAddressZZ_new(struct LDKPublicKey a, struct LDKCOption_SocketAddressZ b); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_new")] public static extern long C2Tuple_PublicKeyCOption_SocketAddressZZ_new(long _a, long _b); - // void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(struct LDKC2Tuple_PublicKeyCOption_SocketAddressZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_PublicKeyCOption_SocketAddressZZ_free")] public static extern void C2Tuple_PublicKeyCOption_SocketAddressZZ_free(long __res); - // void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free")] public static extern void CVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ_free(long __res); + // void CVec_PeerDetailsZ_free(struct LDKCVec_PeerDetailsZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_PeerDetailsZ_free")] public static extern void CVec_PeerDetailsZ_free(long __res); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_ok(struct LDKCVec_u8Z o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_CVec_u8ZPeerHandleErrorZ_ok")] public static extern long CResult_CVec_u8ZPeerHandleErrorZ_ok(long _o); // struct LDKCResult_CVec_u8ZPeerHandleErrorZ CResult_CVec_u8ZPeerHandleErrorZ_err(struct LDKPeerHandleError e); @@ -4462,6 +4898,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone_ptr")] public static extern long CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone_ptr(long _arg); // struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(const struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone")] public static extern long CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_clone(long _orig); + // struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(struct LDKUnsignedInvoiceRequest o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok")] public static extern long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err")] public static extern long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free")] public static extern void CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone")] public static extern long CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(long _orig); + // struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_ok(struct LDKInvoiceRequest o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_ok")] public static extern long CResult_InvoiceRequestBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_err")] public static extern long CResult_InvoiceRequestBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_InvoiceRequestBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_free")] public static extern void CResult_InvoiceRequestBolt12SemanticErrorZ_free(long __res); + // uint64_t CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr")] public static extern long CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(long _arg); + // struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ CResult_InvoiceRequestBolt12SemanticErrorZ_clone(const struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestBolt12SemanticErrorZ_clone")] public static extern long CResult_InvoiceRequestBolt12SemanticErrorZ_clone(long _orig); // struct LDKCOption_SecretKeyZ COption_SecretKeyZ_some(struct LDKSecretKey o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SecretKeyZ_some")] public static extern long COption_SecretKeyZ_some(long _o); // struct LDKCOption_SecretKeyZ COption_SecretKeyZ_none(void); @@ -4472,6 +4932,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SecretKeyZ_clone_ptr")] public static extern long COption_SecretKeyZ_clone_ptr(long _arg); // struct LDKCOption_SecretKeyZ COption_SecretKeyZ_clone(const struct LDKCOption_SecretKeyZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_SecretKeyZ_clone")] public static extern long COption_SecretKeyZ_clone(long _orig); + // struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithExplicitSigningPubkeyBuilder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok")] public static extern long CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err")] public static extern long CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free")] public static extern void CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(long __res); // struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_ok(struct LDKVerifiedInvoiceRequest o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_ok")] public static extern long CResult_VerifiedInvoiceRequestNoneZ_ok(long _o); // struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_err(void); @@ -4484,6 +4952,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_clone_ptr")] public static extern long CResult_VerifiedInvoiceRequestNoneZ_clone_ptr(long _arg); // struct LDKCResult_VerifiedInvoiceRequestNoneZ CResult_VerifiedInvoiceRequestNoneZ_clone(const struct LDKCResult_VerifiedInvoiceRequestNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_VerifiedInvoiceRequestNoneZ_clone")] public static extern long CResult_VerifiedInvoiceRequestNoneZ_clone(long _orig); + // struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(struct LDKInvoiceWithDerivedSigningPubkeyBuilder o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok")] public static extern long CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(long _o); + // struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(enum LDKBolt12SemanticError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err")] public static extern long CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(Bolt12SemanticError _e); + // bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(const struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok")] public static extern bool CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(long _o); + // void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free")] public static extern void CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(long __res); + // struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_ok(struct LDKInvoiceRequestFields o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_ok")] public static extern long CResult_InvoiceRequestFieldsDecodeErrorZ_ok(long _o); + // struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_err")] public static extern long CResult_InvoiceRequestFieldsDecodeErrorZ_err(long _e); + // bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok")] public static extern bool CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(long _o); + // void CResult_InvoiceRequestFieldsDecodeErrorZ_free(struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_free")] public static extern void CResult_InvoiceRequestFieldsDecodeErrorZ_free(long __res); + // uint64_t CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr")] public static extern long CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ CResult_InvoiceRequestFieldsDecodeErrorZ_clone(const struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceRequestFieldsDecodeErrorZ_clone")] public static extern long CResult_InvoiceRequestFieldsDecodeErrorZ_clone(long _orig); // enum LDKCOption_NoneZ COption_NoneZ_some(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_some")] public static extern COption_NoneZ COption_NoneZ_some(); // enum LDKCOption_NoneZ COption_NoneZ_none(void); @@ -4492,6 +4980,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_NoneZ_free")] public static extern void COption_NoneZ_free(COption_NoneZ __res); // void CVec_WitnessZ_free(struct LDKCVec_WitnessZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_WitnessZ_free")] public static extern void CVec_WitnessZ_free(long __res); + // struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_some(struct LDKECDSASignature o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ECDSASignatureZ_some")] public static extern long COption_ECDSASignatureZ_some(long _o); + // struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ECDSASignatureZ_none")] public static extern long COption_ECDSASignatureZ_none(); + // void COption_ECDSASignatureZ_free(struct LDKCOption_ECDSASignatureZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ECDSASignatureZ_free")] public static extern void COption_ECDSASignatureZ_free(long __res); + // uint64_t COption_ECDSASignatureZ_clone_ptr(LDKCOption_ECDSASignatureZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ECDSASignatureZ_clone_ptr")] public static extern long COption_ECDSASignatureZ_clone_ptr(long _arg); + // struct LDKCOption_ECDSASignatureZ COption_ECDSASignatureZ_clone(const struct LDKCOption_ECDSASignatureZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_ECDSASignatureZ_clone")] public static extern long COption_ECDSASignatureZ_clone(long _orig); // struct LDKCOption_i64Z COption_i64Z_some(int64_t o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_i64Z_some")] public static extern long COption_i64Z_some(long _o); // struct LDKCOption_i64Z COption_i64Z_none(void); @@ -5350,6 +5848,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(long _arg); // struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ CResult_ShutdownScriptInvalidShutdownScriptZ_clone(const struct LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ShutdownScriptInvalidShutdownScriptZ_clone")] public static extern long CResult_ShutdownScriptInvalidShutdownScriptZ_clone(long _orig); + // void CVec_TransactionZ_free(struct LDKCVec_TransactionZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TransactionZ_free")] public static extern void CVec_TransactionZ_free(long __res); // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_ok(struct LDKPaymentPurpose o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentPurposeDecodeErrorZ_ok")] public static extern long CResult_PaymentPurposeDecodeErrorZ_ok(long _o); // struct LDKCResult_PaymentPurposeDecodeErrorZ CResult_PaymentPurposeDecodeErrorZ_err(struct LDKDecodeError e); @@ -5686,6 +6186,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone_ptr")] public static extern long CResult_UntrustedStringDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_UntrustedStringDecodeErrorZ CResult_UntrustedStringDecodeErrorZ_clone(const struct LDKCResult_UntrustedStringDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UntrustedStringDecodeErrorZ_clone")] public static extern long CResult_UntrustedStringDecodeErrorZ_clone(long _orig); + // struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_ok(struct LDKChannelId o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_ok")] public static extern long CResult_ChannelIdDecodeErrorZ_ok(long _o); + // struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_err")] public static extern long CResult_ChannelIdDecodeErrorZ_err(long _e); + // bool CResult_ChannelIdDecodeErrorZ_is_ok(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_is_ok")] public static extern bool CResult_ChannelIdDecodeErrorZ_is_ok(long _o); + // void CResult_ChannelIdDecodeErrorZ_free(struct LDKCResult_ChannelIdDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_free")] public static extern void CResult_ChannelIdDecodeErrorZ_free(long __res); + // uint64_t CResult_ChannelIdDecodeErrorZ_clone_ptr(LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_clone_ptr")] public static extern long CResult_ChannelIdDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_ChannelIdDecodeErrorZ CResult_ChannelIdDecodeErrorZ_clone(const struct LDKCResult_ChannelIdDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_ChannelIdDecodeErrorZ_clone")] public static extern long CResult_ChannelIdDecodeErrorZ_clone(long _orig); // uint64_t C2Tuple__u832u16Z_clone_ptr(LDKC2Tuple__u832u16Z *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple__u832u16Z_clone_ptr")] public static extern long C2Tuple__u832u16Z_clone_ptr(long _arg); // struct LDKC2Tuple__u832u16Z C2Tuple__u832u16Z_clone(const struct LDKC2Tuple__u832u16Z *NONNULL_PTR orig); @@ -5718,6 +6230,66 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentConstraintsDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_PaymentConstraintsDecodeErrorZ CResult_PaymentConstraintsDecodeErrorZ_clone(const struct LDKCResult_PaymentConstraintsDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentConstraintsDecodeErrorZ_clone")] public static extern long CResult_PaymentConstraintsDecodeErrorZ_clone(long _orig); + // struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_ok(struct LDKPaymentContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_ok")] public static extern long CResult_PaymentContextDecodeErrorZ_ok(long _o); + // struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_err")] public static extern long CResult_PaymentContextDecodeErrorZ_err(long _e); + // bool CResult_PaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_is_ok")] public static extern bool CResult_PaymentContextDecodeErrorZ_is_ok(long _o); + // void CResult_PaymentContextDecodeErrorZ_free(struct LDKCResult_PaymentContextDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_free")] public static extern void CResult_PaymentContextDecodeErrorZ_free(long __res); + // uint64_t CResult_PaymentContextDecodeErrorZ_clone_ptr(LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_clone_ptr")] public static extern long CResult_PaymentContextDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_PaymentContextDecodeErrorZ CResult_PaymentContextDecodeErrorZ_clone(const struct LDKCResult_PaymentContextDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PaymentContextDecodeErrorZ_clone")] public static extern long CResult_PaymentContextDecodeErrorZ_clone(long _orig); + // struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_ok(struct LDKUnknownPaymentContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_ok")] public static extern long CResult_UnknownPaymentContextDecodeErrorZ_ok(long _o); + // struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_err")] public static extern long CResult_UnknownPaymentContextDecodeErrorZ_err(long _e); + // bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_is_ok")] public static extern bool CResult_UnknownPaymentContextDecodeErrorZ_is_ok(long _o); + // void CResult_UnknownPaymentContextDecodeErrorZ_free(struct LDKCResult_UnknownPaymentContextDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_free")] public static extern void CResult_UnknownPaymentContextDecodeErrorZ_free(long __res); + // uint64_t CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr")] public static extern long CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_UnknownPaymentContextDecodeErrorZ CResult_UnknownPaymentContextDecodeErrorZ_clone(const struct LDKCResult_UnknownPaymentContextDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_UnknownPaymentContextDecodeErrorZ_clone")] public static extern long CResult_UnknownPaymentContextDecodeErrorZ_clone(long _orig); + // struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_ok(struct LDKBolt12OfferContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_ok")] public static extern long CResult_Bolt12OfferContextDecodeErrorZ_ok(long _o); + // struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_err")] public static extern long CResult_Bolt12OfferContextDecodeErrorZ_err(long _e); + // bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_is_ok")] public static extern bool CResult_Bolt12OfferContextDecodeErrorZ_is_ok(long _o); + // void CResult_Bolt12OfferContextDecodeErrorZ_free(struct LDKCResult_Bolt12OfferContextDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_free")] public static extern void CResult_Bolt12OfferContextDecodeErrorZ_free(long __res); + // uint64_t CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr")] public static extern long CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt12OfferContextDecodeErrorZ CResult_Bolt12OfferContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12OfferContextDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12OfferContextDecodeErrorZ_clone")] public static extern long CResult_Bolt12OfferContextDecodeErrorZ_clone(long _orig); + // struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_ok(struct LDKBolt12RefundContext o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_ok")] public static extern long CResult_Bolt12RefundContextDecodeErrorZ_ok(long _o); + // struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_err")] public static extern long CResult_Bolt12RefundContextDecodeErrorZ_err(long _e); + // bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_is_ok")] public static extern bool CResult_Bolt12RefundContextDecodeErrorZ_is_ok(long _o); + // void CResult_Bolt12RefundContextDecodeErrorZ_free(struct LDKCResult_Bolt12RefundContextDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_free")] public static extern void CResult_Bolt12RefundContextDecodeErrorZ_free(long __res); + // uint64_t CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr")] public static extern long CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_Bolt12RefundContextDecodeErrorZ CResult_Bolt12RefundContextDecodeErrorZ_clone(const struct LDKCResult_Bolt12RefundContextDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_Bolt12RefundContextDecodeErrorZ_clone")] public static extern long CResult_Bolt12RefundContextDecodeErrorZ_clone(long _orig); + // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_ok")] public static extern long CResult_StrSecp256k1ErrorZ_ok(long _o); + // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_err")] public static extern long CResult_StrSecp256k1ErrorZ_err(Secp256k1Error _e); + // bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_is_ok")] public static extern bool CResult_StrSecp256k1ErrorZ_is_ok(long _o); + // void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_free")] public static extern void CResult_StrSecp256k1ErrorZ_free(long __res); + // uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_clone_ptr")] public static extern long CResult_StrSecp256k1ErrorZ_clone_ptr(long _arg); + // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_clone")] public static extern long CResult_StrSecp256k1ErrorZ_clone(long _orig); // uint64_t C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr")] public static extern long C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone_ptr(long _arg); // struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_clone(const struct LDKC3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ *NONNULL_PTR orig); @@ -5738,18 +6310,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone_ptr(long _arg); // struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(const struct LDKCResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone")] public static extern long CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_clone(long _orig); - // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_ok(struct LDKStr o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_ok")] public static extern long CResult_StrSecp256k1ErrorZ_ok(long _o); - // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_err(enum LDKSecp256k1Error e); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_err")] public static extern long CResult_StrSecp256k1ErrorZ_err(Secp256k1Error _e); - // bool CResult_StrSecp256k1ErrorZ_is_ok(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_is_ok")] public static extern bool CResult_StrSecp256k1ErrorZ_is_ok(long _o); - // void CResult_StrSecp256k1ErrorZ_free(struct LDKCResult_StrSecp256k1ErrorZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_free")] public static extern void CResult_StrSecp256k1ErrorZ_free(long __res); - // uint64_t CResult_StrSecp256k1ErrorZ_clone_ptr(LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_clone_ptr")] public static extern long CResult_StrSecp256k1ErrorZ_clone_ptr(long _arg); - // struct LDKCResult_StrSecp256k1ErrorZ CResult_StrSecp256k1ErrorZ_clone(const struct LDKCResult_StrSecp256k1ErrorZ *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_StrSecp256k1ErrorZ_clone")] public static extern long CResult_StrSecp256k1ErrorZ_clone(long _orig); // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_ok(struct LDKTxOut o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TxOutUtxoLookupErrorZ_ok")] public static extern long CResult_TxOutUtxoLookupErrorZ_ok(long _o); // struct LDKCResult_TxOutUtxoLookupErrorZ CResult_TxOutUtxoLookupErrorZ_err(enum LDKUtxoLookupError e); @@ -5778,6 +6338,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok")] public static extern bool CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_is_ok(long _o); // void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free")] public static extern void CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_free(long __res); + // uint64_t CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr")] public static extern long CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(long _arg); + // struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(const struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone")] public static extern long CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(long _orig); // struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_ok(struct LDKPeeledOnion o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PeeledOnionNoneZ_ok")] public static extern long CResult_PeeledOnionNoneZ_ok(long _o); // struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_err(void); @@ -5786,6 +6350,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PeeledOnionNoneZ_is_ok")] public static extern bool CResult_PeeledOnionNoneZ_is_ok(long _o); // void CResult_PeeledOnionNoneZ_free(struct LDKCResult_PeeledOnionNoneZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PeeledOnionNoneZ_free")] public static extern void CResult_PeeledOnionNoneZ_free(long __res); + // uint64_t CResult_PeeledOnionNoneZ_clone_ptr(LDKCResult_PeeledOnionNoneZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PeeledOnionNoneZ_clone_ptr")] public static extern long CResult_PeeledOnionNoneZ_clone_ptr(long _arg); + // struct LDKCResult_PeeledOnionNoneZ CResult_PeeledOnionNoneZ_clone(const struct LDKCResult_PeeledOnionNoneZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_PeeledOnionNoneZ_clone")] public static extern long CResult_PeeledOnionNoneZ_clone(long _orig); // struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_ok(struct LDKSendSuccess o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_ok")] public static extern long CResult_SendSuccessSendErrorZ_ok(long _o); // struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_err(struct LDKSendError e); @@ -5794,6 +6362,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_is_ok")] public static extern bool CResult_SendSuccessSendErrorZ_is_ok(long _o); // void CResult_SendSuccessSendErrorZ_free(struct LDKCResult_SendSuccessSendErrorZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_free")] public static extern void CResult_SendSuccessSendErrorZ_free(long __res); + // uint64_t CResult_SendSuccessSendErrorZ_clone_ptr(LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_clone_ptr")] public static extern long CResult_SendSuccessSendErrorZ_clone_ptr(long _arg); + // struct LDKCResult_SendSuccessSendErrorZ CResult_SendSuccessSendErrorZ_clone(const struct LDKCResult_SendSuccessSendErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_SendSuccessSendErrorZ_clone")] public static extern long CResult_SendSuccessSendErrorZ_clone(long _orig); // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_ok(struct LDKBlindedPath o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_BlindedPathNoneZ_ok")] public static extern long CResult_BlindedPathNoneZ_ok(long _o); // struct LDKCResult_BlindedPathNoneZ CResult_BlindedPathNoneZ_err(void); @@ -5856,6 +6428,58 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone_ptr")] public static extern long CResult_InvoiceErrorDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_InvoiceErrorDecodeErrorZ CResult_InvoiceErrorDecodeErrorZ_clone(const struct LDKCResult_InvoiceErrorDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_InvoiceErrorDecodeErrorZ_clone")] public static extern long CResult_InvoiceErrorDecodeErrorZ_clone(long _orig); + // struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_ok(struct LDKTrackedSpendableOutput o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_ok")] public static extern long CResult_TrackedSpendableOutputDecodeErrorZ_ok(long _o); + // struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_err")] public static extern long CResult_TrackedSpendableOutputDecodeErrorZ_err(long _e); + // bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_is_ok")] public static extern bool CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(long _o); + // void CResult_TrackedSpendableOutputDecodeErrorZ_free(struct LDKCResult_TrackedSpendableOutputDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_free")] public static extern void CResult_TrackedSpendableOutputDecodeErrorZ_free(long __res); + // uint64_t CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr")] public static extern long CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_TrackedSpendableOutputDecodeErrorZ CResult_TrackedSpendableOutputDecodeErrorZ_clone(const struct LDKCResult_TrackedSpendableOutputDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_TrackedSpendableOutputDecodeErrorZ_clone")] public static extern long CResult_TrackedSpendableOutputDecodeErrorZ_clone(long _orig); + // struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_ok(struct LDKOutputSpendStatus o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_ok")] public static extern long CResult_OutputSpendStatusDecodeErrorZ_ok(long _o); + // struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_err")] public static extern long CResult_OutputSpendStatusDecodeErrorZ_err(long _e); + // bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_is_ok")] public static extern bool CResult_OutputSpendStatusDecodeErrorZ_is_ok(long _o); + // void CResult_OutputSpendStatusDecodeErrorZ_free(struct LDKCResult_OutputSpendStatusDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_free")] public static extern void CResult_OutputSpendStatusDecodeErrorZ_free(long __res); + // uint64_t CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone_ptr")] public static extern long CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(long _arg); + // struct LDKCResult_OutputSpendStatusDecodeErrorZ CResult_OutputSpendStatusDecodeErrorZ_clone(const struct LDKCResult_OutputSpendStatusDecodeErrorZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSpendStatusDecodeErrorZ_clone")] public static extern long CResult_OutputSpendStatusDecodeErrorZ_clone(long _orig); + // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_some")] public static extern long COption_FilterZ_some(long _o); + // struct LDKCOption_FilterZ COption_FilterZ_none(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_none")] public static extern long COption_FilterZ_none(); + // void COption_FilterZ_free(struct LDKCOption_FilterZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_free")] public static extern void COption_FilterZ_free(long __res); + // void CVec_TrackedSpendableOutputZ_free(struct LDKCVec_TrackedSpendableOutputZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_TrackedSpendableOutputZ_free")] public static extern void CVec_TrackedSpendableOutputZ_free(long __res); + // struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_ok(struct LDKOutputSweeper o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSweeperDecodeErrorZ_ok")] public static extern long CResult_OutputSweeperDecodeErrorZ_ok(long _o); + // struct LDKCResult_OutputSweeperDecodeErrorZ CResult_OutputSweeperDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSweeperDecodeErrorZ_err")] public static extern long CResult_OutputSweeperDecodeErrorZ_err(long _e); + // bool CResult_OutputSweeperDecodeErrorZ_is_ok(const struct LDKCResult_OutputSweeperDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSweeperDecodeErrorZ_is_ok")] public static extern bool CResult_OutputSweeperDecodeErrorZ_is_ok(long _o); + // void CResult_OutputSweeperDecodeErrorZ_free(struct LDKCResult_OutputSweeperDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_OutputSweeperDecodeErrorZ_free")] public static extern void CResult_OutputSweeperDecodeErrorZ_free(long __res); + // struct LDKC2Tuple_BestBlockOutputSweeperZ C2Tuple_BestBlockOutputSweeperZ_new(struct LDKBestBlock a, struct LDKOutputSweeper b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BestBlockOutputSweeperZ_new")] public static extern long C2Tuple_BestBlockOutputSweeperZ_new(long _a, long _b); + // void C2Tuple_BestBlockOutputSweeperZ_free(struct LDKC2Tuple_BestBlockOutputSweeperZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BestBlockOutputSweeperZ_free")] public static extern void C2Tuple_BestBlockOutputSweeperZ_free(long __res); + // struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(struct LDKC2Tuple_BestBlockOutputSweeperZ o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok")] public static extern long CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(long _o); + // struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(struct LDKDecodeError e); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err")] public static extern long CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(long _e); + // bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(const struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok")] public static extern bool CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(long _o); + // void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free")] public static extern void CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(long __res); // struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_ok(struct LDKDelayedPaymentBasepoint o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_DelayedPaymentBasepointDecodeErrorZ_ok")] public static extern long CResult_DelayedPaymentBasepointDecodeErrorZ_ok(long _o); // struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ CResult_DelayedPaymentBasepointDecodeErrorZ_err(struct LDKDecodeError e); @@ -5928,12 +6552,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationKeyDecodeErrorZ_clone_ptr")] public static extern long CResult_RevocationKeyDecodeErrorZ_clone_ptr(long _arg); // struct LDKCResult_RevocationKeyDecodeErrorZ CResult_RevocationKeyDecodeErrorZ_clone(const struct LDKCResult_RevocationKeyDecodeErrorZ *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_RevocationKeyDecodeErrorZ_clone")] public static extern long CResult_RevocationKeyDecodeErrorZ_clone(long _orig); - // struct LDKCOption_FilterZ COption_FilterZ_some(struct LDKFilter o); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_some")] public static extern long COption_FilterZ_some(long _o); - // struct LDKCOption_FilterZ COption_FilterZ_none(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_none")] public static extern long COption_FilterZ_none(); - // void COption_FilterZ_free(struct LDKCOption_FilterZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_COption_FilterZ_free")] public static extern void COption_FilterZ_free(long __res); // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_ok(struct LDKLockedChannelMonitor o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_ok")] public static extern long CResult_LockedChannelMonitorNoneZ_ok(long _o); // struct LDKCResult_LockedChannelMonitorNoneZ CResult_LockedChannelMonitorNoneZ_err(void); @@ -5942,8 +6560,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_is_ok")] public static extern bool CResult_LockedChannelMonitorNoneZ_is_ok(long _o); // void CResult_LockedChannelMonitorNoneZ_free(struct LDKCResult_LockedChannelMonitorNoneZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CResult_LockedChannelMonitorNoneZ_free")] public static extern void CResult_LockedChannelMonitorNoneZ_free(long __res); - // void CVec_OutPointZ_free(struct LDKCVec_OutPointZ _res); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_OutPointZ_free")] public static extern void CVec_OutPointZ_free(long __res); + // uint64_t C2Tuple_OutPointChannelIdZ_clone_ptr(LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointChannelIdZ_clone_ptr")] public static extern long C2Tuple_OutPointChannelIdZ_clone_ptr(long _arg); + // struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_clone(const struct LDKC2Tuple_OutPointChannelIdZ *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointChannelIdZ_clone")] public static extern long C2Tuple_OutPointChannelIdZ_clone(long _orig); + // struct LDKC2Tuple_OutPointChannelIdZ C2Tuple_OutPointChannelIdZ_new(struct LDKOutPoint a, struct LDKChannelId b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointChannelIdZ_new")] public static extern long C2Tuple_OutPointChannelIdZ_new(long _a, long _b); + // void C2Tuple_OutPointChannelIdZ_free(struct LDKC2Tuple_OutPointChannelIdZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_OutPointChannelIdZ_free")] public static extern void C2Tuple_OutPointChannelIdZ_free(long __res); + // void CVec_C2Tuple_OutPointChannelIdZZ_free(struct LDKCVec_C2Tuple_OutPointChannelIdZZ _res); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_C2Tuple_OutPointChannelIdZZ_free")] public static extern void CVec_C2Tuple_OutPointChannelIdZZ_free(long __res); // void CVec_MonitorUpdateIdZ_free(struct LDKCVec_MonitorUpdateIdZ _res); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CVec_MonitorUpdateIdZ_free")] public static extern void CVec_MonitorUpdateIdZ_free(long __res); // uint64_t C2Tuple_OutPointCVec_MonitorUpdateIdZZ_clone_ptr(LDKC2Tuple_OutPointCVec_MonitorUpdateIdZZ *NONNULL_PTR arg); @@ -6030,6 +6656,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_new")] public static extern long TransactionU16LenLimited_new(long _transaction); // MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_into_transaction(struct LDKTransactionU16LenLimited this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_into_transaction")] public static extern long TransactionU16LenLimited_into_transaction(long _this_arg); + // MUST_USE_RES struct LDKTransaction TransactionU16LenLimited_as_transaction(const struct LDKTransactionU16LenLimited *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_as_transaction")] public static extern long TransactionU16LenLimited_as_transaction(long _this_arg); // struct LDKCVec_u8Z TransactionU16LenLimited_write(const struct LDKTransactionU16LenLimited *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TransactionU16LenLimited_write")] public static extern long TransactionU16LenLimited_write(long _obj); // struct LDKCResult_TransactionU16LenLimitedDecodeErrorZ TransactionU16LenLimited_read(struct LDKu8slice ser); @@ -6060,6 +6688,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_cleanup_stale_updates")] public static extern long MonitorUpdatingPersister_cleanup_stale_updates(long _this_arg, bool _lazy); // struct LDKPersist MonitorUpdatingPersister_as_Persist(const struct LDKMonitorUpdatingPersister *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorUpdatingPersister_as_Persist")] public static extern long MonitorUpdatingPersister_as_Persist(long _this_arg); + // enum LDKShortChannelIdError ShortChannelIdError_clone(const enum LDKShortChannelIdError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShortChannelIdError_clone")] public static extern ShortChannelIdError ShortChannelIdError_clone(long _orig); + // enum LDKShortChannelIdError ShortChannelIdError_block_overflow(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShortChannelIdError_block_overflow")] public static extern ShortChannelIdError ShortChannelIdError_block_overflow(); + // enum LDKShortChannelIdError ShortChannelIdError_tx_index_overflow(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShortChannelIdError_tx_index_overflow")] public static extern ShortChannelIdError ShortChannelIdError_tx_index_overflow(); + // enum LDKShortChannelIdError ShortChannelIdError_vout_index_overflow(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShortChannelIdError_vout_index_overflow")] public static extern ShortChannelIdError ShortChannelIdError_vout_index_overflow(); + // bool ShortChannelIdError_eq(const enum LDKShortChannelIdError *NONNULL_PTR a, const enum LDKShortChannelIdError *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShortChannelIdError_eq")] public static extern bool ShortChannelIdError_eq(long _a, long _b); + // uint32_t block_from_scid(uint64_t short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_block_from_scid")] public static extern int block_from_scid(long _short_channel_id); + // uint32_t tx_index_from_scid(uint64_t short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_tx_index_from_scid")] public static extern int tx_index_from_scid(long _short_channel_id); + // uint16_t vout_from_scid(uint64_t short_channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_vout_from_scid")] public static extern short vout_from_scid(long _short_channel_id); + // struct LDKCResult_u64ShortChannelIdErrorZ scid_from_parts(uint64_t block, uint64_t tx_index, uint64_t vout_index); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_scid_from_parts")] public static extern long scid_from_parts(long _block, long _tx_index, long _vout_index); // void UntrustedString_free(struct LDKUntrustedString this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UntrustedString_free")] public static extern void UntrustedString_free(long _this_obj); // struct LDKStr UntrustedString_get_a(const struct LDKUntrustedString *NONNULL_PTR this_ptr); @@ -6088,25 +6734,95 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_set_a")] public static extern void PrintableString_set_a(long _this_ptr, long _val); // MUST_USE_RES struct LDKPrintableString PrintableString_new(struct LDKStr a_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PrintableString_new")] public static extern long PrintableString_new(long _a_arg); + // void TrackedSpendableOutput_free(struct LDKTrackedSpendableOutput this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_free")] public static extern void TrackedSpendableOutput_free(long _this_obj); + // struct LDKSpendableOutputDescriptor TrackedSpendableOutput_get_descriptor(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_get_descriptor")] public static extern long TrackedSpendableOutput_get_descriptor(long _this_ptr); + // void TrackedSpendableOutput_set_descriptor(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKSpendableOutputDescriptor val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_set_descriptor")] public static extern void TrackedSpendableOutput_set_descriptor(long _this_ptr, long _val); + // struct LDKChannelId TrackedSpendableOutput_get_channel_id(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_get_channel_id")] public static extern long TrackedSpendableOutput_get_channel_id(long _this_ptr); + // void TrackedSpendableOutput_set_channel_id(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKChannelId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_set_channel_id")] public static extern void TrackedSpendableOutput_set_channel_id(long _this_ptr, long _val); + // struct LDKOutputSpendStatus TrackedSpendableOutput_get_status(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_get_status")] public static extern long TrackedSpendableOutput_get_status(long _this_ptr); + // void TrackedSpendableOutput_set_status(struct LDKTrackedSpendableOutput *NONNULL_PTR this_ptr, struct LDKOutputSpendStatus val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_set_status")] public static extern void TrackedSpendableOutput_set_status(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTrackedSpendableOutput TrackedSpendableOutput_new(struct LDKSpendableOutputDescriptor descriptor_arg, struct LDKChannelId channel_id_arg, struct LDKOutputSpendStatus status_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_new")] public static extern long TrackedSpendableOutput_new(long _descriptor_arg, long _channel_id_arg, long _status_arg); + // uint64_t TrackedSpendableOutput_clone_ptr(LDKTrackedSpendableOutput *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_clone_ptr")] public static extern long TrackedSpendableOutput_clone_ptr(long _arg); + // struct LDKTrackedSpendableOutput TrackedSpendableOutput_clone(const struct LDKTrackedSpendableOutput *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_clone")] public static extern long TrackedSpendableOutput_clone(long _orig); + // bool TrackedSpendableOutput_eq(const struct LDKTrackedSpendableOutput *NONNULL_PTR a, const struct LDKTrackedSpendableOutput *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_eq")] public static extern bool TrackedSpendableOutput_eq(long _a, long _b); + // MUST_USE_RES bool TrackedSpendableOutput_is_spent_in(const struct LDKTrackedSpendableOutput *NONNULL_PTR this_arg, struct LDKTransaction tx); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_is_spent_in")] public static extern bool TrackedSpendableOutput_is_spent_in(long _this_arg, long _tx); + // struct LDKCVec_u8Z TrackedSpendableOutput_write(const struct LDKTrackedSpendableOutput *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_write")] public static extern long TrackedSpendableOutput_write(long _obj); + // struct LDKCResult_TrackedSpendableOutputDecodeErrorZ TrackedSpendableOutput_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrackedSpendableOutput_read")] public static extern long TrackedSpendableOutput_read(long _ser); + // void OutputSpendStatus_free(struct LDKOutputSpendStatus this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_free")] public static extern void OutputSpendStatus_free(long _this_ptr); + // uint64_t OutputSpendStatus_clone_ptr(LDKOutputSpendStatus *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_clone_ptr")] public static extern long OutputSpendStatus_clone_ptr(long _arg); + // struct LDKOutputSpendStatus OutputSpendStatus_clone(const struct LDKOutputSpendStatus *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_clone")] public static extern long OutputSpendStatus_clone(long _orig); + // struct LDKOutputSpendStatus OutputSpendStatus_pending_initial_broadcast(struct LDKCOption_u32Z delayed_until_height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_pending_initial_broadcast")] public static extern long OutputSpendStatus_pending_initial_broadcast(long _delayed_until_height); + // struct LDKOutputSpendStatus OutputSpendStatus_pending_first_confirmation(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_pending_first_confirmation")] public static extern long OutputSpendStatus_pending_first_confirmation(long _first_broadcast_hash, int _latest_broadcast_height, long _latest_spending_tx); + // struct LDKOutputSpendStatus OutputSpendStatus_pending_threshold_confirmations(struct LDKThirtyTwoBytes first_broadcast_hash, uint32_t latest_broadcast_height, struct LDKTransaction latest_spending_tx, uint32_t confirmation_height, struct LDKThirtyTwoBytes confirmation_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_pending_threshold_confirmations")] public static extern long OutputSpendStatus_pending_threshold_confirmations(long _first_broadcast_hash, int _latest_broadcast_height, long _latest_spending_tx, int _confirmation_height, long _confirmation_hash); + // bool OutputSpendStatus_eq(const struct LDKOutputSpendStatus *NONNULL_PTR a, const struct LDKOutputSpendStatus *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_eq")] public static extern bool OutputSpendStatus_eq(long _a, long _b); + // struct LDKCVec_u8Z OutputSpendStatus_write(const struct LDKOutputSpendStatus *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_write")] public static extern long OutputSpendStatus_write(long _obj); + // struct LDKCResult_OutputSpendStatusDecodeErrorZ OutputSpendStatus_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpendStatus_read")] public static extern long OutputSpendStatus_read(long _ser); + // void OutputSweeper_free(struct LDKOutputSweeper this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_free")] public static extern void OutputSweeper_free(long _this_obj); + // MUST_USE_RES struct LDKOutputSweeper OutputSweeper_new(struct LDKBestBlock best_block, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, struct LDKCOption_FilterZ chain_data_source, struct LDKOutputSpender output_spender, struct LDKChangeDestinationSource change_destination_source, struct LDKKVStore kv_store, struct LDKLogger logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_new")] public static extern long OutputSweeper_new(long _best_block, long _broadcaster, long _fee_estimator, long _chain_data_source, long _output_spender, long _change_destination_source, long _kv_store, long _logger); + // MUST_USE_RES struct LDKCResult_NoneNoneZ OutputSweeper_track_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ output_descriptors, struct LDKChannelId channel_id, bool exclude_static_outputs, struct LDKCOption_u32Z delay_until_height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_track_spendable_outputs")] public static extern long OutputSweeper_track_spendable_outputs(long _this_arg, long _output_descriptors, long _channel_id, bool _exclude_static_outputs, long _delay_until_height); + // MUST_USE_RES struct LDKCVec_TrackedSpendableOutputZ OutputSweeper_tracked_spendable_outputs(const struct LDKOutputSweeper *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_tracked_spendable_outputs")] public static extern long OutputSweeper_tracked_spendable_outputs(long _this_arg); + // MUST_USE_RES struct LDKBestBlock OutputSweeper_current_best_block(const struct LDKOutputSweeper *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_current_best_block")] public static extern long OutputSweeper_current_best_block(long _this_arg); + // struct LDKListen OutputSweeper_as_Listen(const struct LDKOutputSweeper *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_as_Listen")] public static extern long OutputSweeper_as_Listen(long _this_arg); + // struct LDKConfirm OutputSweeper_as_Confirm(const struct LDKOutputSweeper *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_as_Confirm")] public static extern long OutputSweeper_as_Confirm(long _this_arg); + // void SpendingDelay_free(struct LDKSpendingDelay this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendingDelay_free")] public static extern void SpendingDelay_free(long _this_ptr); + // uint64_t SpendingDelay_clone_ptr(LDKSpendingDelay *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendingDelay_clone_ptr")] public static extern long SpendingDelay_clone_ptr(long _arg); + // struct LDKSpendingDelay SpendingDelay_clone(const struct LDKSpendingDelay *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendingDelay_clone")] public static extern long SpendingDelay_clone(long _orig); + // struct LDKSpendingDelay SpendingDelay_relative(uint32_t num_blocks); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendingDelay_relative")] public static extern long SpendingDelay_relative(int _num_blocks); + // struct LDKSpendingDelay SpendingDelay_absolute(uint32_t height); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpendingDelay_absolute")] public static extern long SpendingDelay_absolute(int _height); + // struct LDKCResult_OutputSweeperDecodeErrorZ OutputSweeper_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSweeper_read")] public static extern long OutputSweeper_read(long _ser, long _arg_a, long _arg_b, long _arg_c, long _arg_d, long _arg_e, long _arg_f, long _arg_g); + // struct LDKCResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(struct LDKu8slice ser, struct LDKBroadcasterInterface arg_a, struct LDKFeeEstimator arg_b, struct LDKCOption_FilterZ arg_c, struct LDKOutputSpender arg_d, struct LDKChangeDestinationSource arg_e, struct LDKKVStore arg_f, struct LDKLogger arg_g); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_C2Tuple_BestBlockOutputSweeperZ_read")] public static extern long C2Tuple_BestBlockOutputSweeperZ_read(long _ser, long _arg_a, long _arg_b, long _arg_c, long _arg_d, long _arg_e, long _arg_f, long _arg_g); // void FutureCallback_free(struct LDKFutureCallback this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FutureCallback_free")] public static extern void FutureCallback_free(long _this_ptr); // void Future_free(struct LDKFuture this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_free")] public static extern void Future_free(long _this_obj); - // uint64_t Future_clone_ptr(LDKFuture *NONNULL_PTR arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_clone_ptr")] public static extern long Future_clone_ptr(long _arg); - // struct LDKFuture Future_clone(const struct LDKFuture *NONNULL_PTR orig); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_clone")] public static extern long Future_clone(long _orig); // void Future_register_callback_fn(const struct LDKFuture *NONNULL_PTR this_arg, struct LDKFutureCallback callback); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_register_callback_fn")] public static extern void Future_register_callback_fn(long _this_arg, long _callback); - // void Future_wait(struct LDKFuture this_arg); + // void Future_wait(const struct LDKFuture *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_wait")] public static extern void Future_wait(long _this_arg); - // MUST_USE_RES bool Future_wait_timeout(struct LDKFuture this_arg, uint64_t max_wait); + // MUST_USE_RES bool Future_wait_timeout(const struct LDKFuture *NONNULL_PTR this_arg, uint64_t max_wait); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Future_wait_timeout")] public static extern bool Future_wait_timeout(long _this_arg, long _max_wait); // void Sleeper_free(struct LDKSleeper this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_free")] public static extern void Sleeper_free(long _this_obj); - // MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(struct LDKFuture future); + // MUST_USE_RES struct LDKSleeper Sleeper_from_single_future(const struct LDKFuture *NONNULL_PTR future); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_from_single_future")] public static extern long Sleeper_from_single_future(long _future); - // MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(struct LDKFuture fut_a, struct LDKFuture fut_b); + // MUST_USE_RES struct LDKSleeper Sleeper_from_two_futures(const struct LDKFuture *NONNULL_PTR fut_a, const struct LDKFuture *NONNULL_PTR fut_b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_from_two_futures")] public static extern long Sleeper_from_two_futures(long _fut_a, long _fut_b); // MUST_USE_RES struct LDKSleeper Sleeper_new(struct LDKCVec_FutureZ futures); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Sleeper_new")] public static extern long Sleeper_new(long _futures); @@ -6144,9 +6860,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_get_peer_id")] public static extern long Record_get_peer_id(long _this_ptr); // void Record_set_peer_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_set_peer_id")] public static extern void Record_set_peer_id(long _this_ptr, long _val); - // struct LDKCOption_ThirtyTwoBytesZ Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr); + // struct LDKChannelId Record_get_channel_id(const struct LDKRecord *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_get_channel_id")] public static extern long Record_get_channel_id(long _this_ptr); - // void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); + // void Record_set_channel_id(struct LDKRecord *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_set_channel_id")] public static extern void Record_set_channel_id(long _this_ptr, long _val); // struct LDKStr Record_get_args(const struct LDKRecord *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_get_args")] public static extern long Record_get_args(long _this_ptr); @@ -6164,7 +6880,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_get_line")] public static extern int Record_get_line(long _this_ptr); // void Record_set_line(struct LDKRecord *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_set_line")] public static extern void Record_set_line(long _this_ptr, int _val); - // MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKCOption_ThirtyTwoBytesZ channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg); + // MUST_USE_RES struct LDKRecord Record_new(enum LDKLevel level_arg, struct LDKPublicKey peer_id_arg, struct LDKChannelId channel_id_arg, struct LDKStr args_arg, struct LDKStr module_path_arg, struct LDKStr file_arg, uint32_t line_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_new")] public static extern long Record_new(Level _level_arg, long _peer_id_arg, long _channel_id_arg, long _args_arg, long _module_path_arg, long _file_arg, int _line_arg); // uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Record_clone_ptr")] public static extern long Record_clone_ptr(long _arg); @@ -6400,20 +7116,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UserConfig_default")] public static extern long UserConfig_default(); // void BestBlock_free(struct LDKBestBlock this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_free")] public static extern void BestBlock_free(long _this_obj); + // const uint8_t (*BestBlock_get_block_hash(const struct LDKBestBlock *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_get_block_hash")] public static extern long BestBlock_get_block_hash(long _this_ptr); + // void BestBlock_set_block_hash(struct LDKBestBlock *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_set_block_hash")] public static extern void BestBlock_set_block_hash(long _this_ptr, long _val); + // uint32_t BestBlock_get_height(const struct LDKBestBlock *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_get_height")] public static extern int BestBlock_get_height(long _this_ptr); + // void BestBlock_set_height(struct LDKBestBlock *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_set_height")] public static extern void BestBlock_set_height(long _this_ptr, int _val); + // MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash_arg, uint32_t height_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_new")] public static extern long BestBlock_new(long _block_hash_arg, int _height_arg); // uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_clone_ptr")] public static extern long BestBlock_clone_ptr(long _arg); // struct LDKBestBlock BestBlock_clone(const struct LDKBestBlock *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_clone")] public static extern long BestBlock_clone(long _orig); + // uint64_t BestBlock_hash(const struct LDKBestBlock *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_hash")] public static extern long BestBlock_hash(long _o); // bool BestBlock_eq(const struct LDKBestBlock *NONNULL_PTR a, const struct LDKBestBlock *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_eq")] public static extern bool BestBlock_eq(long _a, long _b); // MUST_USE_RES struct LDKBestBlock BestBlock_from_network(enum LDKNetwork network); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_from_network")] public static extern long BestBlock_from_network(Network _network); - // MUST_USE_RES struct LDKBestBlock BestBlock_new(struct LDKThirtyTwoBytes block_hash, uint32_t height); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_new")] public static extern long BestBlock_new(long _block_hash, int _height); - // MUST_USE_RES struct LDKThirtyTwoBytes BestBlock_block_hash(const struct LDKBestBlock *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_block_hash")] public static extern long BestBlock_block_hash(long _this_arg); - // MUST_USE_RES uint32_t BestBlock_height(const struct LDKBestBlock *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_height")] public static extern int BestBlock_height(long _this_arg); + // struct LDKCVec_u8Z BestBlock_write(const struct LDKBestBlock *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_write")] public static extern long BestBlock_write(long _obj); + // struct LDKCResult_BestBlockDecodeErrorZ BestBlock_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BestBlock_read")] public static extern long BestBlock_read(long _ser); // void Listen_free(struct LDKListen this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Listen_free")] public static extern void Listen_free(long _this_ptr); // void Confirm_free(struct LDKConfirm this_ptr); @@ -6472,6 +7198,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_non_anchor_channel_fee")] public static extern ConfirmationTarget ConfirmationTarget_non_anchor_channel_fee(); // enum LDKConfirmationTarget ConfirmationTarget_channel_close_minimum(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_channel_close_minimum")] public static extern ConfirmationTarget ConfirmationTarget_channel_close_minimum(); + // enum LDKConfirmationTarget ConfirmationTarget_output_spending_fee(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_output_spending_fee")] public static extern ConfirmationTarget ConfirmationTarget_output_spending_fee(); // uint64_t ConfirmationTarget_hash(const enum LDKConfirmationTarget *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ConfirmationTarget_hash")] public static extern long ConfirmationTarget_hash(long _o); // bool ConfirmationTarget_eq(const enum LDKConfirmationTarget *NONNULL_PTR a, const enum LDKConfirmationTarget *NONNULL_PTR b); @@ -6500,7 +7228,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_claimable_balances")] public static extern long ChainMonitor_get_claimable_balances(long _this_arg, long _ignored_channels); // MUST_USE_RES struct LDKCResult_LockedChannelMonitorNoneZ ChainMonitor_get_monitor(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint funding_txo); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_monitor")] public static extern long ChainMonitor_get_monitor(long _this_arg, long _funding_txo); - // MUST_USE_RES struct LDKCVec_OutPointZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointChannelIdZZ ChainMonitor_list_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_list_monitors")] public static extern long ChainMonitor_list_monitors(long _this_arg); // MUST_USE_RES struct LDKCVec_C2Tuple_OutPointCVec_MonitorUpdateIdZZZ ChainMonitor_list_pending_monitor_updates(const struct LDKChainMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_list_pending_monitor_updates")] public static extern long ChainMonitor_list_pending_monitor_updates(long _this_arg); @@ -6510,6 +7238,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_get_update_future")] public static extern long ChainMonitor_get_update_future(long _this_arg); // void ChainMonitor_rebroadcast_pending_claims(const struct LDKChainMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_rebroadcast_pending_claims")] public static extern void ChainMonitor_rebroadcast_pending_claims(long _this_arg); + // void ChainMonitor_signer_unblocked(const struct LDKChainMonitor *NONNULL_PTR this_arg, struct LDKOutPoint monitor_opt); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_signer_unblocked")] public static extern void ChainMonitor_signer_unblocked(long _this_arg, long _monitor_opt); + // void ChainMonitor_archive_fully_resolved_channel_monitors(const struct LDKChainMonitor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_archive_fully_resolved_channel_monitors")] public static extern void ChainMonitor_archive_fully_resolved_channel_monitors(long _this_arg); // struct LDKListen ChainMonitor_as_Listen(const struct LDKChainMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChainMonitor_as_Listen")] public static extern long ChainMonitor_as_Listen(long _this_arg); // struct LDKConfirm ChainMonitor_as_Confirm(const struct LDKChainMonitor *NONNULL_PTR this_arg); @@ -6524,6 +7256,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_get_update_id")] public static extern long ChannelMonitorUpdate_get_update_id(long _this_ptr); // void ChannelMonitorUpdate_set_update_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_set_update_id")] public static extern void ChannelMonitorUpdate_set_update_id(long _this_ptr, long _val); + // struct LDKChannelId ChannelMonitorUpdate_get_channel_id(const struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_get_channel_id")] public static extern long ChannelMonitorUpdate_get_channel_id(long _this_ptr); + // void ChannelMonitorUpdate_set_channel_id(struct LDKChannelMonitorUpdate *NONNULL_PTR this_ptr, struct LDKChannelId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_set_channel_id")] public static extern void ChannelMonitorUpdate_set_channel_id(long _this_ptr, long _val); // uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitorUpdate_clone_ptr")] public static extern long ChannelMonitorUpdate_clone_ptr(long _arg); // struct LDKChannelMonitorUpdate ChannelMonitorUpdate_clone(const struct LDKChannelMonitorUpdate *NONNULL_PTR orig); @@ -6542,10 +7278,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_clone")] public static extern long MonitorEvent_clone(long _orig); // struct LDKMonitorEvent MonitorEvent_htlcevent(struct LDKHTLCUpdate a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_htlcevent")] public static extern long MonitorEvent_htlcevent(long _a); + // struct LDKMonitorEvent MonitorEvent_holder_force_closed_with_info(struct LDKClosureReason reason, struct LDKOutPoint outpoint, struct LDKChannelId channel_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_holder_force_closed_with_info")] public static extern long MonitorEvent_holder_force_closed_with_info(long _reason, long _outpoint, long _channel_id); // struct LDKMonitorEvent MonitorEvent_holder_force_closed(struct LDKOutPoint a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_holder_force_closed")] public static extern long MonitorEvent_holder_force_closed(long _a); - // struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, uint64_t monitor_update_id); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_completed")] public static extern long MonitorEvent_completed(long _funding_txo, long _monitor_update_id); + // struct LDKMonitorEvent MonitorEvent_completed(struct LDKOutPoint funding_txo, struct LDKChannelId channel_id, uint64_t monitor_update_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_completed")] public static extern long MonitorEvent_completed(long _funding_txo, long _channel_id, long _monitor_update_id); // bool MonitorEvent_eq(const struct LDKMonitorEvent *NONNULL_PTR a, const struct LDKMonitorEvent *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_MonitorEvent_eq")] public static extern bool MonitorEvent_eq(long _a, long _b); // struct LDKCVec_u8Z MonitorEvent_write(const struct LDKMonitorEvent *NONNULL_PTR obj); @@ -6600,6 +7338,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_latest_update_id")] public static extern long ChannelMonitor_get_latest_update_id(long _this_arg); // MUST_USE_RES struct LDKC2Tuple_OutPointCVec_u8ZZ ChannelMonitor_get_funding_txo(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_funding_txo")] public static extern long ChannelMonitor_get_funding_txo(long _this_arg); + // MUST_USE_RES struct LDKChannelId ChannelMonitor_channel_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_channel_id")] public static extern long ChannelMonitor_channel_id(long _this_arg); // MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZZ ChannelMonitor_get_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_outputs_to_watch")] public static extern long ChannelMonitor_get_outputs_to_watch(long _this_arg); // void ChannelMonitor_load_outputs_to_watch(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKFilter *NONNULL_PTR filter, const struct LDKLogger *NONNULL_PTR logger); @@ -6616,8 +7356,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_sign_to_local_justice_tx")] public static extern long ChannelMonitor_sign_to_local_justice_tx(long _this_arg, long _justice_tx, long _input_idx, long _value, long _commitment_number); // MUST_USE_RES struct LDKPublicKey ChannelMonitor_get_counterparty_node_id(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_counterparty_node_id")] public static extern long ChannelMonitor_get_counterparty_node_id(long _this_arg); - // MUST_USE_RES struct LDKCVec_TransactionZ ChannelMonitor_get_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_latest_holder_commitment_txn")] public static extern long ChannelMonitor_get_latest_holder_commitment_txn(long _this_arg, long _logger); + // void ChannelMonitor_broadcast_latest_holder_commitment_txn(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKBroadcasterInterface *NONNULL_PTR broadcaster, const struct LDKFeeEstimator *NONNULL_PTR fee_estimator, const struct LDKLogger *NONNULL_PTR logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_broadcast_latest_holder_commitment_txn")] public static extern void ChannelMonitor_broadcast_latest_holder_commitment_txn(long _this_arg, long _broadcaster, long _fee_estimator, long _logger); // MUST_USE_RES struct LDKCVec_C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZZ ChannelMonitor_block_connected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], struct LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_block_connected")] public static extern long ChannelMonitor_block_connected(long _this_arg, long _header, long _txdata, int _height, long _broadcaster, long _fee_estimator, long _logger); // void ChannelMonitor_block_disconnected(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const uint8_t (*header)[80], uint32_t height, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger); @@ -6634,8 +7374,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_current_best_block")] public static extern long ChannelMonitor_current_best_block(long _this_arg); // void ChannelMonitor_rebroadcast_pending_claims(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_rebroadcast_pending_claims")] public static extern void ChannelMonitor_rebroadcast_pending_claims(long _this_arg, long _broadcaster, long _fee_estimator, long _logger); + // void ChannelMonitor_signer_unblocked(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKBroadcasterInterface broadcaster, struct LDKFeeEstimator fee_estimator, const struct LDKLogger *NONNULL_PTR logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_signer_unblocked")] public static extern void ChannelMonitor_signer_unblocked(long _this_arg, long _broadcaster, long _fee_estimator, long _logger); // MUST_USE_RES struct LDKCVec_SpendableOutputDescriptorZ ChannelMonitor_get_spendable_outputs(const struct LDKChannelMonitor *NONNULL_PTR this_arg, struct LDKTransaction tx, uint32_t confirmation_height); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_spendable_outputs")] public static extern long ChannelMonitor_get_spendable_outputs(long _this_arg, long _tx, int _confirmation_height); + // MUST_USE_RES bool ChannelMonitor_is_fully_resolved(const struct LDKChannelMonitor *NONNULL_PTR this_arg, const struct LDKLogger *NONNULL_PTR logger); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_is_fully_resolved")] public static extern bool ChannelMonitor_is_fully_resolved(long _this_arg, long _logger); // MUST_USE_RES struct LDKCVec_BalanceZ ChannelMonitor_get_claimable_balances(const struct LDKChannelMonitor *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelMonitor_get_claimable_balances")] public static extern long ChannelMonitor_get_claimable_balances(long _this_arg); // struct LDKCResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelMonitorZ_read(struct LDKu8slice ser, const struct LDKEntropySource *NONNULL_PTR arg_a, const struct LDKSignerProvider *NONNULL_PTR arg_b); @@ -6660,8 +7404,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_eq")] public static extern bool OutPoint_eq(long _a, long _b); // uint64_t OutPoint_hash(const struct LDKOutPoint *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_hash")] public static extern long OutPoint_hash(long _o); - // MUST_USE_RES struct LDKThirtyTwoBytes OutPoint_to_channel_id(const struct LDKOutPoint *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_to_channel_id")] public static extern long OutPoint_to_channel_id(long _this_arg); // struct LDKCVec_u8Z OutPoint_write(const struct LDKOutPoint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutPoint_write")] public static extern long OutPoint_write(long _obj); // struct LDKCResult_OutPointDecodeErrorZ OutPoint_read(struct LDKu8slice ser); @@ -6682,6 +7424,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCErr_set_msg")] public static extern void InboundHTLCErr_set_msg(long _this_ptr, long _val); // MUST_USE_RES struct LDKInboundHTLCErr InboundHTLCErr_new(uint16_t err_code_arg, struct LDKCVec_u8Z err_data_arg, struct LDKStr msg_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCErr_new")] public static extern long InboundHTLCErr_new(short _err_code_arg, long _err_data_arg, long _msg_arg); + // uint64_t InboundHTLCErr_clone_ptr(LDKInboundHTLCErr *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCErr_clone_ptr")] public static extern long InboundHTLCErr_clone_ptr(long _arg); + // struct LDKInboundHTLCErr InboundHTLCErr_clone(const struct LDKInboundHTLCErr *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCErr_clone")] public static extern long InboundHTLCErr_clone(long _orig); + // uint64_t InboundHTLCErr_hash(const struct LDKInboundHTLCErr *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCErr_hash")] public static extern long InboundHTLCErr_hash(long _o); + // bool InboundHTLCErr_eq(const struct LDKInboundHTLCErr *NONNULL_PTR a, const struct LDKInboundHTLCErr *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InboundHTLCErr_eq")] public static extern bool InboundHTLCErr_eq(long _a, long _b); // struct LDKCResult_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(const struct LDKUpdateAddHTLC *NONNULL_PTR msg, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKLogger *NONNULL_PTR logger, uint32_t cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_peel_payment_onion")] public static extern long peel_payment_onion(long _msg, long _node_signer, long _logger, int _cur_height, bool _accept_mpp_keysend, bool _allow_skimmed_fees); // void PendingHTLCRouting_free(struct LDKPendingHTLCRouting this_ptr); @@ -6692,10 +7442,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_clone")] public static extern long PendingHTLCRouting_clone(long _orig); // struct LDKPendingHTLCRouting PendingHTLCRouting_forward(struct LDKOnionPacket onion_packet, uint64_t short_channel_id, struct LDKBlindedForward blinded); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_forward")] public static extern long PendingHTLCRouting_forward(long _onion_packet, long _short_channel_id, long _blinded); - // struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_receive")] public static extern long PendingHTLCRouting_receive(long _payment_data, long _payment_metadata, int _incoming_cltv_expiry, long _phantom_shared_secret, long _custom_tlvs, bool _requires_blinded_error); - // struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_receive_keysend")] public static extern long PendingHTLCRouting_receive_keysend(long _payment_data, long _payment_preimage, long _payment_metadata, int _incoming_cltv_expiry, long _custom_tlvs); + // struct LDKPendingHTLCRouting PendingHTLCRouting_receive(struct LDKFinalOnionHopData payment_data, struct LDKCOption_CVec_u8ZZ payment_metadata, struct LDKCOption_PaymentContextZ payment_context, uint32_t incoming_cltv_expiry, struct LDKThirtyTwoBytes phantom_shared_secret, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_receive")] public static extern long PendingHTLCRouting_receive(long _payment_data, long _payment_metadata, long _payment_context, int _incoming_cltv_expiry, long _phantom_shared_secret, long _custom_tlvs, bool _requires_blinded_error); + // struct LDKPendingHTLCRouting PendingHTLCRouting_receive_keysend(struct LDKFinalOnionHopData payment_data, struct LDKThirtyTwoBytes payment_preimage, struct LDKCOption_CVec_u8ZZ payment_metadata, uint32_t incoming_cltv_expiry, struct LDKCVec_C2Tuple_u64CVec_u8ZZZ custom_tlvs, bool requires_blinded_error); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PendingHTLCRouting_receive_keysend")] public static extern long PendingHTLCRouting_receive_keysend(long _payment_data, long _payment_preimage, long _payment_metadata, int _incoming_cltv_expiry, long _custom_tlvs, bool _requires_blinded_error); // void BlindedForward_free(struct LDKBlindedForward this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedForward_free")] public static extern void BlindedForward_free(long _this_obj); // struct LDKPublicKey BlindedForward_get_inbound_blinding_point(const struct LDKBlindedForward *NONNULL_PTR this_ptr); @@ -6848,9 +7598,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelCounterparty_clone")] public static extern long ChannelCounterparty_clone(long _orig); // void ChannelDetails_free(struct LDKChannelDetails this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_free")] public static extern void ChannelDetails_free(long _this_obj); - // const uint8_t (*ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId ChannelDetails_get_channel_id(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_channel_id")] public static extern long ChannelDetails_get_channel_id(long _this_ptr); - // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void ChannelDetails_set_channel_id(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_channel_id")] public static extern void ChannelDetails_set_channel_id(long _this_ptr, long _val); // struct LDKChannelCounterparty ChannelDetails_get_counterparty(const struct LDKChannelDetails *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_counterparty")] public static extern long ChannelDetails_get_counterparty(long _this_ptr); @@ -6956,8 +7706,6 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_get_config")] public static extern long ChannelDetails_get_config(long _this_ptr); // void ChannelDetails_set_config(struct LDKChannelDetails *NONNULL_PTR this_ptr, struct LDKChannelConfig val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_set_config")] public static extern void ChannelDetails_set_config(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelDetails ChannelDetails_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKChannelCounterparty counterparty_arg, struct LDKOutPoint funding_txo_arg, struct LDKChannelTypeFeatures channel_type_arg, struct LDKCOption_u64Z short_channel_id_arg, struct LDKCOption_u64Z outbound_scid_alias_arg, struct LDKCOption_u64Z inbound_scid_alias_arg, uint64_t channel_value_satoshis_arg, struct LDKCOption_u64Z unspendable_punishment_reserve_arg, struct LDKU128 user_channel_id_arg, struct LDKCOption_u32Z feerate_sat_per_1000_weight_arg, uint64_t balance_msat_arg, uint64_t outbound_capacity_msat_arg, uint64_t next_outbound_htlc_limit_msat_arg, uint64_t next_outbound_htlc_minimum_msat_arg, uint64_t inbound_capacity_msat_arg, struct LDKCOption_u32Z confirmations_required_arg, struct LDKCOption_u32Z confirmations_arg, struct LDKCOption_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, struct LDKCOption_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, struct LDKCOption_u64Z inbound_htlc_minimum_msat_arg, struct LDKCOption_u64Z inbound_htlc_maximum_msat_arg, struct LDKChannelConfig config_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_new")] public static extern long ChannelDetails_new(long _channel_id_arg, long _counterparty_arg, long _funding_txo_arg, long _channel_type_arg, long _short_channel_id_arg, long _outbound_scid_alias_arg, long _inbound_scid_alias_arg, long _channel_value_satoshis_arg, long _unspendable_punishment_reserve_arg, long _user_channel_id_arg, long _feerate_sat_per_1000_weight_arg, long _balance_msat_arg, long _outbound_capacity_msat_arg, long _next_outbound_htlc_limit_msat_arg, long _next_outbound_htlc_minimum_msat_arg, long _inbound_capacity_msat_arg, long _confirmations_required_arg, long _confirmations_arg, long _force_close_spend_delay_arg, bool _is_outbound_arg, bool _is_channel_ready_arg, long _channel_shutdown_state_arg, bool _is_usable_arg, bool _is_public_arg, long _inbound_htlc_minimum_msat_arg, long _inbound_htlc_maximum_msat_arg, long _config_arg); // uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelDetails_clone_ptr")] public static extern long ChannelDetails_clone_ptr(long _arg); // struct LDKChannelDetails ChannelDetails_clone(const struct LDKChannelDetails *NONNULL_PTR orig); @@ -7018,7 +7766,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_new")] public static extern long ChannelManager_new(long _fee_est, long _chain_monitor, long _tx_broadcaster, long _router, long _logger, long _entropy_source, long _node_signer, long _signer_provider, long _config, long _params, int _current_timestamp); // MUST_USE_RES struct LDKUserConfig ChannelManager_get_current_default_configuration(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_current_default_configuration")] public static extern long ChannelManager_get_current_default_configuration(long _this_arg); - // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKCOption_ThirtyTwoBytesZ temporary_channel_id, struct LDKUserConfig override_config); + // MUST_USE_RES struct LDKCResult_ChannelIdAPIErrorZ ChannelManager_create_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey their_network_key, uint64_t channel_value_satoshis, uint64_t push_msat, struct LDKU128 user_channel_id, struct LDKChannelId temporary_channel_id, struct LDKUserConfig override_config); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_channel")] public static extern long ChannelManager_create_channel(long _this_arg, long _their_network_key, long _channel_value_satoshis, long _push_msat, long _user_channel_id, long _temporary_channel_id, long _override_config); // MUST_USE_RES struct LDKCVec_ChannelDetailsZ ChannelManager_list_channels(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_channels")] public static extern long ChannelManager_list_channels(long _this_arg); @@ -7028,13 +7776,13 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_channels_with_counterparty")] public static extern long ChannelManager_list_channels_with_counterparty(long _this_arg, long _counterparty_node_id); // MUST_USE_RES struct LDKCVec_RecentPaymentDetailsZ ChannelManager_list_recent_payments(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_list_recent_payments")] public static extern long ChannelManager_list_recent_payments(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_close_channel")] public static extern long ChannelManager_close_channel(long _this_arg, long _channel_id, long _counterparty_node_id); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_close_channel_with_feerate_and_script(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u32Z target_feerate_sats_per_1000_weight, struct LDKShutdownScript shutdown_script); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_close_channel_with_feerate_and_script")] public static extern long ChannelManager_close_channel_with_feerate_and_script(long _this_arg, long _channel_id, long _counterparty_node_id, long _target_feerate_sats_per_1000_weight, long _shutdown_script); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_broadcasting_latest_txn")] public static extern long ChannelManager_force_close_broadcasting_latest_txn(long _this_arg, long _channel_id, long _counterparty_node_id); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*channel_id)[32], struct LDKPublicKey counterparty_node_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_force_close_without_broadcasting_txn(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR channel_id, struct LDKPublicKey counterparty_node_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_without_broadcasting_txn")] public static extern long ChannelManager_force_close_without_broadcasting_txn(long _this_arg, long _channel_id, long _counterparty_node_id); // void ChannelManager_force_close_all_channels_broadcasting_latest_txn(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_force_close_all_channels_broadcasting_latest_txn")] public static extern void ChannelManager_force_close_all_channels_broadcasting_latest_txn(long _this_arg); @@ -7056,15 +7804,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_spontaneous_preflight_probes")] public static extern long ChannelManager_send_spontaneous_preflight_probes(long _this_arg, long _node_id, long _amount_msat, int _final_cltv_expiry_delta, long _liquidity_limit_multiplier); // MUST_USE_RES struct LDKCResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ChannelManager_send_preflight_probes(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKRouteParameters route_params, struct LDKCOption_u64Z liquidity_limit_multiplier); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_send_preflight_probes")] public static extern long ChannelManager_send_preflight_probes(long _this_arg, long _route_params, long _liquidity_limit_multiplier); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKTransaction funding_transaction); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_funding_transaction_generated")] public static extern long ChannelManager_funding_transaction_generated(long _this_arg, long _temporary_channel_id, long _counterparty_node_id, long _funding_transaction); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ThirtyTwoBytesPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_batch_funding_transaction_generated(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_ChannelIdPublicKeyZZ temporary_channels, struct LDKTransaction funding_transaction); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_batch_funding_transaction_generated")] public static extern long ChannelManager_batch_funding_transaction_generated(long _this_arg, long _temporary_channels, long _funding_transaction); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_partial_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfigUpdate *NONNULL_PTR config_update); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_update_partial_channel_config")] public static extern long ChannelManager_update_partial_channel_config(long _this_arg, long _counterparty_node_id, long _channel_ids, long _config_update); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ThirtyTwoBytesZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_update_channel_config(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKPublicKey counterparty_node_id, struct LDKCVec_ChannelIdZ channel_ids, const struct LDKChannelConfig *NONNULL_PTR config); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_update_channel_config")] public static extern long ChannelManager_update_channel_config(long _this_arg, long _counterparty_node_id, long _channel_ids, long _config); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const uint8_t (*next_hop_channel_id)[32], struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_forward_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id, const struct LDKChannelId *NONNULL_PTR next_hop_channel_id, struct LDKPublicKey next_node_id, uint64_t amt_to_forward_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_forward_intercepted_htlc")] public static extern long ChannelManager_forward_intercepted_htlc(long _this_arg, long _intercept_id, long _next_hop_channel_id, long _next_node_id, long _amt_to_forward_msat); // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_fail_intercepted_htlc(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes intercept_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_fail_intercepted_htlc")] public static extern long ChannelManager_fail_intercepted_htlc(long _this_arg, long _intercept_id); @@ -7082,13 +7830,17 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_claim_funds_with_known_custom_tlvs")] public static extern void ChannelManager_claim_funds_with_known_custom_tlvs(long _this_arg, long _payment_preimage); // MUST_USE_RES struct LDKPublicKey ChannelManager_get_our_node_id(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_get_our_node_id")] public static extern long ChannelManager_get_our_node_id(long _this_arg); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_accept_inbound_channel")] public static extern long ChannelManager_accept_inbound_channel(long _this_arg, long _temporary_channel_id, long _counterparty_node_id, long _user_channel_id); - // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const uint8_t (*temporary_channel_id)[32], struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); + // MUST_USE_RES struct LDKCResult_NoneAPIErrorZ ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKChannelId *NONNULL_PTR temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKU128 user_channel_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_accept_inbound_channel_from_trusted_peer_0conf")] public static extern long ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(long _this_arg, long _temporary_channel_id, long _counterparty_node_id, long _user_channel_id); + // MUST_USE_RES struct LDKCResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_offer_builder(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_offer_builder")] public static extern long ChannelManager_create_offer_builder(long _this_arg); + // MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ChannelManager_create_refund_builder(const struct LDKChannelManager *NONNULL_PTR this_arg, uint64_t amount_msats, uint64_t absolute_expiry, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_refund_builder")] public static extern long ChannelManager_create_refund_builder(long _this_arg, long _amount_msats, long _absolute_expiry, long _payment_id, long _retry_strategy, long _max_total_routing_fee_msat); // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_pay_for_offer(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKOffer *NONNULL_PTR offer, struct LDKCOption_u64Z quantity, struct LDKCOption_u64Z amount_msats, struct LDKCOption_StrZ payer_note, struct LDKThirtyTwoBytes payment_id, struct LDKRetry retry_strategy, struct LDKCOption_u64Z max_total_routing_fee_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_pay_for_offer")] public static extern long ChannelManager_pay_for_offer(long _this_arg, long _offer, long _quantity, long _amount_msats, long _payer_note, long _payment_id, long _retry_strategy, long _max_total_routing_fee_msat); - // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund); + // MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ ChannelManager_request_refund_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, const struct LDKRefund *NONNULL_PTR refund); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_request_refund_payment")] public static extern long ChannelManager_request_refund_payment(long _this_arg, long _refund); // MUST_USE_RES struct LDKCResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ChannelManager_create_inbound_payment(const struct LDKChannelManager *NONNULL_PTR this_arg, struct LDKCOption_u64Z min_value_msat, uint32_t invoice_expiry_delta_secs, struct LDKCOption_u16Z min_final_cltv_expiry_delta); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_create_inbound_payment")] public static extern long ChannelManager_create_inbound_payment(long _this_arg, long _min_value_msat, int _invoice_expiry_delta_secs, long _min_final_cltv_expiry_delta); @@ -7130,6 +7882,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_ChannelMessageHandler")] public static extern long ChannelManager_as_ChannelMessageHandler(long _this_arg); // struct LDKOffersMessageHandler ChannelManager_as_OffersMessageHandler(const struct LDKChannelManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_OffersMessageHandler")] public static extern long ChannelManager_as_OffersMessageHandler(long _this_arg); + // struct LDKNodeIdLookUp ChannelManager_as_NodeIdLookUp(const struct LDKChannelManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelManager_as_NodeIdLookUp")] public static extern long ChannelManager_as_NodeIdLookUp(long _this_arg); // struct LDKInitFeatures provided_init_features(const struct LDKUserConfig *NONNULL_PTR config); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_provided_init_features")] public static extern long provided_init_features(long _config); // struct LDKCVec_u8Z CounterpartyForwardingInfo_write(const struct LDKCounterpartyForwardingInfo *NONNULL_PTR obj); @@ -7230,6 +7984,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentBasepoint_hash")] public static extern long DelayedPaymentBasepoint_hash(long _o); // MUST_USE_RES struct LDKPublicKey DelayedPaymentBasepoint_to_public_key(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentBasepoint_to_public_key")] public static extern long DelayedPaymentBasepoint_to_public_key(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes DelayedPaymentBasepoint_derive_add_tweak(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentBasepoint_derive_add_tweak")] public static extern long DelayedPaymentBasepoint_derive_add_tweak(long _this_arg, long _per_commitment_point); // struct LDKCVec_u8Z DelayedPaymentBasepoint_write(const struct LDKDelayedPaymentBasepoint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentBasepoint_write")] public static extern long DelayedPaymentBasepoint_write(long _obj); // struct LDKCResult_DelayedPaymentBasepointDecodeErrorZ DelayedPaymentBasepoint_read(struct LDKu8slice ser); @@ -7276,6 +8032,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HtlcBasepoint_hash")] public static extern long HtlcBasepoint_hash(long _o); // MUST_USE_RES struct LDKPublicKey HtlcBasepoint_to_public_key(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HtlcBasepoint_to_public_key")] public static extern long HtlcBasepoint_to_public_key(long _this_arg); + // MUST_USE_RES struct LDKThirtyTwoBytes HtlcBasepoint_derive_add_tweak(const struct LDKHtlcBasepoint *NONNULL_PTR this_arg, struct LDKPublicKey per_commitment_point); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HtlcBasepoint_derive_add_tweak")] public static extern long HtlcBasepoint_derive_add_tweak(long _this_arg, long _per_commitment_point); // struct LDKCVec_u8Z HtlcBasepoint_write(const struct LDKHtlcBasepoint *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HtlcBasepoint_write")] public static extern long HtlcBasepoint_write(long _obj); // struct LDKCResult_HtlcBasepointDecodeErrorZ HtlcBasepoint_read(struct LDKu8slice ser); @@ -7304,6 +8062,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HtlcKey_write")] public static extern long HtlcKey_write(long _obj); // struct LDKCResult_HtlcKeyDecodeErrorZ HtlcKey_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HtlcKey_read")] public static extern long HtlcKey_read(long _ser); + // struct LDKPublicKey add_public_key_tweak(struct LDKPublicKey base_point, const uint8_t (*tweak)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_add_public_key_tweak")] public static extern long add_public_key_tweak(long _base_point, long _tweak); // void RevocationBasepoint_free(struct LDKRevocationBasepoint this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevocationBasepoint_free")] public static extern void RevocationBasepoint_free(long _this_obj); // struct LDKPublicKey RevocationBasepoint_get_a(const struct LDKRevocationBasepoint *NONNULL_PTR this_ptr); @@ -7378,6 +8138,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DecodeError_io")] public static extern long DecodeError_io(IOError _a); // struct LDKDecodeError DecodeError_unsupported_compression(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DecodeError_unsupported_compression")] public static extern long DecodeError_unsupported_compression(); + // struct LDKDecodeError DecodeError_dangerous_value(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DecodeError_dangerous_value")] public static extern long DecodeError_dangerous_value(); // uint64_t DecodeError_hash(const struct LDKDecodeError *NONNULL_PTR o); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DecodeError_hash")] public static extern long DecodeError_hash(long _o); // bool DecodeError_eq(const struct LDKDecodeError *NONNULL_PTR a, const struct LDKDecodeError *NONNULL_PTR b); @@ -7408,15 +8170,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Init_eq")] public static extern bool Init_eq(long _a, long _b); // void ErrorMessage_free(struct LDKErrorMessage this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_free")] public static extern void ErrorMessage_free(long _this_obj); - // const uint8_t (*ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId ErrorMessage_get_channel_id(const struct LDKErrorMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_get_channel_id")] public static extern long ErrorMessage_get_channel_id(long _this_ptr); - // void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void ErrorMessage_set_channel_id(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_set_channel_id")] public static extern void ErrorMessage_set_channel_id(long _this_ptr, long _val); // struct LDKStr ErrorMessage_get_data(const struct LDKErrorMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_get_data")] public static extern long ErrorMessage_get_data(long _this_ptr); // void ErrorMessage_set_data(struct LDKErrorMessage *NONNULL_PTR this_ptr, struct LDKStr val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_set_data")] public static extern void ErrorMessage_set_data(long _this_ptr, long _val); - // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg); + // MUST_USE_RES struct LDKErrorMessage ErrorMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_new")] public static extern long ErrorMessage_new(long _channel_id_arg, long _data_arg); // uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_clone_ptr")] public static extern long ErrorMessage_clone_ptr(long _arg); @@ -7428,15 +8190,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ErrorMessage_eq")] public static extern bool ErrorMessage_eq(long _a, long _b); // void WarningMessage_free(struct LDKWarningMessage this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_free")] public static extern void WarningMessage_free(long _this_obj); - // const uint8_t (*WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId WarningMessage_get_channel_id(const struct LDKWarningMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_get_channel_id")] public static extern long WarningMessage_get_channel_id(long _this_ptr); - // void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void WarningMessage_set_channel_id(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_set_channel_id")] public static extern void WarningMessage_set_channel_id(long _this_ptr, long _val); // struct LDKStr WarningMessage_get_data(const struct LDKWarningMessage *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_get_data")] public static extern long WarningMessage_get_data(long _this_ptr); // void WarningMessage_set_data(struct LDKWarningMessage *NONNULL_PTR this_ptr, struct LDKStr val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_set_data")] public static extern void WarningMessage_set_data(long _this_ptr, long _val); - // MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKStr data_arg); + // MUST_USE_RES struct LDKWarningMessage WarningMessage_new(struct LDKChannelId channel_id_arg, struct LDKStr data_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_new")] public static extern long WarningMessage_new(long _channel_id_arg, long _data_arg); // uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_WarningMessage_clone_ptr")] public static extern long WarningMessage_clone_ptr(long _arg); @@ -7482,90 +8244,106 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Pong_hash")] public static extern long Pong_hash(long _o); // bool Pong_eq(const struct LDKPong *NONNULL_PTR a, const struct LDKPong *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Pong_eq")] public static extern bool Pong_eq(long _a, long _b); + // void CommonOpenChannelFields_free(struct LDKCommonOpenChannelFields this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_free")] public static extern void CommonOpenChannelFields_free(long _this_obj); + // const uint8_t (*CommonOpenChannelFields_get_chain_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_chain_hash")] public static extern long CommonOpenChannelFields_get_chain_hash(long _this_ptr); + // void CommonOpenChannelFields_set_chain_hash(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_chain_hash")] public static extern void CommonOpenChannelFields_set_chain_hash(long _this_ptr, long _val); + // struct LDKChannelId CommonOpenChannelFields_get_temporary_channel_id(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_temporary_channel_id")] public static extern long CommonOpenChannelFields_get_temporary_channel_id(long _this_ptr); + // void CommonOpenChannelFields_set_temporary_channel_id(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_temporary_channel_id")] public static extern void CommonOpenChannelFields_set_temporary_channel_id(long _this_ptr, long _val); + // uint64_t CommonOpenChannelFields_get_funding_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_funding_satoshis")] public static extern long CommonOpenChannelFields_get_funding_satoshis(long _this_ptr); + // void CommonOpenChannelFields_set_funding_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_funding_satoshis")] public static extern void CommonOpenChannelFields_set_funding_satoshis(long _this_ptr, long _val); + // uint64_t CommonOpenChannelFields_get_dust_limit_satoshis(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_dust_limit_satoshis")] public static extern long CommonOpenChannelFields_get_dust_limit_satoshis(long _this_ptr); + // void CommonOpenChannelFields_set_dust_limit_satoshis(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_dust_limit_satoshis")] public static extern void CommonOpenChannelFields_set_dust_limit_satoshis(long _this_ptr, long _val); + // uint64_t CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_max_htlc_value_in_flight_msat")] public static extern long CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(long _this_ptr); + // void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_max_htlc_value_in_flight_msat")] public static extern void CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); + // uint64_t CommonOpenChannelFields_get_htlc_minimum_msat(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_htlc_minimum_msat")] public static extern long CommonOpenChannelFields_get_htlc_minimum_msat(long _this_ptr); + // void CommonOpenChannelFields_set_htlc_minimum_msat(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_htlc_minimum_msat")] public static extern void CommonOpenChannelFields_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint32_t CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight")] public static extern int CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(long _this_ptr); + // void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight")] public static extern void CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(long _this_ptr, int _val); + // uint16_t CommonOpenChannelFields_get_to_self_delay(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_to_self_delay")] public static extern short CommonOpenChannelFields_get_to_self_delay(long _this_ptr); + // void CommonOpenChannelFields_set_to_self_delay(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_to_self_delay")] public static extern void CommonOpenChannelFields_set_to_self_delay(long _this_ptr, short _val); + // uint16_t CommonOpenChannelFields_get_max_accepted_htlcs(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_max_accepted_htlcs")] public static extern short CommonOpenChannelFields_get_max_accepted_htlcs(long _this_ptr); + // void CommonOpenChannelFields_set_max_accepted_htlcs(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_max_accepted_htlcs")] public static extern void CommonOpenChannelFields_set_max_accepted_htlcs(long _this_ptr, short _val); + // struct LDKPublicKey CommonOpenChannelFields_get_funding_pubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_funding_pubkey")] public static extern long CommonOpenChannelFields_get_funding_pubkey(long _this_ptr); + // void CommonOpenChannelFields_set_funding_pubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_funding_pubkey")] public static extern void CommonOpenChannelFields_set_funding_pubkey(long _this_ptr, long _val); + // struct LDKPublicKey CommonOpenChannelFields_get_revocation_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_revocation_basepoint")] public static extern long CommonOpenChannelFields_get_revocation_basepoint(long _this_ptr); + // void CommonOpenChannelFields_set_revocation_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_revocation_basepoint")] public static extern void CommonOpenChannelFields_set_revocation_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonOpenChannelFields_get_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_payment_basepoint")] public static extern long CommonOpenChannelFields_get_payment_basepoint(long _this_ptr); + // void CommonOpenChannelFields_set_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_payment_basepoint")] public static extern void CommonOpenChannelFields_set_payment_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonOpenChannelFields_get_delayed_payment_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_delayed_payment_basepoint")] public static extern long CommonOpenChannelFields_get_delayed_payment_basepoint(long _this_ptr); + // void CommonOpenChannelFields_set_delayed_payment_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_delayed_payment_basepoint")] public static extern void CommonOpenChannelFields_set_delayed_payment_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonOpenChannelFields_get_htlc_basepoint(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_htlc_basepoint")] public static extern long CommonOpenChannelFields_get_htlc_basepoint(long _this_ptr); + // void CommonOpenChannelFields_set_htlc_basepoint(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_htlc_basepoint")] public static extern void CommonOpenChannelFields_set_htlc_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonOpenChannelFields_get_first_per_commitment_point(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_first_per_commitment_point")] public static extern long CommonOpenChannelFields_get_first_per_commitment_point(long _this_ptr); + // void CommonOpenChannelFields_set_first_per_commitment_point(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_first_per_commitment_point")] public static extern void CommonOpenChannelFields_set_first_per_commitment_point(long _this_ptr, long _val); + // uint8_t CommonOpenChannelFields_get_channel_flags(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_channel_flags")] public static extern byte CommonOpenChannelFields_get_channel_flags(long _this_ptr); + // void CommonOpenChannelFields_set_channel_flags(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, uint8_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_channel_flags")] public static extern void CommonOpenChannelFields_set_channel_flags(long _this_ptr, byte _val); + // struct LDKCOption_CVec_u8ZZ CommonOpenChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_shutdown_scriptpubkey")] public static extern long CommonOpenChannelFields_get_shutdown_scriptpubkey(long _this_ptr); + // void CommonOpenChannelFields_set_shutdown_scriptpubkey(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_shutdown_scriptpubkey")] public static extern void CommonOpenChannelFields_set_shutdown_scriptpubkey(long _this_ptr, long _val); + // struct LDKChannelTypeFeatures CommonOpenChannelFields_get_channel_type(const struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_get_channel_type")] public static extern long CommonOpenChannelFields_get_channel_type(long _this_ptr); + // void CommonOpenChannelFields_set_channel_type(struct LDKCommonOpenChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_set_channel_type")] public static extern void CommonOpenChannelFields_set_channel_type(long _this_ptr, long _val); + // MUST_USE_RES struct LDKCommonOpenChannelFields CommonOpenChannelFields_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKChannelId temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_new")] public static extern long CommonOpenChannelFields_new(long _chain_hash_arg, long _temporary_channel_id_arg, long _funding_satoshis_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _htlc_minimum_msat_arg, int _commitment_feerate_sat_per_1000_weight_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, long _funding_pubkey_arg, long _revocation_basepoint_arg, long _payment_basepoint_arg, long _delayed_payment_basepoint_arg, long _htlc_basepoint_arg, long _first_per_commitment_point_arg, byte _channel_flags_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg); + // uint64_t CommonOpenChannelFields_clone_ptr(LDKCommonOpenChannelFields *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_clone_ptr")] public static extern long CommonOpenChannelFields_clone_ptr(long _arg); + // struct LDKCommonOpenChannelFields CommonOpenChannelFields_clone(const struct LDKCommonOpenChannelFields *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_clone")] public static extern long CommonOpenChannelFields_clone(long _orig); + // uint64_t CommonOpenChannelFields_hash(const struct LDKCommonOpenChannelFields *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_hash")] public static extern long CommonOpenChannelFields_hash(long _o); + // bool CommonOpenChannelFields_eq(const struct LDKCommonOpenChannelFields *NONNULL_PTR a, const struct LDKCommonOpenChannelFields *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonOpenChannelFields_eq")] public static extern bool CommonOpenChannelFields_eq(long _a, long _b); // void OpenChannel_free(struct LDKOpenChannel this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_free")] public static extern void OpenChannel_free(long _this_obj); - // const uint8_t (*OpenChannel_get_chain_hash(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_chain_hash")] public static extern long OpenChannel_get_chain_hash(long _this_ptr); - // void OpenChannel_set_chain_hash(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_chain_hash")] public static extern void OpenChannel_set_chain_hash(long _this_ptr, long _val); - // const uint8_t (*OpenChannel_get_temporary_channel_id(const struct LDKOpenChannel *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_temporary_channel_id")] public static extern long OpenChannel_get_temporary_channel_id(long _this_ptr); - // void OpenChannel_set_temporary_channel_id(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_temporary_channel_id")] public static extern void OpenChannel_set_temporary_channel_id(long _this_ptr, long _val); - // uint64_t OpenChannel_get_funding_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_funding_satoshis")] public static extern long OpenChannel_get_funding_satoshis(long _this_ptr); - // void OpenChannel_set_funding_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_funding_satoshis")] public static extern void OpenChannel_set_funding_satoshis(long _this_ptr, long _val); + // struct LDKCommonOpenChannelFields OpenChannel_get_common_fields(const struct LDKOpenChannel *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_common_fields")] public static extern long OpenChannel_get_common_fields(long _this_ptr); + // void OpenChannel_set_common_fields(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_common_fields")] public static extern void OpenChannel_set_common_fields(long _this_ptr, long _val); // uint64_t OpenChannel_get_push_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_push_msat")] public static extern long OpenChannel_get_push_msat(long _this_ptr); // void OpenChannel_set_push_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_push_msat")] public static extern void OpenChannel_set_push_msat(long _this_ptr, long _val); - // uint64_t OpenChannel_get_dust_limit_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_dust_limit_satoshis")] public static extern long OpenChannel_get_dust_limit_satoshis(long _this_ptr); - // void OpenChannel_set_dust_limit_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_dust_limit_satoshis")] public static extern void OpenChannel_set_dust_limit_satoshis(long _this_ptr, long _val); - // uint64_t OpenChannel_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_max_htlc_value_in_flight_msat")] public static extern long OpenChannel_get_max_htlc_value_in_flight_msat(long _this_ptr); - // void OpenChannel_set_max_htlc_value_in_flight_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_max_htlc_value_in_flight_msat")] public static extern void OpenChannel_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); // uint64_t OpenChannel_get_channel_reserve_satoshis(const struct LDKOpenChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_channel_reserve_satoshis")] public static extern long OpenChannel_get_channel_reserve_satoshis(long _this_ptr); // void OpenChannel_set_channel_reserve_satoshis(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_channel_reserve_satoshis")] public static extern void OpenChannel_set_channel_reserve_satoshis(long _this_ptr, long _val); - // uint64_t OpenChannel_get_htlc_minimum_msat(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_htlc_minimum_msat")] public static extern long OpenChannel_get_htlc_minimum_msat(long _this_ptr); - // void OpenChannel_set_htlc_minimum_msat(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_htlc_minimum_msat")] public static extern void OpenChannel_set_htlc_minimum_msat(long _this_ptr, long _val); - // uint32_t OpenChannel_get_feerate_per_kw(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_feerate_per_kw")] public static extern int OpenChannel_get_feerate_per_kw(long _this_ptr); - // void OpenChannel_set_feerate_per_kw(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_feerate_per_kw")] public static extern void OpenChannel_set_feerate_per_kw(long _this_ptr, int _val); - // uint16_t OpenChannel_get_to_self_delay(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_to_self_delay")] public static extern short OpenChannel_get_to_self_delay(long _this_ptr); - // void OpenChannel_set_to_self_delay(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_to_self_delay")] public static extern void OpenChannel_set_to_self_delay(long _this_ptr, short _val); - // uint16_t OpenChannel_get_max_accepted_htlcs(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_max_accepted_htlcs")] public static extern short OpenChannel_get_max_accepted_htlcs(long _this_ptr); - // void OpenChannel_set_max_accepted_htlcs(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_max_accepted_htlcs")] public static extern void OpenChannel_set_max_accepted_htlcs(long _this_ptr, short _val); - // struct LDKPublicKey OpenChannel_get_funding_pubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_funding_pubkey")] public static extern long OpenChannel_get_funding_pubkey(long _this_ptr); - // void OpenChannel_set_funding_pubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_funding_pubkey")] public static extern void OpenChannel_set_funding_pubkey(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannel_get_revocation_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_revocation_basepoint")] public static extern long OpenChannel_get_revocation_basepoint(long _this_ptr); - // void OpenChannel_set_revocation_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_revocation_basepoint")] public static extern void OpenChannel_set_revocation_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannel_get_payment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_payment_point")] public static extern long OpenChannel_get_payment_point(long _this_ptr); - // void OpenChannel_set_payment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_payment_point")] public static extern void OpenChannel_set_payment_point(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannel_get_delayed_payment_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_delayed_payment_basepoint")] public static extern long OpenChannel_get_delayed_payment_basepoint(long _this_ptr); - // void OpenChannel_set_delayed_payment_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_delayed_payment_basepoint")] public static extern void OpenChannel_set_delayed_payment_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannel_get_htlc_basepoint(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_htlc_basepoint")] public static extern long OpenChannel_get_htlc_basepoint(long _this_ptr); - // void OpenChannel_set_htlc_basepoint(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_htlc_basepoint")] public static extern void OpenChannel_set_htlc_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannel_get_first_per_commitment_point(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_first_per_commitment_point")] public static extern long OpenChannel_get_first_per_commitment_point(long _this_ptr); - // void OpenChannel_set_first_per_commitment_point(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_first_per_commitment_point")] public static extern void OpenChannel_set_first_per_commitment_point(long _this_ptr, long _val); - // uint8_t OpenChannel_get_channel_flags(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_channel_flags")] public static extern byte OpenChannel_get_channel_flags(long _this_ptr); - // void OpenChannel_set_channel_flags(struct LDKOpenChannel *NONNULL_PTR this_ptr, uint8_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_channel_flags")] public static extern void OpenChannel_set_channel_flags(long _this_ptr, byte _val); - // struct LDKCOption_CVec_u8ZZ OpenChannel_get_shutdown_scriptpubkey(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_shutdown_scriptpubkey")] public static extern long OpenChannel_get_shutdown_scriptpubkey(long _this_ptr); - // void OpenChannel_set_shutdown_scriptpubkey(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_shutdown_scriptpubkey")] public static extern void OpenChannel_set_shutdown_scriptpubkey(long _this_ptr, long _val); - // struct LDKChannelTypeFeatures OpenChannel_get_channel_type(const struct LDKOpenChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_get_channel_type")] public static extern long OpenChannel_get_channel_type(long _this_ptr); - // void OpenChannel_set_channel_type(struct LDKOpenChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_set_channel_type")] public static extern void OpenChannel_set_channel_type(long _this_ptr, long _val); - // MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t push_msat_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t feerate_per_kw_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_new")] public static extern long OpenChannel_new(long _chain_hash_arg, long _temporary_channel_id_arg, long _funding_satoshis_arg, long _push_msat_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _channel_reserve_satoshis_arg, long _htlc_minimum_msat_arg, int _feerate_per_kw_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, long _funding_pubkey_arg, long _revocation_basepoint_arg, long _payment_point_arg, long _delayed_payment_basepoint_arg, long _htlc_basepoint_arg, long _first_per_commitment_point_arg, byte _channel_flags_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg); + // MUST_USE_RES struct LDKOpenChannel OpenChannel_new(struct LDKCommonOpenChannelFields common_fields_arg, uint64_t push_msat_arg, uint64_t channel_reserve_satoshis_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_new")] public static extern long OpenChannel_new(long _common_fields_arg, long _push_msat_arg, long _channel_reserve_satoshis_arg); // uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_clone_ptr")] public static extern long OpenChannel_clone_ptr(long _arg); // struct LDKOpenChannel OpenChannel_clone(const struct LDKOpenChannel *NONNULL_PTR orig); @@ -7576,96 +8354,28 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannel_eq")] public static extern bool OpenChannel_eq(long _a, long _b); // void OpenChannelV2_free(struct LDKOpenChannelV2 this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_free")] public static extern void OpenChannelV2_free(long _this_obj); - // const uint8_t (*OpenChannelV2_get_chain_hash(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_chain_hash")] public static extern long OpenChannelV2_get_chain_hash(long _this_ptr); - // void OpenChannelV2_set_chain_hash(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_chain_hash")] public static extern void OpenChannelV2_set_chain_hash(long _this_ptr, long _val); - // const uint8_t (*OpenChannelV2_get_temporary_channel_id(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_temporary_channel_id")] public static extern long OpenChannelV2_get_temporary_channel_id(long _this_ptr); - // void OpenChannelV2_set_temporary_channel_id(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_temporary_channel_id")] public static extern void OpenChannelV2_set_temporary_channel_id(long _this_ptr, long _val); + // struct LDKCommonOpenChannelFields OpenChannelV2_get_common_fields(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_common_fields")] public static extern long OpenChannelV2_get_common_fields(long _this_ptr); + // void OpenChannelV2_set_common_fields(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonOpenChannelFields val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_common_fields")] public static extern void OpenChannelV2_set_common_fields(long _this_ptr, long _val); // uint32_t OpenChannelV2_get_funding_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_funding_feerate_sat_per_1000_weight")] public static extern int OpenChannelV2_get_funding_feerate_sat_per_1000_weight(long _this_ptr); // void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_funding_feerate_sat_per_1000_weight")] public static extern void OpenChannelV2_set_funding_feerate_sat_per_1000_weight(long _this_ptr, int _val); - // uint32_t OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_commitment_feerate_sat_per_1000_weight")] public static extern int OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(long _this_ptr); - // void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_commitment_feerate_sat_per_1000_weight")] public static extern void OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(long _this_ptr, int _val); - // uint64_t OpenChannelV2_get_funding_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_funding_satoshis")] public static extern long OpenChannelV2_get_funding_satoshis(long _this_ptr); - // void OpenChannelV2_set_funding_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_funding_satoshis")] public static extern void OpenChannelV2_set_funding_satoshis(long _this_ptr, long _val); - // uint64_t OpenChannelV2_get_dust_limit_satoshis(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_dust_limit_satoshis")] public static extern long OpenChannelV2_get_dust_limit_satoshis(long _this_ptr); - // void OpenChannelV2_set_dust_limit_satoshis(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_dust_limit_satoshis")] public static extern void OpenChannelV2_set_dust_limit_satoshis(long _this_ptr, long _val); - // uint64_t OpenChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_max_htlc_value_in_flight_msat")] public static extern long OpenChannelV2_get_max_htlc_value_in_flight_msat(long _this_ptr); - // void OpenChannelV2_set_max_htlc_value_in_flight_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_max_htlc_value_in_flight_msat")] public static extern void OpenChannelV2_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); - // uint64_t OpenChannelV2_get_htlc_minimum_msat(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_htlc_minimum_msat")] public static extern long OpenChannelV2_get_htlc_minimum_msat(long _this_ptr); - // void OpenChannelV2_set_htlc_minimum_msat(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_htlc_minimum_msat")] public static extern void OpenChannelV2_set_htlc_minimum_msat(long _this_ptr, long _val); - // uint16_t OpenChannelV2_get_to_self_delay(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_to_self_delay")] public static extern short OpenChannelV2_get_to_self_delay(long _this_ptr); - // void OpenChannelV2_set_to_self_delay(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_to_self_delay")] public static extern void OpenChannelV2_set_to_self_delay(long _this_ptr, short _val); - // uint16_t OpenChannelV2_get_max_accepted_htlcs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_max_accepted_htlcs")] public static extern short OpenChannelV2_get_max_accepted_htlcs(long _this_ptr); - // void OpenChannelV2_set_max_accepted_htlcs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_max_accepted_htlcs")] public static extern void OpenChannelV2_set_max_accepted_htlcs(long _this_ptr, short _val); // uint32_t OpenChannelV2_get_locktime(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_locktime")] public static extern int OpenChannelV2_get_locktime(long _this_ptr); // void OpenChannelV2_set_locktime(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_locktime")] public static extern void OpenChannelV2_set_locktime(long _this_ptr, int _val); - // struct LDKPublicKey OpenChannelV2_get_funding_pubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_funding_pubkey")] public static extern long OpenChannelV2_get_funding_pubkey(long _this_ptr); - // void OpenChannelV2_set_funding_pubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_funding_pubkey")] public static extern void OpenChannelV2_set_funding_pubkey(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannelV2_get_revocation_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_revocation_basepoint")] public static extern long OpenChannelV2_get_revocation_basepoint(long _this_ptr); - // void OpenChannelV2_set_revocation_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_revocation_basepoint")] public static extern void OpenChannelV2_set_revocation_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannelV2_get_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_payment_basepoint")] public static extern long OpenChannelV2_get_payment_basepoint(long _this_ptr); - // void OpenChannelV2_set_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_payment_basepoint")] public static extern void OpenChannelV2_set_payment_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannelV2_get_delayed_payment_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_delayed_payment_basepoint")] public static extern long OpenChannelV2_get_delayed_payment_basepoint(long _this_ptr); - // void OpenChannelV2_set_delayed_payment_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_delayed_payment_basepoint")] public static extern void OpenChannelV2_set_delayed_payment_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannelV2_get_htlc_basepoint(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_htlc_basepoint")] public static extern long OpenChannelV2_get_htlc_basepoint(long _this_ptr); - // void OpenChannelV2_set_htlc_basepoint(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_htlc_basepoint")] public static extern void OpenChannelV2_set_htlc_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey OpenChannelV2_get_first_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_first_per_commitment_point")] public static extern long OpenChannelV2_get_first_per_commitment_point(long _this_ptr); - // void OpenChannelV2_set_first_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_first_per_commitment_point")] public static extern void OpenChannelV2_set_first_per_commitment_point(long _this_ptr, long _val); // struct LDKPublicKey OpenChannelV2_get_second_per_commitment_point(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_second_per_commitment_point")] public static extern long OpenChannelV2_get_second_per_commitment_point(long _this_ptr); // void OpenChannelV2_set_second_per_commitment_point(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_second_per_commitment_point")] public static extern void OpenChannelV2_set_second_per_commitment_point(long _this_ptr, long _val); - // uint8_t OpenChannelV2_get_channel_flags(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_channel_flags")] public static extern byte OpenChannelV2_get_channel_flags(long _this_ptr); - // void OpenChannelV2_set_channel_flags(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, uint8_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_channel_flags")] public static extern void OpenChannelV2_set_channel_flags(long _this_ptr, byte _val); - // struct LDKCOption_CVec_u8ZZ OpenChannelV2_get_shutdown_scriptpubkey(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_shutdown_scriptpubkey")] public static extern long OpenChannelV2_get_shutdown_scriptpubkey(long _this_ptr); - // void OpenChannelV2_set_shutdown_scriptpubkey(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_shutdown_scriptpubkey")] public static extern void OpenChannelV2_set_shutdown_scriptpubkey(long _this_ptr, long _val); - // struct LDKChannelTypeFeatures OpenChannelV2_get_channel_type(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_channel_type")] public static extern long OpenChannelV2_get_channel_type(long _this_ptr); - // void OpenChannelV2_set_channel_type(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_channel_type")] public static extern void OpenChannelV2_set_channel_type(long _this_ptr, long _val); // enum LDKCOption_NoneZ OpenChannelV2_get_require_confirmed_inputs(const struct LDKOpenChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_get_require_confirmed_inputs")] public static extern COption_NoneZ OpenChannelV2_get_require_confirmed_inputs(long _this_ptr); // void OpenChannelV2_set_require_confirmed_inputs(struct LDKOpenChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_set_require_confirmed_inputs")] public static extern void OpenChannelV2_set_require_confirmed_inputs(long _this_ptr, COption_NoneZ _val); - // MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKThirtyTwoBytes chain_hash_arg, struct LDKThirtyTwoBytes temporary_channel_id_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t commitment_feerate_sat_per_1000_weight_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, uint8_t channel_flags_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_new")] public static extern long OpenChannelV2_new(long _chain_hash_arg, long _temporary_channel_id_arg, int _funding_feerate_sat_per_1000_weight_arg, int _commitment_feerate_sat_per_1000_weight_arg, long _funding_satoshis_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _htlc_minimum_msat_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, int _locktime_arg, long _funding_pubkey_arg, long _revocation_basepoint_arg, long _payment_basepoint_arg, long _delayed_payment_basepoint_arg, long _htlc_basepoint_arg, long _first_per_commitment_point_arg, long _second_per_commitment_point_arg, byte _channel_flags_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg, COption_NoneZ _require_confirmed_inputs_arg); + // MUST_USE_RES struct LDKOpenChannelV2 OpenChannelV2_new(struct LDKCommonOpenChannelFields common_fields_arg, uint32_t funding_feerate_sat_per_1000_weight_arg, uint32_t locktime_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_new")] public static extern long OpenChannelV2_new(long _common_fields_arg, int _funding_feerate_sat_per_1000_weight_arg, int _locktime_arg, long _second_per_commitment_point_arg, COption_NoneZ _require_confirmed_inputs_arg); // uint64_t OpenChannelV2_clone_ptr(LDKOpenChannelV2 *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_clone_ptr")] public static extern long OpenChannelV2_clone_ptr(long _arg); // struct LDKOpenChannelV2 OpenChannelV2_clone(const struct LDKOpenChannelV2 *NONNULL_PTR orig); @@ -7674,74 +8384,90 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_hash")] public static extern long OpenChannelV2_hash(long _o); // bool OpenChannelV2_eq(const struct LDKOpenChannelV2 *NONNULL_PTR a, const struct LDKOpenChannelV2 *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OpenChannelV2_eq")] public static extern bool OpenChannelV2_eq(long _a, long _b); + // void CommonAcceptChannelFields_free(struct LDKCommonAcceptChannelFields this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_free")] public static extern void CommonAcceptChannelFields_free(long _this_obj); + // struct LDKChannelId CommonAcceptChannelFields_get_temporary_channel_id(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_temporary_channel_id")] public static extern long CommonAcceptChannelFields_get_temporary_channel_id(long _this_ptr); + // void CommonAcceptChannelFields_set_temporary_channel_id(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_temporary_channel_id")] public static extern void CommonAcceptChannelFields_set_temporary_channel_id(long _this_ptr, long _val); + // uint64_t CommonAcceptChannelFields_get_dust_limit_satoshis(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_dust_limit_satoshis")] public static extern long CommonAcceptChannelFields_get_dust_limit_satoshis(long _this_ptr); + // void CommonAcceptChannelFields_set_dust_limit_satoshis(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_dust_limit_satoshis")] public static extern void CommonAcceptChannelFields_set_dust_limit_satoshis(long _this_ptr, long _val); + // uint64_t CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat")] public static extern long CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(long _this_ptr); + // void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat")] public static extern void CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); + // uint64_t CommonAcceptChannelFields_get_htlc_minimum_msat(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_htlc_minimum_msat")] public static extern long CommonAcceptChannelFields_get_htlc_minimum_msat(long _this_ptr); + // void CommonAcceptChannelFields_set_htlc_minimum_msat(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint64_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_htlc_minimum_msat")] public static extern void CommonAcceptChannelFields_set_htlc_minimum_msat(long _this_ptr, long _val); + // uint32_t CommonAcceptChannelFields_get_minimum_depth(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_minimum_depth")] public static extern int CommonAcceptChannelFields_get_minimum_depth(long _this_ptr); + // void CommonAcceptChannelFields_set_minimum_depth(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint32_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_minimum_depth")] public static extern void CommonAcceptChannelFields_set_minimum_depth(long _this_ptr, int _val); + // uint16_t CommonAcceptChannelFields_get_to_self_delay(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_to_self_delay")] public static extern short CommonAcceptChannelFields_get_to_self_delay(long _this_ptr); + // void CommonAcceptChannelFields_set_to_self_delay(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_to_self_delay")] public static extern void CommonAcceptChannelFields_set_to_self_delay(long _this_ptr, short _val); + // uint16_t CommonAcceptChannelFields_get_max_accepted_htlcs(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_max_accepted_htlcs")] public static extern short CommonAcceptChannelFields_get_max_accepted_htlcs(long _this_ptr); + // void CommonAcceptChannelFields_set_max_accepted_htlcs(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, uint16_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_max_accepted_htlcs")] public static extern void CommonAcceptChannelFields_set_max_accepted_htlcs(long _this_ptr, short _val); + // struct LDKPublicKey CommonAcceptChannelFields_get_funding_pubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_funding_pubkey")] public static extern long CommonAcceptChannelFields_get_funding_pubkey(long _this_ptr); + // void CommonAcceptChannelFields_set_funding_pubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_funding_pubkey")] public static extern void CommonAcceptChannelFields_set_funding_pubkey(long _this_ptr, long _val); + // struct LDKPublicKey CommonAcceptChannelFields_get_revocation_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_revocation_basepoint")] public static extern long CommonAcceptChannelFields_get_revocation_basepoint(long _this_ptr); + // void CommonAcceptChannelFields_set_revocation_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_revocation_basepoint")] public static extern void CommonAcceptChannelFields_set_revocation_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonAcceptChannelFields_get_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_payment_basepoint")] public static extern long CommonAcceptChannelFields_get_payment_basepoint(long _this_ptr); + // void CommonAcceptChannelFields_set_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_payment_basepoint")] public static extern void CommonAcceptChannelFields_set_payment_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonAcceptChannelFields_get_delayed_payment_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_delayed_payment_basepoint")] public static extern long CommonAcceptChannelFields_get_delayed_payment_basepoint(long _this_ptr); + // void CommonAcceptChannelFields_set_delayed_payment_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_delayed_payment_basepoint")] public static extern void CommonAcceptChannelFields_set_delayed_payment_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonAcceptChannelFields_get_htlc_basepoint(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_htlc_basepoint")] public static extern long CommonAcceptChannelFields_get_htlc_basepoint(long _this_ptr); + // void CommonAcceptChannelFields_set_htlc_basepoint(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_htlc_basepoint")] public static extern void CommonAcceptChannelFields_set_htlc_basepoint(long _this_ptr, long _val); + // struct LDKPublicKey CommonAcceptChannelFields_get_first_per_commitment_point(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_first_per_commitment_point")] public static extern long CommonAcceptChannelFields_get_first_per_commitment_point(long _this_ptr); + // void CommonAcceptChannelFields_set_first_per_commitment_point(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_first_per_commitment_point")] public static extern void CommonAcceptChannelFields_set_first_per_commitment_point(long _this_ptr, long _val); + // struct LDKCOption_CVec_u8ZZ CommonAcceptChannelFields_get_shutdown_scriptpubkey(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_shutdown_scriptpubkey")] public static extern long CommonAcceptChannelFields_get_shutdown_scriptpubkey(long _this_ptr); + // void CommonAcceptChannelFields_set_shutdown_scriptpubkey(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_shutdown_scriptpubkey")] public static extern void CommonAcceptChannelFields_set_shutdown_scriptpubkey(long _this_ptr, long _val); + // struct LDKChannelTypeFeatures CommonAcceptChannelFields_get_channel_type(const struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_get_channel_type")] public static extern long CommonAcceptChannelFields_get_channel_type(long _this_ptr); + // void CommonAcceptChannelFields_set_channel_type(struct LDKCommonAcceptChannelFields *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_set_channel_type")] public static extern void CommonAcceptChannelFields_set_channel_type(long _this_ptr, long _val); + // MUST_USE_RES struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_new(struct LDKChannelId temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_new")] public static extern long CommonAcceptChannelFields_new(long _temporary_channel_id_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _htlc_minimum_msat_arg, int _minimum_depth_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, long _funding_pubkey_arg, long _revocation_basepoint_arg, long _payment_basepoint_arg, long _delayed_payment_basepoint_arg, long _htlc_basepoint_arg, long _first_per_commitment_point_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg); + // uint64_t CommonAcceptChannelFields_clone_ptr(LDKCommonAcceptChannelFields *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_clone_ptr")] public static extern long CommonAcceptChannelFields_clone_ptr(long _arg); + // struct LDKCommonAcceptChannelFields CommonAcceptChannelFields_clone(const struct LDKCommonAcceptChannelFields *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_clone")] public static extern long CommonAcceptChannelFields_clone(long _orig); + // uint64_t CommonAcceptChannelFields_hash(const struct LDKCommonAcceptChannelFields *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_hash")] public static extern long CommonAcceptChannelFields_hash(long _o); + // bool CommonAcceptChannelFields_eq(const struct LDKCommonAcceptChannelFields *NONNULL_PTR a, const struct LDKCommonAcceptChannelFields *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommonAcceptChannelFields_eq")] public static extern bool CommonAcceptChannelFields_eq(long _a, long _b); // void AcceptChannel_free(struct LDKAcceptChannel this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_free")] public static extern void AcceptChannel_free(long _this_obj); - // const uint8_t (*AcceptChannel_get_temporary_channel_id(const struct LDKAcceptChannel *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_temporary_channel_id")] public static extern long AcceptChannel_get_temporary_channel_id(long _this_ptr); - // void AcceptChannel_set_temporary_channel_id(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_temporary_channel_id")] public static extern void AcceptChannel_set_temporary_channel_id(long _this_ptr, long _val); - // uint64_t AcceptChannel_get_dust_limit_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_dust_limit_satoshis")] public static extern long AcceptChannel_get_dust_limit_satoshis(long _this_ptr); - // void AcceptChannel_set_dust_limit_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_dust_limit_satoshis")] public static extern void AcceptChannel_set_dust_limit_satoshis(long _this_ptr, long _val); - // uint64_t AcceptChannel_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_max_htlc_value_in_flight_msat")] public static extern long AcceptChannel_get_max_htlc_value_in_flight_msat(long _this_ptr); - // void AcceptChannel_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_max_htlc_value_in_flight_msat")] public static extern void AcceptChannel_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); + // struct LDKCommonAcceptChannelFields AcceptChannel_get_common_fields(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_common_fields")] public static extern long AcceptChannel_get_common_fields(long _this_ptr); + // void AcceptChannel_set_common_fields(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_common_fields")] public static extern void AcceptChannel_set_common_fields(long _this_ptr, long _val); // uint64_t AcceptChannel_get_channel_reserve_satoshis(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_channel_reserve_satoshis")] public static extern long AcceptChannel_get_channel_reserve_satoshis(long _this_ptr); // void AcceptChannel_set_channel_reserve_satoshis(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_channel_reserve_satoshis")] public static extern void AcceptChannel_set_channel_reserve_satoshis(long _this_ptr, long _val); - // uint64_t AcceptChannel_get_htlc_minimum_msat(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_htlc_minimum_msat")] public static extern long AcceptChannel_get_htlc_minimum_msat(long _this_ptr); - // void AcceptChannel_set_htlc_minimum_msat(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_htlc_minimum_msat")] public static extern void AcceptChannel_set_htlc_minimum_msat(long _this_ptr, long _val); - // uint32_t AcceptChannel_get_minimum_depth(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_minimum_depth")] public static extern int AcceptChannel_get_minimum_depth(long _this_ptr); - // void AcceptChannel_set_minimum_depth(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_minimum_depth")] public static extern void AcceptChannel_set_minimum_depth(long _this_ptr, int _val); - // uint16_t AcceptChannel_get_to_self_delay(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_to_self_delay")] public static extern short AcceptChannel_get_to_self_delay(long _this_ptr); - // void AcceptChannel_set_to_self_delay(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_to_self_delay")] public static extern void AcceptChannel_set_to_self_delay(long _this_ptr, short _val); - // uint16_t AcceptChannel_get_max_accepted_htlcs(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_max_accepted_htlcs")] public static extern short AcceptChannel_get_max_accepted_htlcs(long _this_ptr); - // void AcceptChannel_set_max_accepted_htlcs(struct LDKAcceptChannel *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_max_accepted_htlcs")] public static extern void AcceptChannel_set_max_accepted_htlcs(long _this_ptr, short _val); - // struct LDKPublicKey AcceptChannel_get_funding_pubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_funding_pubkey")] public static extern long AcceptChannel_get_funding_pubkey(long _this_ptr); - // void AcceptChannel_set_funding_pubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_funding_pubkey")] public static extern void AcceptChannel_set_funding_pubkey(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannel_get_revocation_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_revocation_basepoint")] public static extern long AcceptChannel_get_revocation_basepoint(long _this_ptr); - // void AcceptChannel_set_revocation_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_revocation_basepoint")] public static extern void AcceptChannel_set_revocation_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannel_get_payment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_payment_point")] public static extern long AcceptChannel_get_payment_point(long _this_ptr); - // void AcceptChannel_set_payment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_payment_point")] public static extern void AcceptChannel_set_payment_point(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannel_get_delayed_payment_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_delayed_payment_basepoint")] public static extern long AcceptChannel_get_delayed_payment_basepoint(long _this_ptr); - // void AcceptChannel_set_delayed_payment_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_delayed_payment_basepoint")] public static extern void AcceptChannel_set_delayed_payment_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannel_get_htlc_basepoint(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_htlc_basepoint")] public static extern long AcceptChannel_get_htlc_basepoint(long _this_ptr); - // void AcceptChannel_set_htlc_basepoint(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_htlc_basepoint")] public static extern void AcceptChannel_set_htlc_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannel_get_first_per_commitment_point(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_first_per_commitment_point")] public static extern long AcceptChannel_get_first_per_commitment_point(long _this_ptr); - // void AcceptChannel_set_first_per_commitment_point(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_first_per_commitment_point")] public static extern void AcceptChannel_set_first_per_commitment_point(long _this_ptr, long _val); - // struct LDKCOption_CVec_u8ZZ AcceptChannel_get_shutdown_scriptpubkey(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_shutdown_scriptpubkey")] public static extern long AcceptChannel_get_shutdown_scriptpubkey(long _this_ptr); - // void AcceptChannel_set_shutdown_scriptpubkey(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_shutdown_scriptpubkey")] public static extern void AcceptChannel_set_shutdown_scriptpubkey(long _this_ptr, long _val); - // struct LDKChannelTypeFeatures AcceptChannel_get_channel_type(const struct LDKAcceptChannel *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_get_channel_type")] public static extern long AcceptChannel_get_channel_type(long _this_ptr); - // void AcceptChannel_set_channel_type(struct LDKAcceptChannel *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_set_channel_type")] public static extern void AcceptChannel_set_channel_type(long _this_ptr, long _val); - // MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t channel_reserve_satoshis_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_point_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_new")] public static extern long AcceptChannel_new(long _temporary_channel_id_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _channel_reserve_satoshis_arg, long _htlc_minimum_msat_arg, int _minimum_depth_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, long _funding_pubkey_arg, long _revocation_basepoint_arg, long _payment_point_arg, long _delayed_payment_basepoint_arg, long _htlc_basepoint_arg, long _first_per_commitment_point_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg); + // MUST_USE_RES struct LDKAcceptChannel AcceptChannel_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t channel_reserve_satoshis_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_new")] public static extern long AcceptChannel_new(long _common_fields_arg, long _channel_reserve_satoshis_arg); // uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_clone_ptr")] public static extern long AcceptChannel_clone_ptr(long _arg); // struct LDKAcceptChannel AcceptChannel_clone(const struct LDKAcceptChannel *NONNULL_PTR orig); @@ -7752,80 +8478,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_eq")] public static extern bool AcceptChannel_eq(long _a, long _b); // void AcceptChannelV2_free(struct LDKAcceptChannelV2 this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_free")] public static extern void AcceptChannelV2_free(long _this_obj); - // const uint8_t (*AcceptChannelV2_get_temporary_channel_id(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr))[32]; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_temporary_channel_id")] public static extern long AcceptChannelV2_get_temporary_channel_id(long _this_ptr); - // void AcceptChannelV2_set_temporary_channel_id(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_temporary_channel_id")] public static extern void AcceptChannelV2_set_temporary_channel_id(long _this_ptr, long _val); + // struct LDKCommonAcceptChannelFields AcceptChannelV2_get_common_fields(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_common_fields")] public static extern long AcceptChannelV2_get_common_fields(long _this_ptr); + // void AcceptChannelV2_set_common_fields(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCommonAcceptChannelFields val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_common_fields")] public static extern void AcceptChannelV2_set_common_fields(long _this_ptr, long _val); // uint64_t AcceptChannelV2_get_funding_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_funding_satoshis")] public static extern long AcceptChannelV2_get_funding_satoshis(long _this_ptr); // void AcceptChannelV2_set_funding_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_funding_satoshis")] public static extern void AcceptChannelV2_set_funding_satoshis(long _this_ptr, long _val); - // uint64_t AcceptChannelV2_get_dust_limit_satoshis(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_dust_limit_satoshis")] public static extern long AcceptChannelV2_get_dust_limit_satoshis(long _this_ptr); - // void AcceptChannelV2_set_dust_limit_satoshis(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_dust_limit_satoshis")] public static extern void AcceptChannelV2_set_dust_limit_satoshis(long _this_ptr, long _val); - // uint64_t AcceptChannelV2_get_max_htlc_value_in_flight_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_max_htlc_value_in_flight_msat")] public static extern long AcceptChannelV2_get_max_htlc_value_in_flight_msat(long _this_ptr); - // void AcceptChannelV2_set_max_htlc_value_in_flight_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_max_htlc_value_in_flight_msat")] public static extern void AcceptChannelV2_set_max_htlc_value_in_flight_msat(long _this_ptr, long _val); - // uint64_t AcceptChannelV2_get_htlc_minimum_msat(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_htlc_minimum_msat")] public static extern long AcceptChannelV2_get_htlc_minimum_msat(long _this_ptr); - // void AcceptChannelV2_set_htlc_minimum_msat(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint64_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_htlc_minimum_msat")] public static extern void AcceptChannelV2_set_htlc_minimum_msat(long _this_ptr, long _val); - // uint32_t AcceptChannelV2_get_minimum_depth(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_minimum_depth")] public static extern int AcceptChannelV2_get_minimum_depth(long _this_ptr); - // void AcceptChannelV2_set_minimum_depth(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint32_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_minimum_depth")] public static extern void AcceptChannelV2_set_minimum_depth(long _this_ptr, int _val); - // uint16_t AcceptChannelV2_get_to_self_delay(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_to_self_delay")] public static extern short AcceptChannelV2_get_to_self_delay(long _this_ptr); - // void AcceptChannelV2_set_to_self_delay(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_to_self_delay")] public static extern void AcceptChannelV2_set_to_self_delay(long _this_ptr, short _val); - // uint16_t AcceptChannelV2_get_max_accepted_htlcs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_max_accepted_htlcs")] public static extern short AcceptChannelV2_get_max_accepted_htlcs(long _this_ptr); - // void AcceptChannelV2_set_max_accepted_htlcs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, uint16_t val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_max_accepted_htlcs")] public static extern void AcceptChannelV2_set_max_accepted_htlcs(long _this_ptr, short _val); - // struct LDKPublicKey AcceptChannelV2_get_funding_pubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_funding_pubkey")] public static extern long AcceptChannelV2_get_funding_pubkey(long _this_ptr); - // void AcceptChannelV2_set_funding_pubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_funding_pubkey")] public static extern void AcceptChannelV2_set_funding_pubkey(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannelV2_get_revocation_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_revocation_basepoint")] public static extern long AcceptChannelV2_get_revocation_basepoint(long _this_ptr); - // void AcceptChannelV2_set_revocation_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_revocation_basepoint")] public static extern void AcceptChannelV2_set_revocation_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannelV2_get_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_payment_basepoint")] public static extern long AcceptChannelV2_get_payment_basepoint(long _this_ptr); - // void AcceptChannelV2_set_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_payment_basepoint")] public static extern void AcceptChannelV2_set_payment_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannelV2_get_delayed_payment_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_delayed_payment_basepoint")] public static extern long AcceptChannelV2_get_delayed_payment_basepoint(long _this_ptr); - // void AcceptChannelV2_set_delayed_payment_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_delayed_payment_basepoint")] public static extern void AcceptChannelV2_set_delayed_payment_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannelV2_get_htlc_basepoint(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_htlc_basepoint")] public static extern long AcceptChannelV2_get_htlc_basepoint(long _this_ptr); - // void AcceptChannelV2_set_htlc_basepoint(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_htlc_basepoint")] public static extern void AcceptChannelV2_set_htlc_basepoint(long _this_ptr, long _val); - // struct LDKPublicKey AcceptChannelV2_get_first_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_first_per_commitment_point")] public static extern long AcceptChannelV2_get_first_per_commitment_point(long _this_ptr); - // void AcceptChannelV2_set_first_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_first_per_commitment_point")] public static extern void AcceptChannelV2_set_first_per_commitment_point(long _this_ptr, long _val); // struct LDKPublicKey AcceptChannelV2_get_second_per_commitment_point(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_second_per_commitment_point")] public static extern long AcceptChannelV2_get_second_per_commitment_point(long _this_ptr); // void AcceptChannelV2_set_second_per_commitment_point(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_second_per_commitment_point")] public static extern void AcceptChannelV2_set_second_per_commitment_point(long _this_ptr, long _val); - // struct LDKCOption_CVec_u8ZZ AcceptChannelV2_get_shutdown_scriptpubkey(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_shutdown_scriptpubkey")] public static extern long AcceptChannelV2_get_shutdown_scriptpubkey(long _this_ptr); - // void AcceptChannelV2_set_shutdown_scriptpubkey(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKCOption_CVec_u8ZZ val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_shutdown_scriptpubkey")] public static extern void AcceptChannelV2_set_shutdown_scriptpubkey(long _this_ptr, long _val); - // struct LDKChannelTypeFeatures AcceptChannelV2_get_channel_type(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_channel_type")] public static extern long AcceptChannelV2_get_channel_type(long _this_ptr); - // void AcceptChannelV2_set_channel_type(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, struct LDKChannelTypeFeatures val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_channel_type")] public static extern void AcceptChannelV2_set_channel_type(long _this_ptr, long _val); // enum LDKCOption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(const struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_get_require_confirmed_inputs")] public static extern COption_NoneZ AcceptChannelV2_get_require_confirmed_inputs(long _this_ptr); // void AcceptChannelV2_set_require_confirmed_inputs(struct LDKAcceptChannelV2 *NONNULL_PTR this_ptr, enum LDKCOption_NoneZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_set_require_confirmed_inputs")] public static extern void AcceptChannelV2_set_require_confirmed_inputs(long _this_ptr, COption_NoneZ _val); - // MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, uint64_t funding_satoshis_arg, uint64_t dust_limit_satoshis_arg, uint64_t max_htlc_value_in_flight_msat_arg, uint64_t htlc_minimum_msat_arg, uint32_t minimum_depth_arg, uint16_t to_self_delay_arg, uint16_t max_accepted_htlcs_arg, struct LDKPublicKey funding_pubkey_arg, struct LDKPublicKey revocation_basepoint_arg, struct LDKPublicKey payment_basepoint_arg, struct LDKPublicKey delayed_payment_basepoint_arg, struct LDKPublicKey htlc_basepoint_arg, struct LDKPublicKey first_per_commitment_point_arg, struct LDKPublicKey second_per_commitment_point_arg, struct LDKCOption_CVec_u8ZZ shutdown_scriptpubkey_arg, struct LDKChannelTypeFeatures channel_type_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_new")] public static extern long AcceptChannelV2_new(long _temporary_channel_id_arg, long _funding_satoshis_arg, long _dust_limit_satoshis_arg, long _max_htlc_value_in_flight_msat_arg, long _htlc_minimum_msat_arg, int _minimum_depth_arg, short _to_self_delay_arg, short _max_accepted_htlcs_arg, long _funding_pubkey_arg, long _revocation_basepoint_arg, long _payment_basepoint_arg, long _delayed_payment_basepoint_arg, long _htlc_basepoint_arg, long _first_per_commitment_point_arg, long _second_per_commitment_point_arg, long _shutdown_scriptpubkey_arg, long _channel_type_arg, COption_NoneZ _require_confirmed_inputs_arg); + // MUST_USE_RES struct LDKAcceptChannelV2 AcceptChannelV2_new(struct LDKCommonAcceptChannelFields common_fields_arg, uint64_t funding_satoshis_arg, struct LDKPublicKey second_per_commitment_point_arg, enum LDKCOption_NoneZ require_confirmed_inputs_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_new")] public static extern long AcceptChannelV2_new(long _common_fields_arg, long _funding_satoshis_arg, long _second_per_commitment_point_arg, COption_NoneZ _require_confirmed_inputs_arg); // uint64_t AcceptChannelV2_clone_ptr(LDKAcceptChannelV2 *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_clone_ptr")] public static extern long AcceptChannelV2_clone_ptr(long _arg); // struct LDKAcceptChannelV2 AcceptChannelV2_clone(const struct LDKAcceptChannelV2 *NONNULL_PTR orig); @@ -7836,9 +8506,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannelV2_eq")] public static extern bool AcceptChannelV2_eq(long _a, long _b); // void FundingCreated_free(struct LDKFundingCreated this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_free")] public static extern void FundingCreated_free(long _this_obj); - // const uint8_t (*FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId FundingCreated_get_temporary_channel_id(const struct LDKFundingCreated *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_temporary_channel_id")] public static extern long FundingCreated_get_temporary_channel_id(long _this_ptr); - // void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void FundingCreated_set_temporary_channel_id(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_temporary_channel_id")] public static extern void FundingCreated_set_temporary_channel_id(long _this_ptr, long _val); // const uint8_t (*FundingCreated_get_funding_txid(const struct LDKFundingCreated *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_funding_txid")] public static extern long FundingCreated_get_funding_txid(long _this_ptr); @@ -7852,7 +8522,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_get_signature")] public static extern long FundingCreated_get_signature(long _this_ptr); // void FundingCreated_set_signature(struct LDKFundingCreated *NONNULL_PTR this_ptr, struct LDKECDSASignature val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_set_signature")] public static extern void FundingCreated_set_signature(long _this_ptr, long _val); - // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKThirtyTwoBytes temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg); + // MUST_USE_RES struct LDKFundingCreated FundingCreated_new(struct LDKChannelId temporary_channel_id_arg, struct LDKThirtyTwoBytes funding_txid_arg, uint16_t funding_output_index_arg, struct LDKECDSASignature signature_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_new")] public static extern long FundingCreated_new(long _temporary_channel_id_arg, long _funding_txid_arg, short _funding_output_index_arg, long _signature_arg); // uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_clone_ptr")] public static extern long FundingCreated_clone_ptr(long _arg); @@ -7864,15 +8534,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingCreated_eq")] public static extern bool FundingCreated_eq(long _a, long _b); // void FundingSigned_free(struct LDKFundingSigned this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_free")] public static extern void FundingSigned_free(long _this_obj); - // const uint8_t (*FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId FundingSigned_get_channel_id(const struct LDKFundingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_get_channel_id")] public static extern long FundingSigned_get_channel_id(long _this_ptr); - // void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void FundingSigned_set_channel_id(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_set_channel_id")] public static extern void FundingSigned_set_channel_id(long _this_ptr, long _val); // struct LDKECDSASignature FundingSigned_get_signature(const struct LDKFundingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_get_signature")] public static extern long FundingSigned_get_signature(long _this_ptr); // void FundingSigned_set_signature(struct LDKFundingSigned *NONNULL_PTR this_ptr, struct LDKECDSASignature val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_set_signature")] public static extern void FundingSigned_set_signature(long _this_ptr, long _val); - // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg); + // MUST_USE_RES struct LDKFundingSigned FundingSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_new")] public static extern long FundingSigned_new(long _channel_id_arg, long _signature_arg); // uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_clone_ptr")] public static extern long FundingSigned_clone_ptr(long _arg); @@ -7884,9 +8554,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_FundingSigned_eq")] public static extern bool FundingSigned_eq(long _a, long _b); // void ChannelReady_free(struct LDKChannelReady this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_free")] public static extern void ChannelReady_free(long _this_obj); - // const uint8_t (*ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId ChannelReady_get_channel_id(const struct LDKChannelReady *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_get_channel_id")] public static extern long ChannelReady_get_channel_id(long _this_ptr); - // void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void ChannelReady_set_channel_id(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_channel_id")] public static extern void ChannelReady_set_channel_id(long _this_ptr, long _val); // struct LDKPublicKey ChannelReady_get_next_per_commitment_point(const struct LDKChannelReady *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_get_next_per_commitment_point")] public static extern long ChannelReady_get_next_per_commitment_point(long _this_ptr); @@ -7896,7 +8566,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_get_short_channel_id_alias")] public static extern long ChannelReady_get_short_channel_id_alias(long _this_ptr); // void ChannelReady_set_short_channel_id_alias(struct LDKChannelReady *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_set_short_channel_id_alias")] public static extern void ChannelReady_set_short_channel_id_alias(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg); + // MUST_USE_RES struct LDKChannelReady ChannelReady_new(struct LDKChannelId channel_id_arg, struct LDKPublicKey next_per_commitment_point_arg, struct LDKCOption_u64Z short_channel_id_alias_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_new")] public static extern long ChannelReady_new(long _channel_id_arg, long _next_per_commitment_point_arg, long _short_channel_id_alias_arg); // uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_clone_ptr")] public static extern long ChannelReady_clone_ptr(long _arg); @@ -7908,15 +8578,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReady_eq")] public static extern bool ChannelReady_eq(long _a, long _b); // void Stfu_free(struct LDKStfu this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_free")] public static extern void Stfu_free(long _this_obj); - // const uint8_t (*Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId Stfu_get_channel_id(const struct LDKStfu *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_get_channel_id")] public static extern long Stfu_get_channel_id(long _this_ptr); - // void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void Stfu_set_channel_id(struct LDKStfu *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_set_channel_id")] public static extern void Stfu_set_channel_id(long _this_ptr, long _val); // uint8_t Stfu_get_initiator(const struct LDKStfu *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_get_initiator")] public static extern byte Stfu_get_initiator(long _this_ptr); // void Stfu_set_initiator(struct LDKStfu *NONNULL_PTR this_ptr, uint8_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_set_initiator")] public static extern void Stfu_set_initiator(long _this_ptr, byte _val); - // MUST_USE_RES struct LDKStfu Stfu_new(struct LDKThirtyTwoBytes channel_id_arg, uint8_t initiator_arg); + // MUST_USE_RES struct LDKStfu Stfu_new(struct LDKChannelId channel_id_arg, uint8_t initiator_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_new")] public static extern long Stfu_new(long _channel_id_arg, byte _initiator_arg); // uint64_t Stfu_clone_ptr(LDKStfu *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_clone_ptr")] public static extern long Stfu_clone_ptr(long _arg); @@ -7926,9 +8596,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Stfu_eq")] public static extern bool Stfu_eq(long _a, long _b); // void Splice_free(struct LDKSplice this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_free")] public static extern void Splice_free(long _this_obj); - // const uint8_t (*Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId Splice_get_channel_id(const struct LDKSplice *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_get_channel_id")] public static extern long Splice_get_channel_id(long _this_ptr); - // void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void Splice_set_channel_id(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_set_channel_id")] public static extern void Splice_set_channel_id(long _this_ptr, long _val); // const uint8_t (*Splice_get_chain_hash(const struct LDKSplice *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_get_chain_hash")] public static extern long Splice_get_chain_hash(long _this_ptr); @@ -7950,7 +8620,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_get_funding_pubkey")] public static extern long Splice_get_funding_pubkey(long _this_ptr); // void Splice_set_funding_pubkey(struct LDKSplice *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_set_funding_pubkey")] public static extern void Splice_set_funding_pubkey(long _this_ptr, long _val); - // MUST_USE_RES struct LDKSplice Splice_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg); + // MUST_USE_RES struct LDKSplice Splice_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, uint32_t funding_feerate_perkw_arg, uint32_t locktime_arg, struct LDKPublicKey funding_pubkey_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_new")] public static extern long Splice_new(long _channel_id_arg, long _chain_hash_arg, long _relative_satoshis_arg, int _funding_feerate_perkw_arg, int _locktime_arg, long _funding_pubkey_arg); // uint64_t Splice_clone_ptr(LDKSplice *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_clone_ptr")] public static extern long Splice_clone_ptr(long _arg); @@ -7960,9 +8630,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Splice_eq")] public static extern bool Splice_eq(long _a, long _b); // void SpliceAck_free(struct LDKSpliceAck this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_free")] public static extern void SpliceAck_free(long _this_obj); - // const uint8_t (*SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId SpliceAck_get_channel_id(const struct LDKSpliceAck *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_get_channel_id")] public static extern long SpliceAck_get_channel_id(long _this_ptr); - // void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void SpliceAck_set_channel_id(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_set_channel_id")] public static extern void SpliceAck_set_channel_id(long _this_ptr, long _val); // const uint8_t (*SpliceAck_get_chain_hash(const struct LDKSpliceAck *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_get_chain_hash")] public static extern long SpliceAck_get_chain_hash(long _this_ptr); @@ -7976,7 +8646,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_get_funding_pubkey")] public static extern long SpliceAck_get_funding_pubkey(long _this_ptr); // void SpliceAck_set_funding_pubkey(struct LDKSpliceAck *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_set_funding_pubkey")] public static extern void SpliceAck_set_funding_pubkey(long _this_ptr, long _val); - // MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg); + // MUST_USE_RES struct LDKSpliceAck SpliceAck_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes chain_hash_arg, int64_t relative_satoshis_arg, struct LDKPublicKey funding_pubkey_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_new")] public static extern long SpliceAck_new(long _channel_id_arg, long _chain_hash_arg, long _relative_satoshis_arg, long _funding_pubkey_arg); // uint64_t SpliceAck_clone_ptr(LDKSpliceAck *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_clone_ptr")] public static extern long SpliceAck_clone_ptr(long _arg); @@ -7986,11 +8656,11 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceAck_eq")] public static extern bool SpliceAck_eq(long _a, long _b); // void SpliceLocked_free(struct LDKSpliceLocked this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_free")] public static extern void SpliceLocked_free(long _this_obj); - // const uint8_t (*SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId SpliceLocked_get_channel_id(const struct LDKSpliceLocked *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_get_channel_id")] public static extern long SpliceLocked_get_channel_id(long _this_ptr); - // void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void SpliceLocked_set_channel_id(struct LDKSpliceLocked *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_set_channel_id")] public static extern void SpliceLocked_set_channel_id(long _this_ptr, long _val); - // MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKThirtyTwoBytes channel_id_arg); + // MUST_USE_RES struct LDKSpliceLocked SpliceLocked_new(struct LDKChannelId channel_id_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_new")] public static extern long SpliceLocked_new(long _channel_id_arg); // uint64_t SpliceLocked_clone_ptr(LDKSpliceLocked *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_clone_ptr")] public static extern long SpliceLocked_clone_ptr(long _arg); @@ -8000,9 +8670,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SpliceLocked_eq")] public static extern bool SpliceLocked_eq(long _a, long _b); // void TxAddInput_free(struct LDKTxAddInput this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_free")] public static extern void TxAddInput_free(long _this_obj); - // const uint8_t (*TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxAddInput_get_channel_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_channel_id")] public static extern long TxAddInput_get_channel_id(long _this_ptr); - // void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxAddInput_set_channel_id(struct LDKTxAddInput *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_channel_id")] public static extern void TxAddInput_set_channel_id(long _this_ptr, long _val); // uint64_t TxAddInput_get_serial_id(const struct LDKTxAddInput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_serial_id")] public static extern long TxAddInput_get_serial_id(long _this_ptr); @@ -8020,7 +8690,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_get_sequence")] public static extern int TxAddInput_get_sequence(long _this_ptr); // void TxAddInput_set_sequence(struct LDKTxAddInput *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_set_sequence")] public static extern void TxAddInput_set_sequence(long _this_ptr, int _val); - // MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg); + // MUST_USE_RES struct LDKTxAddInput TxAddInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, struct LDKTransactionU16LenLimited prevtx_arg, uint32_t prevtx_out_arg, uint32_t sequence_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_new")] public static extern long TxAddInput_new(long _channel_id_arg, long _serial_id_arg, long _prevtx_arg, int _prevtx_out_arg, int _sequence_arg); // uint64_t TxAddInput_clone_ptr(LDKTxAddInput *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_clone_ptr")] public static extern long TxAddInput_clone_ptr(long _arg); @@ -8032,9 +8702,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddInput_eq")] public static extern bool TxAddInput_eq(long _a, long _b); // void TxAddOutput_free(struct LDKTxAddOutput this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_free")] public static extern void TxAddOutput_free(long _this_obj); - // const uint8_t (*TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxAddOutput_get_channel_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_channel_id")] public static extern long TxAddOutput_get_channel_id(long _this_ptr); - // void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxAddOutput_set_channel_id(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_set_channel_id")] public static extern void TxAddOutput_set_channel_id(long _this_ptr, long _val); // uint64_t TxAddOutput_get_serial_id(const struct LDKTxAddOutput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_serial_id")] public static extern long TxAddOutput_get_serial_id(long _this_ptr); @@ -8048,7 +8718,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_get_script")] public static extern long TxAddOutput_get_script(long _this_ptr); // void TxAddOutput_set_script(struct LDKTxAddOutput *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_set_script")] public static extern void TxAddOutput_set_script(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg); + // MUST_USE_RES struct LDKTxAddOutput TxAddOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg, uint64_t sats_arg, struct LDKCVec_u8Z script_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_new")] public static extern long TxAddOutput_new(long _channel_id_arg, long _serial_id_arg, long _sats_arg, long _script_arg); // uint64_t TxAddOutput_clone_ptr(LDKTxAddOutput *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_clone_ptr")] public static extern long TxAddOutput_clone_ptr(long _arg); @@ -8060,15 +8730,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAddOutput_eq")] public static extern bool TxAddOutput_eq(long _a, long _b); // void TxRemoveInput_free(struct LDKTxRemoveInput this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_free")] public static extern void TxRemoveInput_free(long _this_obj); - // const uint8_t (*TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxRemoveInput_get_channel_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_get_channel_id")] public static extern long TxRemoveInput_get_channel_id(long _this_ptr); - // void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxRemoveInput_set_channel_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_set_channel_id")] public static extern void TxRemoveInput_set_channel_id(long _this_ptr, long _val); // uint64_t TxRemoveInput_get_serial_id(const struct LDKTxRemoveInput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_get_serial_id")] public static extern long TxRemoveInput_get_serial_id(long _this_ptr); // void TxRemoveInput_set_serial_id(struct LDKTxRemoveInput *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_set_serial_id")] public static extern void TxRemoveInput_set_serial_id(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg); + // MUST_USE_RES struct LDKTxRemoveInput TxRemoveInput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_new")] public static extern long TxRemoveInput_new(long _channel_id_arg, long _serial_id_arg); // uint64_t TxRemoveInput_clone_ptr(LDKTxRemoveInput *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_clone_ptr")] public static extern long TxRemoveInput_clone_ptr(long _arg); @@ -8080,15 +8750,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveInput_eq")] public static extern bool TxRemoveInput_eq(long _a, long _b); // void TxRemoveOutput_free(struct LDKTxRemoveOutput this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_free")] public static extern void TxRemoveOutput_free(long _this_obj); - // const uint8_t (*TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxRemoveOutput_get_channel_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_get_channel_id")] public static extern long TxRemoveOutput_get_channel_id(long _this_ptr); - // void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxRemoveOutput_set_channel_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_set_channel_id")] public static extern void TxRemoveOutput_set_channel_id(long _this_ptr, long _val); // uint64_t TxRemoveOutput_get_serial_id(const struct LDKTxRemoveOutput *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_get_serial_id")] public static extern long TxRemoveOutput_get_serial_id(long _this_ptr); // void TxRemoveOutput_set_serial_id(struct LDKTxRemoveOutput *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_set_serial_id")] public static extern void TxRemoveOutput_set_serial_id(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t serial_id_arg); + // MUST_USE_RES struct LDKTxRemoveOutput TxRemoveOutput_new(struct LDKChannelId channel_id_arg, uint64_t serial_id_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_new")] public static extern long TxRemoveOutput_new(long _channel_id_arg, long _serial_id_arg); // uint64_t TxRemoveOutput_clone_ptr(LDKTxRemoveOutput *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_clone_ptr")] public static extern long TxRemoveOutput_clone_ptr(long _arg); @@ -8100,11 +8770,11 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxRemoveOutput_eq")] public static extern bool TxRemoveOutput_eq(long _a, long _b); // void TxComplete_free(struct LDKTxComplete this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_free")] public static extern void TxComplete_free(long _this_obj); - // const uint8_t (*TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxComplete_get_channel_id(const struct LDKTxComplete *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_get_channel_id")] public static extern long TxComplete_get_channel_id(long _this_ptr); - // void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxComplete_set_channel_id(struct LDKTxComplete *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_set_channel_id")] public static extern void TxComplete_set_channel_id(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKThirtyTwoBytes channel_id_arg); + // MUST_USE_RES struct LDKTxComplete TxComplete_new(struct LDKChannelId channel_id_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_new")] public static extern long TxComplete_new(long _channel_id_arg); // uint64_t TxComplete_clone_ptr(LDKTxComplete *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_clone_ptr")] public static extern long TxComplete_clone_ptr(long _arg); @@ -8116,9 +8786,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxComplete_eq")] public static extern bool TxComplete_eq(long _a, long _b); // void TxSignatures_free(struct LDKTxSignatures this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_free")] public static extern void TxSignatures_free(long _this_obj); - // const uint8_t (*TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxSignatures_get_channel_id(const struct LDKTxSignatures *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_channel_id")] public static extern long TxSignatures_get_channel_id(long _this_ptr); - // void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxSignatures_set_channel_id(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_channel_id")] public static extern void TxSignatures_set_channel_id(long _this_ptr, long _val); // const uint8_t (*TxSignatures_get_tx_hash(const struct LDKTxSignatures *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_tx_hash")] public static extern long TxSignatures_get_tx_hash(long _this_ptr); @@ -8128,8 +8798,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_witnesses")] public static extern long TxSignatures_get_witnesses(long _this_ptr); // void TxSignatures_set_witnesses(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCVec_WitnessZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_witnesses")] public static extern void TxSignatures_set_witnesses(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_new")] public static extern long TxSignatures_new(long _channel_id_arg, long _tx_hash_arg, long _witnesses_arg); + // struct LDKCOption_ECDSASignatureZ TxSignatures_get_funding_outpoint_sig(const struct LDKTxSignatures *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_get_funding_outpoint_sig")] public static extern long TxSignatures_get_funding_outpoint_sig(long _this_ptr); + // void TxSignatures_set_funding_outpoint_sig(struct LDKTxSignatures *NONNULL_PTR this_ptr, struct LDKCOption_ECDSASignatureZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_set_funding_outpoint_sig")] public static extern void TxSignatures_set_funding_outpoint_sig(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTxSignatures TxSignatures_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes tx_hash_arg, struct LDKCVec_WitnessZ witnesses_arg, struct LDKCOption_ECDSASignatureZ funding_outpoint_sig_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_new")] public static extern long TxSignatures_new(long _channel_id_arg, long _tx_hash_arg, long _witnesses_arg, long _funding_outpoint_sig_arg); // uint64_t TxSignatures_clone_ptr(LDKTxSignatures *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_clone_ptr")] public static extern long TxSignatures_clone_ptr(long _arg); // struct LDKTxSignatures TxSignatures_clone(const struct LDKTxSignatures *NONNULL_PTR orig); @@ -8140,9 +8814,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxSignatures_eq")] public static extern bool TxSignatures_eq(long _a, long _b); // void TxInitRbf_free(struct LDKTxInitRbf this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_free")] public static extern void TxInitRbf_free(long _this_obj); - // const uint8_t (*TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxInitRbf_get_channel_id(const struct LDKTxInitRbf *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_channel_id")] public static extern long TxInitRbf_get_channel_id(long _this_ptr); - // void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxInitRbf_set_channel_id(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_set_channel_id")] public static extern void TxInitRbf_set_channel_id(long _this_ptr, long _val); // uint32_t TxInitRbf_get_locktime(const struct LDKTxInitRbf *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_locktime")] public static extern int TxInitRbf_get_locktime(long _this_ptr); @@ -8156,7 +8830,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_get_funding_output_contribution")] public static extern long TxInitRbf_get_funding_output_contribution(long _this_ptr); // void TxInitRbf_set_funding_output_contribution(struct LDKTxInitRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_set_funding_output_contribution")] public static extern void TxInitRbf_set_funding_output_contribution(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg); + // MUST_USE_RES struct LDKTxInitRbf TxInitRbf_new(struct LDKChannelId channel_id_arg, uint32_t locktime_arg, uint32_t feerate_sat_per_1000_weight_arg, struct LDKCOption_i64Z funding_output_contribution_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_new")] public static extern long TxInitRbf_new(long _channel_id_arg, int _locktime_arg, int _feerate_sat_per_1000_weight_arg, long _funding_output_contribution_arg); // uint64_t TxInitRbf_clone_ptr(LDKTxInitRbf *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_clone_ptr")] public static extern long TxInitRbf_clone_ptr(long _arg); @@ -8168,15 +8842,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxInitRbf_eq")] public static extern bool TxInitRbf_eq(long _a, long _b); // void TxAckRbf_free(struct LDKTxAckRbf this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_free")] public static extern void TxAckRbf_free(long _this_obj); - // const uint8_t (*TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxAckRbf_get_channel_id(const struct LDKTxAckRbf *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_get_channel_id")] public static extern long TxAckRbf_get_channel_id(long _this_ptr); - // void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxAckRbf_set_channel_id(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_set_channel_id")] public static extern void TxAckRbf_set_channel_id(long _this_ptr, long _val); // struct LDKCOption_i64Z TxAckRbf_get_funding_output_contribution(const struct LDKTxAckRbf *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_get_funding_output_contribution")] public static extern long TxAckRbf_get_funding_output_contribution(long _this_ptr); // void TxAckRbf_set_funding_output_contribution(struct LDKTxAckRbf *NONNULL_PTR this_ptr, struct LDKCOption_i64Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_set_funding_output_contribution")] public static extern void TxAckRbf_set_funding_output_contribution(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg); + // MUST_USE_RES struct LDKTxAckRbf TxAckRbf_new(struct LDKChannelId channel_id_arg, struct LDKCOption_i64Z funding_output_contribution_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_new")] public static extern long TxAckRbf_new(long _channel_id_arg, long _funding_output_contribution_arg); // uint64_t TxAckRbf_clone_ptr(LDKTxAckRbf *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_clone_ptr")] public static extern long TxAckRbf_clone_ptr(long _arg); @@ -8188,15 +8862,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAckRbf_eq")] public static extern bool TxAckRbf_eq(long _a, long _b); // void TxAbort_free(struct LDKTxAbort this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_free")] public static extern void TxAbort_free(long _this_obj); - // const uint8_t (*TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId TxAbort_get_channel_id(const struct LDKTxAbort *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_get_channel_id")] public static extern long TxAbort_get_channel_id(long _this_ptr); - // void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void TxAbort_set_channel_id(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_set_channel_id")] public static extern void TxAbort_set_channel_id(long _this_ptr, long _val); // struct LDKCVec_u8Z TxAbort_get_data(const struct LDKTxAbort *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_get_data")] public static extern long TxAbort_get_data(long _this_ptr); // void TxAbort_set_data(struct LDKTxAbort *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_set_data")] public static extern void TxAbort_set_data(long _this_ptr, long _val); - // MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z data_arg); + // MUST_USE_RES struct LDKTxAbort TxAbort_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z data_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_new")] public static extern long TxAbort_new(long _channel_id_arg, long _data_arg); // uint64_t TxAbort_clone_ptr(LDKTxAbort *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_clone_ptr")] public static extern long TxAbort_clone_ptr(long _arg); @@ -8208,15 +8882,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TxAbort_eq")] public static extern bool TxAbort_eq(long _a, long _b); // void Shutdown_free(struct LDKShutdown this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_free")] public static extern void Shutdown_free(long _this_obj); - // const uint8_t (*Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId Shutdown_get_channel_id(const struct LDKShutdown *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_get_channel_id")] public static extern long Shutdown_get_channel_id(long _this_ptr); - // void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void Shutdown_set_channel_id(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_set_channel_id")] public static extern void Shutdown_set_channel_id(long _this_ptr, long _val); // struct LDKCVec_u8Z Shutdown_get_scriptpubkey(const struct LDKShutdown *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_get_scriptpubkey")] public static extern long Shutdown_get_scriptpubkey(long _this_ptr); // void Shutdown_set_scriptpubkey(struct LDKShutdown *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_set_scriptpubkey")] public static extern void Shutdown_set_scriptpubkey(long _this_ptr, long _val); - // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); + // MUST_USE_RES struct LDKShutdown Shutdown_new(struct LDKChannelId channel_id_arg, struct LDKCVec_u8Z scriptpubkey_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_new")] public static extern long Shutdown_new(long _channel_id_arg, long _scriptpubkey_arg); // uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Shutdown_clone_ptr")] public static extern long Shutdown_clone_ptr(long _arg); @@ -8248,9 +8922,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSignedFeeRange_eq")] public static extern bool ClosingSignedFeeRange_eq(long _a, long _b); // void ClosingSigned_free(struct LDKClosingSigned this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_free")] public static extern void ClosingSigned_free(long _this_obj); - // const uint8_t (*ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId ClosingSigned_get_channel_id(const struct LDKClosingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_channel_id")] public static extern long ClosingSigned_get_channel_id(long _this_ptr); - // void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void ClosingSigned_set_channel_id(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_channel_id")] public static extern void ClosingSigned_set_channel_id(long _this_ptr, long _val); // uint64_t ClosingSigned_get_fee_satoshis(const struct LDKClosingSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_fee_satoshis")] public static extern long ClosingSigned_get_fee_satoshis(long _this_ptr); @@ -8264,7 +8938,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_get_fee_range")] public static extern long ClosingSigned_get_fee_range(long _this_ptr); // void ClosingSigned_set_fee_range(struct LDKClosingSigned *NONNULL_PTR this_ptr, struct LDKClosingSignedFeeRange val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_set_fee_range")] public static extern void ClosingSigned_set_fee_range(long _this_ptr, long _val); - // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg); + // MUST_USE_RES struct LDKClosingSigned ClosingSigned_new(struct LDKChannelId channel_id_arg, uint64_t fee_satoshis_arg, struct LDKECDSASignature signature_arg, struct LDKClosingSignedFeeRange fee_range_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_new")] public static extern long ClosingSigned_new(long _channel_id_arg, long _fee_satoshis_arg, long _signature_arg, long _fee_range_arg); // uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_clone_ptr")] public static extern long ClosingSigned_clone_ptr(long _arg); @@ -8276,9 +8950,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosingSigned_eq")] public static extern bool ClosingSigned_eq(long _a, long _b); // void UpdateAddHTLC_free(struct LDKUpdateAddHTLC this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_free")] public static extern void UpdateAddHTLC_free(long _this_obj); - // const uint8_t (*UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId UpdateAddHTLC_get_channel_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_channel_id")] public static extern long UpdateAddHTLC_get_channel_id(long _this_ptr); - // void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void UpdateAddHTLC_set_channel_id(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_channel_id")] public static extern void UpdateAddHTLC_set_channel_id(long _this_ptr, long _val); // uint64_t UpdateAddHTLC_get_htlc_id(const struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_htlc_id")] public static extern long UpdateAddHTLC_get_htlc_id(long _this_ptr); @@ -8308,7 +8982,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_get_blinding_point")] public static extern long UpdateAddHTLC_get_blinding_point(long _this_ptr); // void UpdateAddHTLC_set_blinding_point(struct LDKUpdateAddHTLC *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_set_blinding_point")] public static extern void UpdateAddHTLC_set_blinding_point(long _this_ptr, long _val); - // MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg); + // MUST_USE_RES struct LDKUpdateAddHTLC UpdateAddHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, uint64_t amount_msat_arg, struct LDKThirtyTwoBytes payment_hash_arg, uint32_t cltv_expiry_arg, struct LDKCOption_u64Z skimmed_fee_msat_arg, struct LDKOnionPacket onion_routing_packet_arg, struct LDKPublicKey blinding_point_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_new")] public static extern long UpdateAddHTLC_new(long _channel_id_arg, long _htlc_id_arg, long _amount_msat_arg, long _payment_hash_arg, int _cltv_expiry_arg, long _skimmed_fee_msat_arg, long _onion_routing_packet_arg, long _blinding_point_arg); // uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateAddHTLC_clone_ptr")] public static extern long UpdateAddHTLC_clone_ptr(long _arg); @@ -8340,9 +9014,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessage_eq")] public static extern bool OnionMessage_eq(long _a, long _b); // void UpdateFulfillHTLC_free(struct LDKUpdateFulfillHTLC this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_free")] public static extern void UpdateFulfillHTLC_free(long _this_obj); - // const uint8_t (*UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId UpdateFulfillHTLC_get_channel_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_get_channel_id")] public static extern long UpdateFulfillHTLC_get_channel_id(long _this_ptr); - // void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void UpdateFulfillHTLC_set_channel_id(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_set_channel_id")] public static extern void UpdateFulfillHTLC_set_channel_id(long _this_ptr, long _val); // uint64_t UpdateFulfillHTLC_get_htlc_id(const struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_get_htlc_id")] public static extern long UpdateFulfillHTLC_get_htlc_id(long _this_ptr); @@ -8352,7 +9026,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_get_payment_preimage")] public static extern long UpdateFulfillHTLC_get_payment_preimage(long _this_ptr); // void UpdateFulfillHTLC_set_payment_preimage(struct LDKUpdateFulfillHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_set_payment_preimage")] public static extern void UpdateFulfillHTLC_set_payment_preimage(long _this_ptr, long _val); - // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); + // MUST_USE_RES struct LDKUpdateFulfillHTLC UpdateFulfillHTLC_new(struct LDKChannelId channel_id_arg, uint64_t htlc_id_arg, struct LDKThirtyTwoBytes payment_preimage_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_new")] public static extern long UpdateFulfillHTLC_new(long _channel_id_arg, long _htlc_id_arg, long _payment_preimage_arg); // uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_clone_ptr")] public static extern long UpdateFulfillHTLC_clone_ptr(long _arg); @@ -8364,9 +9038,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFulfillHTLC_eq")] public static extern bool UpdateFulfillHTLC_eq(long _a, long _b); // void UpdateFailHTLC_free(struct LDKUpdateFailHTLC this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_free")] public static extern void UpdateFailHTLC_free(long _this_obj); - // const uint8_t (*UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId UpdateFailHTLC_get_channel_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_get_channel_id")] public static extern long UpdateFailHTLC_get_channel_id(long _this_ptr); - // void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void UpdateFailHTLC_set_channel_id(struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_set_channel_id")] public static extern void UpdateFailHTLC_set_channel_id(long _this_ptr, long _val); // uint64_t UpdateFailHTLC_get_htlc_id(const struct LDKUpdateFailHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_get_htlc_id")] public static extern long UpdateFailHTLC_get_htlc_id(long _this_ptr); @@ -8382,9 +9056,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailHTLC_eq")] public static extern bool UpdateFailHTLC_eq(long _a, long _b); // void UpdateFailMalformedHTLC_free(struct LDKUpdateFailMalformedHTLC this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_free")] public static extern void UpdateFailMalformedHTLC_free(long _this_obj); - // const uint8_t (*UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId UpdateFailMalformedHTLC_get_channel_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_get_channel_id")] public static extern long UpdateFailMalformedHTLC_get_channel_id(long _this_ptr); - // void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void UpdateFailMalformedHTLC_set_channel_id(struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_set_channel_id")] public static extern void UpdateFailMalformedHTLC_set_channel_id(long _this_ptr, long _val); // uint64_t UpdateFailMalformedHTLC_get_htlc_id(const struct LDKUpdateFailMalformedHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_get_htlc_id")] public static extern long UpdateFailMalformedHTLC_get_htlc_id(long _this_ptr); @@ -8404,9 +9078,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFailMalformedHTLC_eq")] public static extern bool UpdateFailMalformedHTLC_eq(long _a, long _b); // void CommitmentSigned_free(struct LDKCommitmentSigned this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_free")] public static extern void CommitmentSigned_free(long _this_obj); - // const uint8_t (*CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId CommitmentSigned_get_channel_id(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_channel_id")] public static extern long CommitmentSigned_get_channel_id(long _this_ptr); - // void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void CommitmentSigned_set_channel_id(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_channel_id")] public static extern void CommitmentSigned_set_channel_id(long _this_ptr, long _val); // struct LDKECDSASignature CommitmentSigned_get_signature(const struct LDKCommitmentSigned *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_signature")] public static extern long CommitmentSigned_get_signature(long _this_ptr); @@ -8416,7 +9090,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_get_htlc_signatures")] public static extern long CommitmentSigned_get_htlc_signatures(long _this_ptr); // void CommitmentSigned_set_htlc_signatures(struct LDKCommitmentSigned *NONNULL_PTR this_ptr, struct LDKCVec_ECDSASignatureZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_set_htlc_signatures")] public static extern void CommitmentSigned_set_htlc_signatures(long _this_ptr, long _val); - // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg); + // MUST_USE_RES struct LDKCommitmentSigned CommitmentSigned_new(struct LDKChannelId channel_id_arg, struct LDKECDSASignature signature_arg, struct LDKCVec_ECDSASignatureZ htlc_signatures_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_new")] public static extern long CommitmentSigned_new(long _channel_id_arg, long _signature_arg, long _htlc_signatures_arg); // uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_clone_ptr")] public static extern long CommitmentSigned_clone_ptr(long _arg); @@ -8428,9 +9102,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_CommitmentSigned_eq")] public static extern bool CommitmentSigned_eq(long _a, long _b); // void RevokeAndACK_free(struct LDKRevokeAndACK this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_free")] public static extern void RevokeAndACK_free(long _this_obj); - // const uint8_t (*RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId RevokeAndACK_get_channel_id(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_get_channel_id")] public static extern long RevokeAndACK_get_channel_id(long _this_ptr); - // void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void RevokeAndACK_set_channel_id(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_channel_id")] public static extern void RevokeAndACK_set_channel_id(long _this_ptr, long _val); // const uint8_t (*RevokeAndACK_get_per_commitment_secret(const struct LDKRevokeAndACK *NONNULL_PTR this_ptr))[32]; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_get_per_commitment_secret")] public static extern long RevokeAndACK_get_per_commitment_secret(long _this_ptr); @@ -8440,7 +9114,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_get_next_per_commitment_point")] public static extern long RevokeAndACK_get_next_per_commitment_point(long _this_ptr); // void RevokeAndACK_set_next_per_commitment_point(struct LDKRevokeAndACK *NONNULL_PTR this_ptr, struct LDKPublicKey val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_set_next_per_commitment_point")] public static extern void RevokeAndACK_set_next_per_commitment_point(long _this_ptr, long _val); - // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); + // MUST_USE_RES struct LDKRevokeAndACK RevokeAndACK_new(struct LDKChannelId channel_id_arg, struct LDKThirtyTwoBytes per_commitment_secret_arg, struct LDKPublicKey next_per_commitment_point_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_new")] public static extern long RevokeAndACK_new(long _channel_id_arg, long _per_commitment_secret_arg, long _next_per_commitment_point_arg); // uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_clone_ptr")] public static extern long RevokeAndACK_clone_ptr(long _arg); @@ -8452,15 +9126,15 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RevokeAndACK_eq")] public static extern bool RevokeAndACK_eq(long _a, long _b); // void UpdateFee_free(struct LDKUpdateFee this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_free")] public static extern void UpdateFee_free(long _this_obj); - // const uint8_t (*UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId UpdateFee_get_channel_id(const struct LDKUpdateFee *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_get_channel_id")] public static extern long UpdateFee_get_channel_id(long _this_ptr); - // void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void UpdateFee_set_channel_id(struct LDKUpdateFee *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_set_channel_id")] public static extern void UpdateFee_set_channel_id(long _this_ptr, long _val); // uint32_t UpdateFee_get_feerate_per_kw(const struct LDKUpdateFee *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_get_feerate_per_kw")] public static extern int UpdateFee_get_feerate_per_kw(long _this_ptr); // void UpdateFee_set_feerate_per_kw(struct LDKUpdateFee *NONNULL_PTR this_ptr, uint32_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_set_feerate_per_kw")] public static extern void UpdateFee_set_feerate_per_kw(long _this_ptr, int _val); - // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKThirtyTwoBytes channel_id_arg, uint32_t feerate_per_kw_arg); + // MUST_USE_RES struct LDKUpdateFee UpdateFee_new(struct LDKChannelId channel_id_arg, uint32_t feerate_per_kw_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_new")] public static extern long UpdateFee_new(long _channel_id_arg, int _feerate_per_kw_arg); // uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_clone_ptr")] public static extern long UpdateFee_clone_ptr(long _arg); @@ -8472,9 +9146,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UpdateFee_eq")] public static extern bool UpdateFee_eq(long _a, long _b); // void ChannelReestablish_free(struct LDKChannelReestablish this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_free")] public static extern void ChannelReestablish_free(long _this_obj); - // const uint8_t (*ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId ChannelReestablish_get_channel_id(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_channel_id")] public static extern long ChannelReestablish_get_channel_id(long _this_ptr); - // void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void ChannelReestablish_set_channel_id(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_channel_id")] public static extern void ChannelReestablish_set_channel_id(long _this_ptr, long _val); // uint64_t ChannelReestablish_get_next_local_commitment_number(const struct LDKChannelReestablish *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_next_local_commitment_number")] public static extern long ChannelReestablish_get_next_local_commitment_number(long _this_ptr); @@ -8496,7 +9170,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_get_next_funding_txid")] public static extern long ChannelReestablish_get_next_funding_txid(long _this_ptr); // void ChannelReestablish_set_next_funding_txid(struct LDKChannelReestablish *NONNULL_PTR this_ptr, struct LDKCOption_ThirtyTwoBytesZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_set_next_funding_txid")] public static extern void ChannelReestablish_set_next_funding_txid(long _this_ptr, long _val); - // MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg); + // MUST_USE_RES struct LDKChannelReestablish ChannelReestablish_new(struct LDKChannelId channel_id_arg, uint64_t next_local_commitment_number_arg, uint64_t next_remote_commitment_number_arg, struct LDKThirtyTwoBytes your_last_per_commitment_secret_arg, struct LDKPublicKey my_current_per_commitment_point_arg, struct LDKCOption_ThirtyTwoBytesZ next_funding_txid_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_new")] public static extern long ChannelReestablish_new(long _channel_id_arg, long _next_local_commitment_number_arg, long _next_remote_commitment_number_arg, long _your_last_per_commitment_secret_arg, long _my_current_per_commitment_point_arg, long _next_funding_txid_arg); // uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_clone_ptr")] public static extern long ChannelReestablish_clone_ptr(long _arg); @@ -8508,9 +9182,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelReestablish_eq")] public static extern bool ChannelReestablish_eq(long _a, long _b); // void AnnouncementSignatures_free(struct LDKAnnouncementSignatures this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_free")] public static extern void AnnouncementSignatures_free(long _this_obj); - // const uint8_t (*AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId AnnouncementSignatures_get_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_channel_id")] public static extern long AnnouncementSignatures_get_channel_id(long _this_ptr); - // void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void AnnouncementSignatures_set_channel_id(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_channel_id")] public static extern void AnnouncementSignatures_set_channel_id(long _this_ptr, long _val); // uint64_t AnnouncementSignatures_get_short_channel_id(const struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_short_channel_id")] public static extern long AnnouncementSignatures_get_short_channel_id(long _this_ptr); @@ -8524,7 +9198,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_get_bitcoin_signature")] public static extern long AnnouncementSignatures_get_bitcoin_signature(long _this_ptr); // void AnnouncementSignatures_set_bitcoin_signature(struct LDKAnnouncementSignatures *NONNULL_PTR this_ptr, struct LDKECDSASignature val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_set_bitcoin_signature")] public static extern void AnnouncementSignatures_set_bitcoin_signature(long _this_ptr, long _val); - // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKThirtyTwoBytes channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg); + // MUST_USE_RES struct LDKAnnouncementSignatures AnnouncementSignatures_new(struct LDKChannelId channel_id_arg, uint64_t short_channel_id_arg, struct LDKECDSASignature node_signature_arg, struct LDKECDSASignature bitcoin_signature_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_new")] public static extern long AnnouncementSignatures_new(long _channel_id_arg, long _short_channel_id_arg, long _node_signature_arg, long _bitcoin_signature_arg); // uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AnnouncementSignatures_clone_ptr")] public static extern long AnnouncementSignatures_clone_ptr(long _arg); @@ -8618,6 +9292,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_addresses")] public static extern long UnsignedNodeAnnouncement_get_addresses(long _this_ptr); // void UnsignedNodeAnnouncement_set_addresses(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_SocketAddressZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_addresses")] public static extern void UnsignedNodeAnnouncement_set_addresses(long _this_ptr, long _val); + // struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_address_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_excess_address_data")] public static extern long UnsignedNodeAnnouncement_get_excess_address_data(long _this_ptr); + // void UnsignedNodeAnnouncement_set_excess_address_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_excess_address_data")] public static extern void UnsignedNodeAnnouncement_set_excess_address_data(long _this_ptr, long _val); + // struct LDKCVec_u8Z UnsignedNodeAnnouncement_get_excess_data(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_get_excess_data")] public static extern long UnsignedNodeAnnouncement_get_excess_data(long _this_ptr); + // void UnsignedNodeAnnouncement_set_excess_data(struct LDKUnsignedNodeAnnouncement *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_set_excess_data")] public static extern void UnsignedNodeAnnouncement_set_excess_data(long _this_ptr, long _val); + // MUST_USE_RES struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_new(struct LDKNodeFeatures features_arg, uint32_t timestamp_arg, struct LDKNodeId node_id_arg, struct LDKThreeBytes rgb_arg, struct LDKNodeAlias alias_arg, struct LDKCVec_SocketAddressZ addresses_arg, struct LDKCVec_u8Z excess_address_data_arg, struct LDKCVec_u8Z excess_data_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_new")] public static extern long UnsignedNodeAnnouncement_new(long _features_arg, int _timestamp_arg, long _node_id_arg, long _rgb_arg, long _alias_arg, long _addresses_arg, long _excess_address_data_arg, long _excess_data_arg); // uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedNodeAnnouncement_clone_ptr")] public static extern long UnsignedNodeAnnouncement_clone_ptr(long _arg); // struct LDKUnsignedNodeAnnouncement UnsignedNodeAnnouncement_clone(const struct LDKUnsignedNodeAnnouncement *NONNULL_PTR orig); @@ -9032,6 +9716,36 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionPacket_hash")] public static extern long OnionPacket_hash(long _o); // bool OnionPacket_eq(const struct LDKOnionPacket *NONNULL_PTR a, const struct LDKOnionPacket *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionPacket_eq")] public static extern bool OnionPacket_eq(long _a, long _b); + // void TrampolineOnionPacket_free(struct LDKTrampolineOnionPacket this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_free")] public static extern void TrampolineOnionPacket_free(long _this_obj); + // uint8_t TrampolineOnionPacket_get_version(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_get_version")] public static extern byte TrampolineOnionPacket_get_version(long _this_ptr); + // void TrampolineOnionPacket_set_version(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, uint8_t val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_set_version")] public static extern void TrampolineOnionPacket_set_version(long _this_ptr, byte _val); + // struct LDKPublicKey TrampolineOnionPacket_get_public_key(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_get_public_key")] public static extern long TrampolineOnionPacket_get_public_key(long _this_ptr); + // void TrampolineOnionPacket_set_public_key(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_set_public_key")] public static extern void TrampolineOnionPacket_set_public_key(long _this_ptr, long _val); + // struct LDKCVec_u8Z TrampolineOnionPacket_get_hop_data(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_get_hop_data")] public static extern long TrampolineOnionPacket_get_hop_data(long _this_ptr); + // void TrampolineOnionPacket_set_hop_data(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKCVec_u8Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_set_hop_data")] public static extern void TrampolineOnionPacket_set_hop_data(long _this_ptr, long _val); + // const uint8_t (*TrampolineOnionPacket_get_hmac(const struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_get_hmac")] public static extern long TrampolineOnionPacket_get_hmac(long _this_ptr); + // void TrampolineOnionPacket_set_hmac(struct LDKTrampolineOnionPacket *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_set_hmac")] public static extern void TrampolineOnionPacket_set_hmac(long _this_ptr, long _val); + // MUST_USE_RES struct LDKTrampolineOnionPacket TrampolineOnionPacket_new(uint8_t version_arg, struct LDKPublicKey public_key_arg, struct LDKCVec_u8Z hop_data_arg, struct LDKThirtyTwoBytes hmac_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_new")] public static extern long TrampolineOnionPacket_new(byte _version_arg, long _public_key_arg, long _hop_data_arg, long _hmac_arg); + // uint64_t TrampolineOnionPacket_clone_ptr(LDKTrampolineOnionPacket *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_clone_ptr")] public static extern long TrampolineOnionPacket_clone_ptr(long _arg); + // struct LDKTrampolineOnionPacket TrampolineOnionPacket_clone(const struct LDKTrampolineOnionPacket *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_clone")] public static extern long TrampolineOnionPacket_clone(long _orig); + // uint64_t TrampolineOnionPacket_hash(const struct LDKTrampolineOnionPacket *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_hash")] public static extern long TrampolineOnionPacket_hash(long _o); + // bool TrampolineOnionPacket_eq(const struct LDKTrampolineOnionPacket *NONNULL_PTR a, const struct LDKTrampolineOnionPacket *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_eq")] public static extern bool TrampolineOnionPacket_eq(long _a, long _b); + // struct LDKCVec_u8Z TrampolineOnionPacket_write(const struct LDKTrampolineOnionPacket *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TrampolineOnionPacket_write")] public static extern long TrampolineOnionPacket_write(long _obj); // struct LDKCVec_u8Z AcceptChannel_write(const struct LDKAcceptChannel *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_AcceptChannel_write")] public static extern long AcceptChannel_write(long _obj); // struct LDKCResult_AcceptChannelDecodeErrorZ AcceptChannel_read(struct LDKu8slice ser); @@ -9294,6 +10008,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_clone")] public static extern long SocketDescriptor_clone(long _orig); // void SocketDescriptor_free(struct LDKSocketDescriptor this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SocketDescriptor_free")] public static extern void SocketDescriptor_free(long _this_ptr); + // void PeerDetails_free(struct LDKPeerDetails this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_free")] public static extern void PeerDetails_free(long _this_obj); + // struct LDKPublicKey PeerDetails_get_counterparty_node_id(const struct LDKPeerDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_get_counterparty_node_id")] public static extern long PeerDetails_get_counterparty_node_id(long _this_ptr); + // void PeerDetails_set_counterparty_node_id(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_set_counterparty_node_id")] public static extern void PeerDetails_set_counterparty_node_id(long _this_ptr, long _val); + // struct LDKCOption_SocketAddressZ PeerDetails_get_socket_address(const struct LDKPeerDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_get_socket_address")] public static extern long PeerDetails_get_socket_address(long _this_ptr); + // void PeerDetails_set_socket_address(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKCOption_SocketAddressZ val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_set_socket_address")] public static extern void PeerDetails_set_socket_address(long _this_ptr, long _val); + // struct LDKInitFeatures PeerDetails_get_init_features(const struct LDKPeerDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_get_init_features")] public static extern long PeerDetails_get_init_features(long _this_ptr); + // void PeerDetails_set_init_features(struct LDKPeerDetails *NONNULL_PTR this_ptr, struct LDKInitFeatures val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_set_init_features")] public static extern void PeerDetails_set_init_features(long _this_ptr, long _val); + // bool PeerDetails_get_is_inbound_connection(const struct LDKPeerDetails *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_get_is_inbound_connection")] public static extern bool PeerDetails_get_is_inbound_connection(long _this_ptr); + // void PeerDetails_set_is_inbound_connection(struct LDKPeerDetails *NONNULL_PTR this_ptr, bool val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_set_is_inbound_connection")] public static extern void PeerDetails_set_is_inbound_connection(long _this_ptr, bool _val); + // MUST_USE_RES struct LDKPeerDetails PeerDetails_new(struct LDKPublicKey counterparty_node_id_arg, struct LDKCOption_SocketAddressZ socket_address_arg, struct LDKInitFeatures init_features_arg, bool is_inbound_connection_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerDetails_new")] public static extern long PeerDetails_new(long _counterparty_node_id_arg, long _socket_address_arg, long _init_features_arg, bool _is_inbound_connection_arg); // void PeerHandleError_free(struct LDKPeerHandleError this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerHandleError_free")] public static extern void PeerHandleError_free(long _this_obj); // MUST_USE_RES struct LDKPeerHandleError PeerHandleError_new(void); @@ -9306,8 +10040,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_free")] public static extern void PeerManager_free(long _this_obj); // MUST_USE_RES struct LDKPeerManager PeerManager_new(struct LDKMessageHandler message_handler, uint32_t current_time, const uint8_t (*ephemeral_random_data)[32], struct LDKLogger logger, struct LDKNodeSigner node_signer); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new")] public static extern long PeerManager_new(long _message_handler, int _current_time, long _ephemeral_random_data, long _logger, long _node_signer); - // MUST_USE_RES struct LDKCVec_C2Tuple_PublicKeyCOption_SocketAddressZZZ PeerManager_get_peer_node_ids(const struct LDKPeerManager *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_get_peer_node_ids")] public static extern long PeerManager_get_peer_node_ids(long _this_arg); + // MUST_USE_RES struct LDKCVec_PeerDetailsZ PeerManager_list_peers(const struct LDKPeerManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_list_peers")] public static extern long PeerManager_list_peers(long _this_arg); + // MUST_USE_RES struct LDKPeerDetails PeerManager_peer_by_node_id(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_peer_by_node_id")] public static extern long PeerManager_peer_by_node_id(long _this_arg, long _their_node_id); // MUST_USE_RES struct LDKCResult_CVec_u8ZPeerHandleErrorZ PeerManager_new_outbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKPublicKey their_node_id, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeerManager_new_outbound_connection")] public static extern long PeerManager_new_outbound_connection(long _this_arg, long _their_node_id, long _descriptor, long _remote_network_address); // MUST_USE_RES struct LDKCResult_NonePeerHandleErrorZ PeerManager_new_inbound_connection(const struct LDKPeerManager *NONNULL_PTR this_arg, struct LDKSocketDescriptor descriptor, struct LDKCOption_SocketAddressZ remote_network_address); @@ -10322,6 +11058,30 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_keysend")] public static extern bool NodeFeatures_supports_keysend(long _this_arg); // MUST_USE_RES bool NodeFeatures_requires_keysend(const struct LDKNodeFeatures *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_keysend")] public static extern bool NodeFeatures_requires_keysend(long _this_arg); + // void InitFeatures_set_trampoline_routing_optional(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_trampoline_routing_optional")] public static extern void InitFeatures_set_trampoline_routing_optional(long _this_arg); + // void InitFeatures_set_trampoline_routing_required(struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_set_trampoline_routing_required")] public static extern void InitFeatures_set_trampoline_routing_required(long _this_arg); + // MUST_USE_RES bool InitFeatures_supports_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_supports_trampoline_routing")] public static extern bool InitFeatures_supports_trampoline_routing(long _this_arg); + // void NodeFeatures_set_trampoline_routing_optional(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_trampoline_routing_optional")] public static extern void NodeFeatures_set_trampoline_routing_optional(long _this_arg); + // void NodeFeatures_set_trampoline_routing_required(struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_set_trampoline_routing_required")] public static extern void NodeFeatures_set_trampoline_routing_required(long _this_arg); + // MUST_USE_RES bool NodeFeatures_supports_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_supports_trampoline_routing")] public static extern bool NodeFeatures_supports_trampoline_routing(long _this_arg); + // void Bolt11InvoiceFeatures_set_trampoline_routing_optional(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_optional")] public static extern void Bolt11InvoiceFeatures_set_trampoline_routing_optional(long _this_arg); + // void Bolt11InvoiceFeatures_set_trampoline_routing_required(struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_set_trampoline_routing_required")] public static extern void Bolt11InvoiceFeatures_set_trampoline_routing_required(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_supports_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_supports_trampoline_routing")] public static extern bool Bolt11InvoiceFeatures_supports_trampoline_routing(long _this_arg); + // MUST_USE_RES bool InitFeatures_requires_trampoline_routing(const struct LDKInitFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InitFeatures_requires_trampoline_routing")] public static extern bool InitFeatures_requires_trampoline_routing(long _this_arg); + // MUST_USE_RES bool NodeFeatures_requires_trampoline_routing(const struct LDKNodeFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeFeatures_requires_trampoline_routing")] public static extern bool NodeFeatures_requires_trampoline_routing(long _this_arg); + // MUST_USE_RES bool Bolt11InvoiceFeatures_requires_trampoline_routing(const struct LDKBolt11InvoiceFeatures *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11InvoiceFeatures_requires_trampoline_routing")] public static extern bool Bolt11InvoiceFeatures_requires_trampoline_routing(long _this_arg); // void ShutdownScript_free(struct LDKShutdownScript this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_free")] public static extern void ShutdownScript_free(long _this_obj); // uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg); @@ -10358,6 +11118,42 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_as_legacy_pubkey")] public static extern long ShutdownScript_as_legacy_pubkey(long _this_arg); // MUST_USE_RES bool ShutdownScript_is_compatible(const struct LDKShutdownScript *NONNULL_PTR this_arg, const struct LDKInitFeatures *NONNULL_PTR features); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ShutdownScript_is_compatible")] public static extern bool ShutdownScript_is_compatible(long _this_arg, long _features); + // void ChannelId_free(struct LDKChannelId this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_free")] public static extern void ChannelId_free(long _this_obj); + // const uint8_t (*ChannelId_get_a(const struct LDKChannelId *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_get_a")] public static extern long ChannelId_get_a(long _this_ptr); + // void ChannelId_set_a(struct LDKChannelId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_set_a")] public static extern void ChannelId_set_a(long _this_ptr, long _val); + // MUST_USE_RES struct LDKChannelId ChannelId_new(struct LDKThirtyTwoBytes a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_new")] public static extern long ChannelId_new(long _a_arg); + // uint64_t ChannelId_clone_ptr(LDKChannelId *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_clone_ptr")] public static extern long ChannelId_clone_ptr(long _arg); + // struct LDKChannelId ChannelId_clone(const struct LDKChannelId *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_clone")] public static extern long ChannelId_clone(long _orig); + // bool ChannelId_eq(const struct LDKChannelId *NONNULL_PTR a, const struct LDKChannelId *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_eq")] public static extern bool ChannelId_eq(long _a, long _b); + // uint64_t ChannelId_hash(const struct LDKChannelId *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_hash")] public static extern long ChannelId_hash(long _o); + // MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_txid(const uint8_t (*txid)[32], uint16_t output_index); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_v1_from_funding_txid")] public static extern long ChannelId_v1_from_funding_txid(long _txid, short _output_index); + // MUST_USE_RES struct LDKChannelId ChannelId_v1_from_funding_outpoint(struct LDKOutPoint outpoint); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_v1_from_funding_outpoint")] public static extern long ChannelId_v1_from_funding_outpoint(long _outpoint); + // MUST_USE_RES struct LDKChannelId ChannelId_temporary_from_entropy_source(const struct LDKEntropySource *NONNULL_PTR entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_temporary_from_entropy_source")] public static extern long ChannelId_temporary_from_entropy_source(long _entropy_source); + // MUST_USE_RES struct LDKChannelId ChannelId_from_bytes(struct LDKThirtyTwoBytes data); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_from_bytes")] public static extern long ChannelId_from_bytes(long _data); + // MUST_USE_RES struct LDKChannelId ChannelId_new_zero(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_new_zero")] public static extern long ChannelId_new_zero(); + // MUST_USE_RES bool ChannelId_is_zero(const struct LDKChannelId *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_is_zero")] public static extern bool ChannelId_is_zero(long _this_arg); + // MUST_USE_RES struct LDKChannelId ChannelId_v2_from_revocation_basepoints(const struct LDKRevocationBasepoint *NONNULL_PTR ours, const struct LDKRevocationBasepoint *NONNULL_PTR theirs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_v2_from_revocation_basepoints")] public static extern long ChannelId_v2_from_revocation_basepoints(long _ours, long _theirs); + // MUST_USE_RES struct LDKChannelId ChannelId_temporary_v2_from_revocation_basepoint(const struct LDKRevocationBasepoint *NONNULL_PTR our_revocation_basepoint); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_temporary_v2_from_revocation_basepoint")] public static extern long ChannelId_temporary_v2_from_revocation_basepoint(long _our_revocation_basepoint); + // struct LDKCVec_u8Z ChannelId_write(const struct LDKChannelId *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_write")] public static extern long ChannelId_write(long _obj); + // struct LDKCResult_ChannelIdDecodeErrorZ ChannelId_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChannelId_read")] public static extern long ChannelId_read(long _ser); // void Retry_free(struct LDKRetry this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Retry_free")] public static extern void Retry_free(long _this_ptr); // uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg); @@ -10452,6 +11248,74 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_clone")] public static extern long Type_clone(long _orig); // void Type_free(struct LDKType this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Type_free")] public static extern void Type_free(long _this_ptr); + // void OfferId_free(struct LDKOfferId this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_free")] public static extern void OfferId_free(long _this_obj); + // const uint8_t (*OfferId_get_a(const struct LDKOfferId *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_get_a")] public static extern long OfferId_get_a(long _this_ptr); + // void OfferId_set_a(struct LDKOfferId *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_set_a")] public static extern void OfferId_set_a(long _this_ptr, long _val); + // MUST_USE_RES struct LDKOfferId OfferId_new(struct LDKThirtyTwoBytes a_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_new")] public static extern long OfferId_new(long _a_arg); + // uint64_t OfferId_clone_ptr(LDKOfferId *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_clone_ptr")] public static extern long OfferId_clone_ptr(long _arg); + // struct LDKOfferId OfferId_clone(const struct LDKOfferId *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_clone")] public static extern long OfferId_clone(long _orig); + // bool OfferId_eq(const struct LDKOfferId *NONNULL_PTR a, const struct LDKOfferId *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_eq")] public static extern bool OfferId_eq(long _a, long _b); + // struct LDKCVec_u8Z OfferId_write(const struct LDKOfferId *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_write")] public static extern long OfferId_write(long _obj); + // struct LDKCResult_OfferIdDecodeErrorZ OfferId_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferId_read")] public static extern long OfferId_read(long _ser); + // void OfferWithExplicitMetadataBuilder_free(struct LDKOfferWithExplicitMetadataBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_free")] public static extern void OfferWithExplicitMetadataBuilder_free(long _this_obj); + // uint64_t OfferWithExplicitMetadataBuilder_clone_ptr(LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_clone_ptr")] public static extern long OfferWithExplicitMetadataBuilder_clone_ptr(long _arg); + // struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_clone(const struct LDKOfferWithExplicitMetadataBuilder *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_clone")] public static extern long OfferWithExplicitMetadataBuilder_clone(long _orig); + // void OfferWithDerivedMetadataBuilder_free(struct LDKOfferWithDerivedMetadataBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_free")] public static extern void OfferWithDerivedMetadataBuilder_free(long _this_obj); + // uint64_t OfferWithDerivedMetadataBuilder_clone_ptr(LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_clone_ptr")] public static extern long OfferWithDerivedMetadataBuilder_clone_ptr(long _arg); + // struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_clone(const struct LDKOfferWithDerivedMetadataBuilder *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_clone")] public static extern long OfferWithDerivedMetadataBuilder_clone(long _orig); + // MUST_USE_RES struct LDKOfferWithExplicitMetadataBuilder OfferWithExplicitMetadataBuilder_new(struct LDKPublicKey signing_pubkey); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_new")] public static extern long OfferWithExplicitMetadataBuilder_new(long _signing_pubkey); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_metadata(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKCVec_u8Z metadata); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_metadata")] public static extern long OfferWithExplicitMetadataBuilder_metadata(long _this_arg, long _metadata); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_chain(struct LDKOfferWithExplicitMetadataBuilder this_arg, enum LDKNetwork network); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_chain")] public static extern void OfferWithExplicitMetadataBuilder_chain(long _this_arg, Network _network); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_amount_msats(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t amount_msats); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_amount_msats")] public static extern void OfferWithExplicitMetadataBuilder_amount_msats(long _this_arg, long _amount_msats); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_absolute_expiry(struct LDKOfferWithExplicitMetadataBuilder this_arg, uint64_t absolute_expiry); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_absolute_expiry")] public static extern void OfferWithExplicitMetadataBuilder_absolute_expiry(long _this_arg, long _absolute_expiry); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_description(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr description); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_description")] public static extern void OfferWithExplicitMetadataBuilder_description(long _this_arg, long _description); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_issuer(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKStr issuer); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_issuer")] public static extern void OfferWithExplicitMetadataBuilder_issuer(long _this_arg, long _issuer); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_path(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKBlindedPath path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_path")] public static extern void OfferWithExplicitMetadataBuilder_path(long _this_arg, long _path); + // MUST_USE_RES void OfferWithExplicitMetadataBuilder_supported_quantity(struct LDKOfferWithExplicitMetadataBuilder this_arg, struct LDKQuantity quantity); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_supported_quantity")] public static extern void OfferWithExplicitMetadataBuilder_supported_quantity(long _this_arg, long _quantity); + // MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithExplicitMetadataBuilder_build(struct LDKOfferWithExplicitMetadataBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithExplicitMetadataBuilder_build")] public static extern long OfferWithExplicitMetadataBuilder_build(long _this_arg); + // MUST_USE_RES struct LDKOfferWithDerivedMetadataBuilder OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_deriving_signing_pubkey")] public static extern long OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(long _node_id, long _expanded_key, long _entropy_source); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_chain(struct LDKOfferWithDerivedMetadataBuilder this_arg, enum LDKNetwork network); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_chain")] public static extern void OfferWithDerivedMetadataBuilder_chain(long _this_arg, Network _network); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_amount_msats(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t amount_msats); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_amount_msats")] public static extern void OfferWithDerivedMetadataBuilder_amount_msats(long _this_arg, long _amount_msats); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_absolute_expiry(struct LDKOfferWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_absolute_expiry")] public static extern void OfferWithDerivedMetadataBuilder_absolute_expiry(long _this_arg, long _absolute_expiry); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_description(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr description); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_description")] public static extern void OfferWithDerivedMetadataBuilder_description(long _this_arg, long _description); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_issuer(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKStr issuer); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_issuer")] public static extern void OfferWithDerivedMetadataBuilder_issuer(long _this_arg, long _issuer); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_path(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_path")] public static extern void OfferWithDerivedMetadataBuilder_path(long _this_arg, long _path); + // MUST_USE_RES void OfferWithDerivedMetadataBuilder_supported_quantity(struct LDKOfferWithDerivedMetadataBuilder this_arg, struct LDKQuantity quantity); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_supported_quantity")] public static extern void OfferWithDerivedMetadataBuilder_supported_quantity(long _this_arg, long _quantity); + // MUST_USE_RES struct LDKCResult_OfferBolt12SemanticErrorZ OfferWithDerivedMetadataBuilder_build(struct LDKOfferWithDerivedMetadataBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OfferWithDerivedMetadataBuilder_build")] public static extern long OfferWithDerivedMetadataBuilder_build(long _this_arg); // void Offer_free(struct LDKOffer this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_free")] public static extern void Offer_free(long _this_obj); // uint64_t Offer_clone_ptr(LDKOffer *NONNULL_PTR arg); @@ -10462,7 +11326,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_chains")] public static extern long Offer_chains(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ Offer_metadata(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_metadata")] public static extern long Offer_metadata(long _this_arg); - // MUST_USE_RES struct LDKAmount Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_AmountZ Offer_amount(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_amount")] public static extern long Offer_amount(long _this_arg); // MUST_USE_RES struct LDKPrintableString Offer_description(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_description")] public static extern long Offer_description(long _this_arg); @@ -10478,6 +11342,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_supported_quantity")] public static extern long Offer_supported_quantity(long _this_arg); // MUST_USE_RES struct LDKPublicKey Offer_signing_pubkey(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_signing_pubkey")] public static extern long Offer_signing_pubkey(long _this_arg); + // MUST_USE_RES struct LDKOfferId Offer_id(const struct LDKOffer *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_id")] public static extern long Offer_id(long _this_arg); // MUST_USE_RES bool Offer_supports_chain(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKThirtyTwoBytes chain); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_supports_chain")] public static extern bool Offer_supports_chain(long _this_arg, long _chain); // MUST_USE_RES bool Offer_is_expired(const struct LDKOffer *NONNULL_PTR this_arg); @@ -10488,24 +11354,76 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_is_valid_quantity")] public static extern bool Offer_is_valid_quantity(long _this_arg, long _quantity); // MUST_USE_RES bool Offer_expects_quantity(const struct LDKOffer *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_expects_quantity")] public static extern bool Offer_expects_quantity(long _this_arg); + // MUST_USE_RES struct LDKCResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_payer_id(const struct LDKOffer *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_request_invoice_deriving_payer_id")] public static extern long Offer_request_invoice_deriving_payer_id(long _this_arg, long _expanded_key, long _entropy_source, long _payment_id); + // MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice_deriving_metadata(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKPublicKey payer_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, struct LDKThirtyTwoBytes payment_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_request_invoice_deriving_metadata")] public static extern long Offer_request_invoice_deriving_metadata(long _this_arg, long _payer_id, long _expanded_key, long _entropy_source, long _payment_id); + // MUST_USE_RES struct LDKCResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ Offer_request_invoice(const struct LDKOffer *NONNULL_PTR this_arg, struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_request_invoice")] public static extern long Offer_request_invoice(long _this_arg, long _metadata, long _payer_id); + // uint64_t Offer_hash(const struct LDKOffer *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_hash")] public static extern long Offer_hash(long _o); // struct LDKCVec_u8Z Offer_write(const struct LDKOffer *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_write")] public static extern long Offer_write(long _obj); - // void Amount_free(struct LDKAmount this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_free")] public static extern void Amount_free(long _this_obj); + // void Amount_free(struct LDKAmount this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_free")] public static extern void Amount_free(long _this_ptr); // uint64_t Amount_clone_ptr(LDKAmount *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_clone_ptr")] public static extern long Amount_clone_ptr(long _arg); // struct LDKAmount Amount_clone(const struct LDKAmount *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_clone")] public static extern long Amount_clone(long _orig); - // void Quantity_free(struct LDKQuantity this_obj); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_free")] public static extern void Quantity_free(long _this_obj); + // struct LDKAmount Amount_bitcoin(uint64_t amount_msats); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_bitcoin")] public static extern long Amount_bitcoin(long _amount_msats); + // struct LDKAmount Amount_currency(struct LDKThreeBytes iso4217_code, uint64_t amount); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Amount_currency")] public static extern long Amount_currency(long _iso4217_code, long _amount); + // void Quantity_free(struct LDKQuantity this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_free")] public static extern void Quantity_free(long _this_ptr); // uint64_t Quantity_clone_ptr(LDKQuantity *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_clone_ptr")] public static extern long Quantity_clone_ptr(long _arg); // struct LDKQuantity Quantity_clone(const struct LDKQuantity *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_clone")] public static extern long Quantity_clone(long _orig); + // struct LDKQuantity Quantity_bounded(uint64_t a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_bounded")] public static extern long Quantity_bounded(long _a); + // struct LDKQuantity Quantity_unbounded(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_unbounded")] public static extern long Quantity_unbounded(); + // struct LDKQuantity Quantity_one(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Quantity_one")] public static extern long Quantity_one(); // struct LDKCResult_OfferBolt12ParseErrorZ Offer_from_str(struct LDKStr s); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Offer_from_str")] public static extern long Offer_from_str(long _s); + // void InvoiceWithExplicitSigningPubkeyBuilder_free(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_free")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_free(long _this_obj); + // void InvoiceWithDerivedSigningPubkeyBuilder_free(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_free")] public static extern void InvoiceWithDerivedSigningPubkeyBuilder_free(long _this_obj); + // MUST_USE_RES struct LDKCResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ InvoiceWithExplicitSigningPubkeyBuilder_build(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_build")] public static extern long InvoiceWithExplicitSigningPubkeyBuilder_build(long _this_arg); + // MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(long _this_arg, int _relative_expiry_secs); + // MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(long _this_arg, long _script_hash); + // MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(long _this_arg, long _pubkey_hash); + // MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(long _this_arg, long _utput_key); + // MUST_USE_RES void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithExplicitSigningPubkeyBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp")] public static extern void InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(long _this_arg); + // MUST_USE_RES struct LDKCResult_Bolt12InvoiceBolt12SemanticErrorZ InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign")] public static extern long InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(long _this_arg); + // MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, uint32_t relative_expiry_secs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry")] public static extern void InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(long _this_arg, int _relative_expiry_secs); + // MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*script_hash)[32]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh")] public static extern void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(long _this_arg, long _script_hash); + // MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, const uint8_t (*pubkey_hash)[20]); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh")] public static extern void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(long _this_arg, long _pubkey_hash); + // MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg, struct LDKTweakedPublicKey output_key); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked")] public static extern void InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(long _this_arg, long _utput_key); + // MUST_USE_RES void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(struct LDKInvoiceWithDerivedSigningPubkeyBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp")] public static extern void InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(long _this_arg); // void UnsignedBolt12Invoice_free(struct LDKUnsignedBolt12Invoice this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_free")] public static extern void UnsignedBolt12Invoice_free(long _this_obj); + // uint64_t UnsignedBolt12Invoice_clone_ptr(LDKUnsignedBolt12Invoice *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_clone_ptr")] public static extern long UnsignedBolt12Invoice_clone_ptr(long _arg); + // struct LDKUnsignedBolt12Invoice UnsignedBolt12Invoice_clone(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_clone")] public static extern long UnsignedBolt12Invoice_clone(long _orig); + // void SignBolt12InvoiceFn_free(struct LDKSignBolt12InvoiceFn this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignBolt12InvoiceFn_free")] public static extern void SignBolt12InvoiceFn_free(long _this_ptr); // MUST_USE_RES struct LDKTaggedHash UnsignedBolt12Invoice_tagged_hash(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_tagged_hash")] public static extern long UnsignedBolt12Invoice_tagged_hash(long _this_arg); // void Bolt12Invoice_free(struct LDKBolt12Invoice this_obj); @@ -10520,7 +11438,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_chain")] public static extern long UnsignedBolt12Invoice_chain(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedBolt12Invoice_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_metadata")] public static extern long UnsignedBolt12Invoice_metadata(long _this_arg); - // MUST_USE_RES struct LDKAmount UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_AmountZ UnsignedBolt12Invoice_amount(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_amount")] public static extern long UnsignedBolt12Invoice_amount(long _this_arg); // MUST_USE_RES struct LDKOfferFeatures UnsignedBolt12Invoice_offer_features(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_offer_features")] public static extern long UnsignedBolt12Invoice_offer_features(long _this_arg); @@ -10532,7 +11450,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_issuer")] public static extern long UnsignedBolt12Invoice_issuer(long _this_arg); // MUST_USE_RES struct LDKCVec_BlindedPathZ UnsignedBolt12Invoice_message_paths(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_message_paths")] public static extern long UnsignedBolt12Invoice_message_paths(long _this_arg); - // MUST_USE_RES struct LDKQuantity UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_QuantityZ UnsignedBolt12Invoice_supported_quantity(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_supported_quantity")] public static extern long UnsignedBolt12Invoice_supported_quantity(long _this_arg); // MUST_USE_RES struct LDKu8slice UnsignedBolt12Invoice_payer_metadata(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_payer_metadata")] public static extern long UnsignedBolt12Invoice_payer_metadata(long _this_arg); @@ -10564,7 +11482,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_chain")] public static extern long Bolt12Invoice_chain(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ Bolt12Invoice_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_metadata")] public static extern long Bolt12Invoice_metadata(long _this_arg); - // MUST_USE_RES struct LDKAmount Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_AmountZ Bolt12Invoice_amount(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_amount")] public static extern long Bolt12Invoice_amount(long _this_arg); // MUST_USE_RES struct LDKOfferFeatures Bolt12Invoice_offer_features(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_offer_features")] public static extern long Bolt12Invoice_offer_features(long _this_arg); @@ -10576,7 +11494,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_issuer")] public static extern long Bolt12Invoice_issuer(long _this_arg); // MUST_USE_RES struct LDKCVec_BlindedPathZ Bolt12Invoice_message_paths(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_message_paths")] public static extern long Bolt12Invoice_message_paths(long _this_arg); - // MUST_USE_RES struct LDKQuantity Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_QuantityZ Bolt12Invoice_supported_quantity(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_supported_quantity")] public static extern long Bolt12Invoice_supported_quantity(long _this_arg); // MUST_USE_RES struct LDKu8slice Bolt12Invoice_payer_metadata(const struct LDKBolt12Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_payer_metadata")] public static extern long Bolt12Invoice_payer_metadata(long _this_arg); @@ -10608,6 +11526,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_signable_hash")] public static extern long Bolt12Invoice_signable_hash(long _this_arg); // MUST_USE_RES struct LDKCResult_ThirtyTwoBytesNoneZ Bolt12Invoice_verify(const struct LDKBolt12Invoice *NONNULL_PTR this_arg, const struct LDKExpandedKey *NONNULL_PTR key); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_verify")] public static extern long Bolt12Invoice_verify(long _this_arg, long _key); + // uint64_t Bolt12Invoice_hash(const struct LDKBolt12Invoice *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12Invoice_hash")] public static extern long Bolt12Invoice_hash(long _o); // struct LDKCVec_u8Z UnsignedBolt12Invoice_write(const struct LDKUnsignedBolt12Invoice *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedBolt12Invoice_write")] public static extern long UnsignedBolt12Invoice_write(long _obj); // struct LDKCVec_u8Z Bolt12Invoice_write(const struct LDKBolt12Invoice *NONNULL_PTR obj); @@ -10690,8 +11610,38 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_write")] public static extern long InvoiceError_write(long _obj); // struct LDKCResult_InvoiceErrorDecodeErrorZ InvoiceError_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceError_read")] public static extern long InvoiceError_read(long _ser); + // void InvoiceRequestWithExplicitPayerIdBuilder_free(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_free")] public static extern void InvoiceRequestWithExplicitPayerIdBuilder_free(long _this_obj); + // void InvoiceRequestWithDerivedPayerIdBuilder_free(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_free")] public static extern void InvoiceRequestWithDerivedPayerIdBuilder_free(long _this_obj); + // MUST_USE_RES struct LDKCResult_UnsignedInvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_build(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_build")] public static extern long InvoiceRequestWithExplicitPayerIdBuilder_build(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_chain(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, enum LDKNetwork network); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_chain")] public static extern long InvoiceRequestWithExplicitPayerIdBuilder_chain(long _this_arg, Network _network); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t amount_msats); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_amount_msats")] public static extern long InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(long _this_arg, long _amount_msats); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithExplicitPayerIdBuilder_quantity(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, uint64_t quantity); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_quantity")] public static extern long InvoiceRequestWithExplicitPayerIdBuilder_quantity(long _this_arg, long _quantity); + // MUST_USE_RES void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithExplicitPayerIdBuilder this_arg, struct LDKStr payer_note); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithExplicitPayerIdBuilder_payer_note")] public static extern void InvoiceRequestWithExplicitPayerIdBuilder_payer_note(long _this_arg, long _payer_note); + // MUST_USE_RES struct LDKCResult_InvoiceRequestBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign")] public static extern long InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(long _this_arg); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_chain(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, enum LDKNetwork network); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_chain")] public static extern long InvoiceRequestWithDerivedPayerIdBuilder_chain(long _this_arg, Network _network); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t amount_msats); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_amount_msats")] public static extern long InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(long _this_arg, long _amount_msats); + // MUST_USE_RES struct LDKCResult_NoneBolt12SemanticErrorZ InvoiceRequestWithDerivedPayerIdBuilder_quantity(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, uint64_t quantity); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_quantity")] public static extern long InvoiceRequestWithDerivedPayerIdBuilder_quantity(long _this_arg, long _quantity); + // MUST_USE_RES void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(struct LDKInvoiceRequestWithDerivedPayerIdBuilder this_arg, struct LDKStr payer_note); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestWithDerivedPayerIdBuilder_payer_note")] public static extern void InvoiceRequestWithDerivedPayerIdBuilder_payer_note(long _this_arg, long _payer_note); // void UnsignedInvoiceRequest_free(struct LDKUnsignedInvoiceRequest this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_free")] public static extern void UnsignedInvoiceRequest_free(long _this_obj); + // uint64_t UnsignedInvoiceRequest_clone_ptr(LDKUnsignedInvoiceRequest *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_clone_ptr")] public static extern long UnsignedInvoiceRequest_clone_ptr(long _arg); + // struct LDKUnsignedInvoiceRequest UnsignedInvoiceRequest_clone(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_clone")] public static extern long UnsignedInvoiceRequest_clone(long _orig); + // void SignInvoiceRequestFn_free(struct LDKSignInvoiceRequestFn this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignInvoiceRequestFn_free")] public static extern void SignInvoiceRequestFn_free(long _this_ptr); // MUST_USE_RES struct LDKTaggedHash UnsignedInvoiceRequest_tagged_hash(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_tagged_hash")] public static extern long UnsignedInvoiceRequest_tagged_hash(long _this_arg); // void InvoiceRequest_free(struct LDKInvoiceRequest this_obj); @@ -10702,6 +11652,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_clone")] public static extern long InvoiceRequest_clone(long _orig); // void VerifiedInvoiceRequest_free(struct LDKVerifiedInvoiceRequest this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_free")] public static extern void VerifiedInvoiceRequest_free(long _this_obj); + // struct LDKOfferId VerifiedInvoiceRequest_get_offer_id(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_get_offer_id")] public static extern long VerifiedInvoiceRequest_get_offer_id(long _this_ptr); + // void VerifiedInvoiceRequest_set_offer_id(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKOfferId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_set_offer_id")] public static extern void VerifiedInvoiceRequest_set_offer_id(long _this_ptr, long _val); // struct LDKCOption_SecretKeyZ VerifiedInvoiceRequest_get_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_get_keys")] public static extern long VerifiedInvoiceRequest_get_keys(long _this_ptr); // void VerifiedInvoiceRequest_set_keys(struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_ptr, struct LDKCOption_SecretKeyZ val); @@ -10714,7 +11668,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_chains")] public static extern long UnsignedInvoiceRequest_chains(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ UnsignedInvoiceRequest_metadata(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_metadata")] public static extern long UnsignedInvoiceRequest_metadata(long _this_arg); - // MUST_USE_RES struct LDKAmount UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_AmountZ UnsignedInvoiceRequest_amount(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_amount")] public static extern long UnsignedInvoiceRequest_amount(long _this_arg); // MUST_USE_RES struct LDKPrintableString UnsignedInvoiceRequest_description(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_description")] public static extern long UnsignedInvoiceRequest_description(long _this_arg); @@ -10748,7 +11702,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_chains")] public static extern long InvoiceRequest_chains(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ InvoiceRequest_metadata(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_metadata")] public static extern long InvoiceRequest_metadata(long _this_arg); - // MUST_USE_RES struct LDKAmount InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_AmountZ InvoiceRequest_amount(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_amount")] public static extern long InvoiceRequest_amount(long _this_arg); // MUST_USE_RES struct LDKPrintableString InvoiceRequest_description(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_description")] public static extern long InvoiceRequest_description(long _this_arg); @@ -10778,15 +11732,19 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_payer_id")] public static extern long InvoiceRequest_payer_id(long _this_arg); // MUST_USE_RES struct LDKPrintableString InvoiceRequest_payer_note(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_payer_note")] public static extern long InvoiceRequest_payer_note(long _this_arg); - // MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_signature")] public static extern long InvoiceRequest_signature(long _this_arg); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_respond_with")] public static extern long InvoiceRequest_respond_with(long _this_arg, long _payment_paths, long _payment_hash); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ InvoiceRequest_respond_with_no_std(const struct LDKInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_respond_with_no_std")] public static extern long InvoiceRequest_respond_with_no_std(long _this_arg, long _payment_paths, long _payment_hash, long _created_at); // MUST_USE_RES struct LDKCResult_VerifiedInvoiceRequestNoneZ InvoiceRequest_verify(struct LDKInvoiceRequest this_arg, const struct LDKExpandedKey *NONNULL_PTR key); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_verify")] public static extern long InvoiceRequest_verify(long _this_arg, long _key); + // MUST_USE_RES struct LDKSchnorrSignature InvoiceRequest_signature(const struct LDKInvoiceRequest *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_signature")] public static extern long InvoiceRequest_signature(long _this_arg); // MUST_USE_RES struct LDKCVec_ThirtyTwoBytesZ VerifiedInvoiceRequest_chains(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_chains")] public static extern long VerifiedInvoiceRequest_chains(long _this_arg); // MUST_USE_RES struct LDKCOption_CVec_u8ZZ VerifiedInvoiceRequest_metadata(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_metadata")] public static extern long VerifiedInvoiceRequest_metadata(long _this_arg); - // MUST_USE_RES struct LDKAmount VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); + // MUST_USE_RES struct LDKCOption_AmountZ VerifiedInvoiceRequest_amount(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_amount")] public static extern long VerifiedInvoiceRequest_amount(long _this_arg); // MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_description(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_description")] public static extern long VerifiedInvoiceRequest_description(long _this_arg); @@ -10816,10 +11774,44 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_payer_id")] public static extern long VerifiedInvoiceRequest_payer_id(long _this_arg); // MUST_USE_RES struct LDKPrintableString VerifiedInvoiceRequest_payer_note(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_payer_note")] public static extern long VerifiedInvoiceRequest_payer_note(long _this_arg); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_respond_with")] public static extern long VerifiedInvoiceRequest_respond_with(long _this_arg, long _payment_paths, long _payment_hash); + // MUST_USE_RES struct LDKCResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_with_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_respond_with_no_std")] public static extern long VerifiedInvoiceRequest_respond_with_no_std(long _this_arg, long _payment_paths, long _payment_hash, long _created_at); + // MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys")] public static extern long VerifiedInvoiceRequest_respond_using_derived_keys(long _this_arg, long _payment_paths, long _payment_hash); + // MUST_USE_RES struct LDKCResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ VerifiedInvoiceRequest_respond_using_derived_keys_no_std(const struct LDKVerifiedInvoiceRequest *NONNULL_PTR this_arg, struct LDKCVec_C2Tuple_BlindedPayInfoBlindedPathZZ payment_paths, struct LDKThirtyTwoBytes payment_hash, uint64_t created_at); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_VerifiedInvoiceRequest_respond_using_derived_keys_no_std")] public static extern long VerifiedInvoiceRequest_respond_using_derived_keys_no_std(long _this_arg, long _payment_paths, long _payment_hash, long _created_at); // struct LDKCVec_u8Z UnsignedInvoiceRequest_write(const struct LDKUnsignedInvoiceRequest *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnsignedInvoiceRequest_write")] public static extern long UnsignedInvoiceRequest_write(long _obj); // struct LDKCVec_u8Z InvoiceRequest_write(const struct LDKInvoiceRequest *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequest_write")] public static extern long InvoiceRequest_write(long _obj); + // void InvoiceRequestFields_free(struct LDKInvoiceRequestFields this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_free")] public static extern void InvoiceRequestFields_free(long _this_obj); + // struct LDKPublicKey InvoiceRequestFields_get_payer_id(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_get_payer_id")] public static extern long InvoiceRequestFields_get_payer_id(long _this_ptr); + // void InvoiceRequestFields_set_payer_id(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKPublicKey val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_set_payer_id")] public static extern void InvoiceRequestFields_set_payer_id(long _this_ptr, long _val); + // struct LDKCOption_u64Z InvoiceRequestFields_get_quantity(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_get_quantity")] public static extern long InvoiceRequestFields_get_quantity(long _this_ptr); + // void InvoiceRequestFields_set_quantity(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKCOption_u64Z val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_set_quantity")] public static extern void InvoiceRequestFields_set_quantity(long _this_ptr, long _val); + // struct LDKUntrustedString InvoiceRequestFields_get_payer_note_truncated(const struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_get_payer_note_truncated")] public static extern long InvoiceRequestFields_get_payer_note_truncated(long _this_ptr); + // void InvoiceRequestFields_set_payer_note_truncated(struct LDKInvoiceRequestFields *NONNULL_PTR this_ptr, struct LDKUntrustedString val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_set_payer_note_truncated")] public static extern void InvoiceRequestFields_set_payer_note_truncated(long _this_ptr, long _val); + // MUST_USE_RES struct LDKInvoiceRequestFields InvoiceRequestFields_new(struct LDKPublicKey payer_id_arg, struct LDKCOption_u64Z quantity_arg, struct LDKUntrustedString payer_note_truncated_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_new")] public static extern long InvoiceRequestFields_new(long _payer_id_arg, long _quantity_arg, long _payer_note_truncated_arg); + // uint64_t InvoiceRequestFields_clone_ptr(LDKInvoiceRequestFields *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_clone_ptr")] public static extern long InvoiceRequestFields_clone_ptr(long _arg); + // struct LDKInvoiceRequestFields InvoiceRequestFields_clone(const struct LDKInvoiceRequestFields *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_clone")] public static extern long InvoiceRequestFields_clone(long _orig); + // bool InvoiceRequestFields_eq(const struct LDKInvoiceRequestFields *NONNULL_PTR a, const struct LDKInvoiceRequestFields *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_eq")] public static extern bool InvoiceRequestFields_eq(long _a, long _b); + // struct LDKCVec_u8Z InvoiceRequestFields_write(const struct LDKInvoiceRequestFields *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_write")] public static extern long InvoiceRequestFields_write(long _obj); + // struct LDKCResult_InvoiceRequestFieldsDecodeErrorZ InvoiceRequestFields_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InvoiceRequestFields_read")] public static extern long InvoiceRequestFields_read(long _ser); // void TaggedHash_free(struct LDKTaggedHash this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TaggedHash_free")] public static extern void TaggedHash_free(long _this_obj); // uint64_t TaggedHash_clone_ptr(LDKTaggedHash *NONNULL_PTR arg); @@ -10832,6 +11824,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TaggedHash_tag")] public static extern long TaggedHash_tag(long _this_arg); // MUST_USE_RES struct LDKThirtyTwoBytes TaggedHash_merkle_root(const struct LDKTaggedHash *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_TaggedHash_merkle_root")] public static extern long TaggedHash_merkle_root(long _this_arg); + // void SignError_free(struct LDKSignError this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignError_free")] public static extern void SignError_free(long _this_ptr); + // uint64_t SignError_clone_ptr(LDKSignError *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignError_clone_ptr")] public static extern long SignError_clone_ptr(long _arg); + // struct LDKSignError SignError_clone(const struct LDKSignError *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignError_clone")] public static extern long SignError_clone(long _orig); + // struct LDKSignError SignError_signing(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignError_signing")] public static extern long SignError_signing(); + // struct LDKSignError SignError_verification(enum LDKSecp256k1Error a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignError_verification")] public static extern long SignError_verification(Secp256k1Error _a); // void Bolt12ParseError_free(struct LDKBolt12ParseError this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12ParseError_free")] public static extern void Bolt12ParseError_free(long _this_obj); // uint64_t Bolt12ParseError_clone_ptr(LDKBolt12ParseError *NONNULL_PTR arg); @@ -10886,6 +11888,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_duplicate_payment_id")] public static extern Bolt12SemanticError Bolt12SemanticError_duplicate_payment_id(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_paths(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_paths")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_paths(); + // enum LDKBolt12SemanticError Bolt12SemanticError_unexpected_paths(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_unexpected_paths")] public static extern Bolt12SemanticError Bolt12SemanticError_unexpected_paths(); // enum LDKBolt12SemanticError Bolt12SemanticError_invalid_pay_info(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_invalid_pay_info")] public static extern Bolt12SemanticError Bolt12SemanticError_invalid_pay_info(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_creation_time(void); @@ -10894,6 +11898,32 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_payment_hash")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_payment_hash(); // enum LDKBolt12SemanticError Bolt12SemanticError_missing_signature(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12SemanticError_missing_signature")] public static extern Bolt12SemanticError Bolt12SemanticError_missing_signature(); + // void RefundMaybeWithDerivedMetadataBuilder_free(struct LDKRefundMaybeWithDerivedMetadataBuilder this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_free")] public static extern void RefundMaybeWithDerivedMetadataBuilder_free(long _this_obj); + // uint64_t RefundMaybeWithDerivedMetadataBuilder_clone_ptr(LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone_ptr")] public static extern long RefundMaybeWithDerivedMetadataBuilder_clone_ptr(long _arg); + // struct LDKRefundMaybeWithDerivedMetadataBuilder RefundMaybeWithDerivedMetadataBuilder_clone(const struct LDKRefundMaybeWithDerivedMetadataBuilder *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_clone")] public static extern long RefundMaybeWithDerivedMetadataBuilder_clone(long _orig); + // MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_new(struct LDKCVec_u8Z metadata, struct LDKPublicKey payer_id, uint64_t amount_msats); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_new")] public static extern long RefundMaybeWithDerivedMetadataBuilder_new(long _metadata, long _payer_id, long _amount_msats); + // MUST_USE_RES struct LDKCResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(struct LDKPublicKey node_id, const struct LDKExpandedKey *NONNULL_PTR expanded_key, struct LDKEntropySource entropy_source, uint64_t amount_msats, struct LDKThirtyTwoBytes payment_id); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id")] public static extern long RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(long _node_id, long _expanded_key, long _entropy_source, long _amount_msats, long _payment_id); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_description(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr description); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_description")] public static extern void RefundMaybeWithDerivedMetadataBuilder_description(long _this_arg, long _description); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t absolute_expiry); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_absolute_expiry")] public static extern void RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(long _this_arg, long _absolute_expiry); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_issuer(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr issuer); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_issuer")] public static extern void RefundMaybeWithDerivedMetadataBuilder_issuer(long _this_arg, long _issuer); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_path(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKBlindedPath path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_path")] public static extern void RefundMaybeWithDerivedMetadataBuilder_path(long _this_arg, long _path); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_chain(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, enum LDKNetwork network); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_chain")] public static extern void RefundMaybeWithDerivedMetadataBuilder_chain(long _this_arg, Network _network); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_quantity(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, uint64_t quantity); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_quantity")] public static extern void RefundMaybeWithDerivedMetadataBuilder_quantity(long _this_arg, long _quantity); + // MUST_USE_RES void RefundMaybeWithDerivedMetadataBuilder_payer_note(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg, struct LDKStr payer_note); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_payer_note")] public static extern void RefundMaybeWithDerivedMetadataBuilder_payer_note(long _this_arg, long _payer_note); + // MUST_USE_RES struct LDKCResult_RefundBolt12SemanticErrorZ RefundMaybeWithDerivedMetadataBuilder_build(struct LDKRefundMaybeWithDerivedMetadataBuilder this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RefundMaybeWithDerivedMetadataBuilder_build")] public static extern long RefundMaybeWithDerivedMetadataBuilder_build(long _this_arg); // void Refund_free(struct LDKRefund this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_free")] public static extern void Refund_free(long _this_obj); // uint64_t Refund_clone_ptr(LDKRefund *NONNULL_PTR arg); @@ -10926,6 +11956,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_payer_id")] public static extern long Refund_payer_id(long _this_arg); // MUST_USE_RES struct LDKPrintableString Refund_payer_note(const struct LDKRefund *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_payer_note")] public static extern long Refund_payer_note(long _this_arg); + // uint64_t Refund_hash(const struct LDKRefund *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_hash")] public static extern long Refund_hash(long _o); // struct LDKCVec_u8Z Refund_write(const struct LDKRefund *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Refund_write")] public static extern long Refund_write(long _obj); // struct LDKCResult_RefundBolt12ParseErrorZ Refund_from_str(struct LDKStr s); @@ -10968,6 +12000,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_clone")] public static extern long NodeId_clone(long _orig); // MUST_USE_RES struct LDKNodeId NodeId_from_pubkey(struct LDKPublicKey pubkey); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_from_pubkey")] public static extern long NodeId_from_pubkey(long _pubkey); + // MUST_USE_RES struct LDKCResult_NodeIdDecodeErrorZ NodeId_from_slice(struct LDKu8slice bytes); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_from_slice")] public static extern long NodeId_from_slice(long _bytes); // MUST_USE_RES struct LDKu8slice NodeId_as_slice(const struct LDKNodeId *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeId_as_slice")] public static extern long NodeId_as_slice(long _this_arg); // MUST_USE_RES const uint8_t (*NodeId_as_array(const struct LDKNodeId *NONNULL_PTR this_arg))[33]; @@ -11114,6 +12148,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelInfo_channel")] public static extern long DirectedChannelInfo_channel(long _this_arg); // MUST_USE_RES struct LDKEffectiveCapacity DirectedChannelInfo_effective_capacity(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelInfo_effective_capacity")] public static extern long DirectedChannelInfo_effective_capacity(long _this_arg); + // MUST_USE_RES struct LDKNodeId DirectedChannelInfo_source(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelInfo_source")] public static extern long DirectedChannelInfo_source(long _this_arg); + // MUST_USE_RES struct LDKNodeId DirectedChannelInfo_target(const struct LDKDirectedChannelInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DirectedChannelInfo_target")] public static extern long DirectedChannelInfo_target(long _this_arg); // void EffectiveCapacity_free(struct LDKEffectiveCapacity this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EffectiveCapacity_free")] public static extern void EffectiveCapacity_free(long _this_ptr); // uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg); @@ -11232,6 +12270,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_clone")] public static extern long NodeInfo_clone(long _orig); // bool NodeInfo_eq(const struct LDKNodeInfo *NONNULL_PTR a, const struct LDKNodeInfo *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_eq")] public static extern bool NodeInfo_eq(long _a, long _b); + // MUST_USE_RES bool NodeInfo_is_tor_only(const struct LDKNodeInfo *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_is_tor_only")] public static extern bool NodeInfo_is_tor_only(long _this_arg); // struct LDKCVec_u8Z NodeInfo_write(const struct LDKNodeInfo *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeInfo_write")] public static extern long NodeInfo_write(long _obj); // struct LDKCResult_NodeInfoDecodeErrorZ NodeInfo_read(struct LDKu8slice ser); @@ -11862,8 +12902,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_channel_value_satoshis")] public static extern long DelayedPaymentOutputDescriptor_get_channel_value_satoshis(long _this_ptr); // void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_channel_value_satoshis")] public static extern void DelayedPaymentOutputDescriptor_set_channel_value_satoshis(long _this_ptr, long _val); - // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_new")] public static extern long DelayedPaymentOutputDescriptor_new(long _outpoint_arg, long _per_commitment_point_arg, short _to_self_delay_arg, long _output_arg, long _revocation_pubkey_arg, long _channel_keys_id_arg, long _channel_value_satoshis_arg); + // struct LDKChannelTransactionParameters DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_get_channel_transaction_parameters")] public static extern long DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(long _this_ptr); + // void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR this_ptr, struct LDKChannelTransactionParameters val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_set_channel_transaction_parameters")] public static extern void DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(long _this_ptr, long _val); + // MUST_USE_RES struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_new(struct LDKOutPoint outpoint_arg, struct LDKPublicKey per_commitment_point_arg, uint16_t to_self_delay_arg, struct LDKTxOut output_arg, struct LDKRevocationKey revocation_pubkey_arg, struct LDKThirtyTwoBytes channel_keys_id_arg, uint64_t channel_value_satoshis_arg, struct LDKChannelTransactionParameters channel_transaction_parameters_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_new")] public static extern long DelayedPaymentOutputDescriptor_new(long _outpoint_arg, long _per_commitment_point_arg, short _to_self_delay_arg, long _output_arg, long _revocation_pubkey_arg, long _channel_keys_id_arg, long _channel_value_satoshis_arg, long _channel_transaction_parameters_arg); // uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_DelayedPaymentOutputDescriptor_clone_ptr")] public static extern long DelayedPaymentOutputDescriptor_clone_ptr(long _arg); // struct LDKDelayedPaymentOutputDescriptor DelayedPaymentOutputDescriptor_clone(const struct LDKDelayedPaymentOutputDescriptor *NONNULL_PTR orig); @@ -11970,6 +13014,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_channel_derivation_parameters")] public static extern long HTLCDescriptor_get_channel_derivation_parameters(long _this_ptr); // void HTLCDescriptor_set_channel_derivation_parameters(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKChannelDerivationParameters val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_channel_derivation_parameters")] public static extern void HTLCDescriptor_set_channel_derivation_parameters(long _this_ptr, long _val); + // const uint8_t (*HTLCDescriptor_get_commitment_txid(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr))[32]; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_commitment_txid")] public static extern long HTLCDescriptor_get_commitment_txid(long _this_ptr); + // void HTLCDescriptor_set_commitment_txid(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_commitment_txid")] public static extern void HTLCDescriptor_set_commitment_txid(long _this_ptr, long _val); // uint64_t HTLCDescriptor_get_per_commitment_number(const struct LDKHTLCDescriptor *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_per_commitment_number")] public static extern long HTLCDescriptor_get_per_commitment_number(long _this_ptr); // void HTLCDescriptor_set_per_commitment_number(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, uint64_t val); @@ -11994,6 +13042,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_get_counterparty_sig")] public static extern long HTLCDescriptor_get_counterparty_sig(long _this_ptr); // void HTLCDescriptor_set_counterparty_sig(struct LDKHTLCDescriptor *NONNULL_PTR this_ptr, struct LDKECDSASignature val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_set_counterparty_sig")] public static extern void HTLCDescriptor_set_counterparty_sig(long _this_ptr, long _val); + // MUST_USE_RES struct LDKHTLCDescriptor HTLCDescriptor_new(struct LDKChannelDerivationParameters channel_derivation_parameters_arg, struct LDKThirtyTwoBytes commitment_txid_arg, uint64_t per_commitment_number_arg, struct LDKPublicKey per_commitment_point_arg, uint32_t feerate_per_kw_arg, struct LDKHTLCOutputInCommitment htlc_arg, struct LDKCOption_ThirtyTwoBytesZ preimage_arg, struct LDKECDSASignature counterparty_sig_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_new")] public static extern long HTLCDescriptor_new(long _channel_derivation_parameters_arg, long _commitment_txid_arg, long _per_commitment_number_arg, long _per_commitment_point_arg, int _feerate_per_kw_arg, long _htlc_arg, long _preimage_arg, long _counterparty_sig_arg); // uint64_t HTLCDescriptor_clone_ptr(LDKHTLCDescriptor *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDescriptor_clone_ptr")] public static extern long HTLCDescriptor_clone_ptr(long _arg); // struct LDKHTLCDescriptor HTLCDescriptor_clone(const struct LDKHTLCDescriptor *NONNULL_PTR orig); @@ -12030,8 +13080,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EntropySource_free")] public static extern void EntropySource_free(long _this_ptr); // void NodeSigner_free(struct LDKNodeSigner this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeSigner_free")] public static extern void NodeSigner_free(long _this_ptr); + // void OutputSpender_free(struct LDKOutputSpender this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OutputSpender_free")] public static extern void OutputSpender_free(long _this_ptr); // void SignerProvider_free(struct LDKSignerProvider this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SignerProvider_free")] public static extern void SignerProvider_free(long _this_ptr); + // void ChangeDestinationSource_free(struct LDKChangeDestinationSource this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ChangeDestinationSource_free")] public static extern void ChangeDestinationSource_free(long _this_ptr); // void InMemorySigner_free(struct LDKInMemorySigner this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_InMemorySigner_free")] public static extern void InMemorySigner_free(long _this_obj); // const uint8_t (*InMemorySigner_get_funding_key(const struct LDKInMemorySigner *NONNULL_PTR this_ptr))[32]; @@ -12104,12 +13158,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_derive_channel_keys")] public static extern long KeysManager_derive_channel_keys(long _this_arg, long _channel_value_satoshis, long _params); // MUST_USE_RES struct LDKCResult_CVec_u8ZNoneZ KeysManager_sign_spendable_outputs_psbt(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_u8Z psbt); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_sign_spendable_outputs_psbt")] public static extern long KeysManager_sign_spendable_outputs_psbt(long _this_arg, long _descriptors, long _psbt); - // MUST_USE_RES struct LDKCResult_TransactionNoneZ KeysManager_spend_spendable_outputs(const struct LDKKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_spend_spendable_outputs")] public static extern long KeysManager_spend_spendable_outputs(long _this_arg, long _descriptors, long _outputs, long _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime); // struct LDKEntropySource KeysManager_as_EntropySource(const struct LDKKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_EntropySource")] public static extern long KeysManager_as_EntropySource(long _this_arg); // struct LDKNodeSigner KeysManager_as_NodeSigner(const struct LDKKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_NodeSigner")] public static extern long KeysManager_as_NodeSigner(long _this_arg); + // struct LDKOutputSpender KeysManager_as_OutputSpender(const struct LDKKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_OutputSpender")] public static extern long KeysManager_as_OutputSpender(long _this_arg); // struct LDKSignerProvider KeysManager_as_SignerProvider(const struct LDKKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_KeysManager_as_SignerProvider")] public static extern long KeysManager_as_SignerProvider(long _this_arg); // void PhantomKeysManager_free(struct LDKPhantomKeysManager this_obj); @@ -12118,18 +13172,24 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_EntropySource")] public static extern long PhantomKeysManager_as_EntropySource(long _this_arg); // struct LDKNodeSigner PhantomKeysManager_as_NodeSigner(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_NodeSigner")] public static extern long PhantomKeysManager_as_NodeSigner(long _this_arg); + // struct LDKOutputSpender PhantomKeysManager_as_OutputSpender(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_OutputSpender")] public static extern long PhantomKeysManager_as_OutputSpender(long _this_arg); // struct LDKSignerProvider PhantomKeysManager_as_SignerProvider(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_as_SignerProvider")] public static extern long PhantomKeysManager_as_SignerProvider(long _this_arg); // MUST_USE_RES struct LDKPhantomKeysManager PhantomKeysManager_new(const uint8_t (*seed)[32], uint64_t starting_time_secs, uint32_t starting_time_nanos, const uint8_t (*cross_node_seed)[32]); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_new")] public static extern long PhantomKeysManager_new(long _seed, long _starting_time_secs, int _starting_time_nanos, long _cross_node_seed); - // MUST_USE_RES struct LDKCResult_TransactionNoneZ PhantomKeysManager_spend_spendable_outputs(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, struct LDKCVec_SpendableOutputDescriptorZ descriptors, struct LDKCVec_TxOutZ outputs, struct LDKCVec_u8Z change_destination_script, uint32_t feerate_sat_per_1000_weight, struct LDKCOption_u32Z locktime); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_spend_spendable_outputs")] public static extern long PhantomKeysManager_spend_spendable_outputs(long _this_arg, long _descriptors, long _outputs, long _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime); // MUST_USE_RES struct LDKInMemorySigner PhantomKeysManager_derive_channel_keys(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg, uint64_t channel_value_satoshis, const uint8_t (*params)[32]); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_derive_channel_keys")] public static extern long PhantomKeysManager_derive_channel_keys(long _this_arg, long _channel_value_satoshis, long _params); // MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_get_node_secret_key")] public static extern long PhantomKeysManager_get_node_secret_key(long _this_arg); // MUST_USE_RES struct LDKSecretKey PhantomKeysManager_get_phantom_node_secret_key(const struct LDKPhantomKeysManager *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PhantomKeysManager_get_phantom_node_secret_key")] public static extern long PhantomKeysManager_get_phantom_node_secret_key(long _this_arg); + // void RandomBytes_free(struct LDKRandomBytes this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RandomBytes_free")] public static extern void RandomBytes_free(long _this_obj); + // MUST_USE_RES struct LDKRandomBytes RandomBytes_new(struct LDKThirtyTwoBytes seed); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RandomBytes_new")] public static extern long RandomBytes_new(long _seed); + // struct LDKEntropySource RandomBytes_as_EntropySource(const struct LDKRandomBytes *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_RandomBytes_as_EntropySource")] public static extern long RandomBytes_as_EntropySource(long _this_arg); // void EcdsaChannelSigner_free(struct LDKEcdsaChannelSigner this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EcdsaChannelSigner_free")] public static extern void EcdsaChannelSigner_free(long _this_ptr); // uint64_t WriteableEcdsaChannelSigner_clone_ptr(LDKWriteableEcdsaChannelSigner *NONNULL_PTR arg); @@ -12180,6 +13240,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_node")] public static extern long Destination_node(long _a); // struct LDKDestination Destination_blinded_path(struct LDKBlindedPath a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_blinded_path")] public static extern long Destination_blinded_path(long _a); + // uint64_t Destination_hash(const struct LDKDestination *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_hash")] public static extern long Destination_hash(long _o); + // bool Destination_eq(const struct LDKDestination *NONNULL_PTR a, const struct LDKDestination *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_eq")] public static extern bool Destination_eq(long _a, long _b); + // void Destination_resolve(struct LDKDestination *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Destination_resolve")] public static extern void Destination_resolve(long _this_arg, long _network_graph); // void SendSuccess_free(struct LDKSendSuccess this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendSuccess_free")] public static extern void SendSuccess_free(long _this_ptr); // uint64_t SendSuccess_clone_ptr(LDKSendSuccess *NONNULL_PTR arg); @@ -12190,6 +13256,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendSuccess_buffered")] public static extern long SendSuccess_buffered(); // struct LDKSendSuccess SendSuccess_buffered_awaiting_connection(struct LDKPublicKey a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendSuccess_buffered_awaiting_connection")] public static extern long SendSuccess_buffered_awaiting_connection(long _a); + // uint64_t SendSuccess_hash(const struct LDKSendSuccess *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendSuccess_hash")] public static extern long SendSuccess_hash(long _o); // bool SendSuccess_eq(const struct LDKSendSuccess *NONNULL_PTR a, const struct LDKSendSuccess *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendSuccess_eq")] public static extern bool SendSuccess_eq(long _a, long _b); // void SendError_free(struct LDKSendError this_ptr); @@ -12214,8 +13282,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_buffer_full")] public static extern long SendError_buffer_full(); // struct LDKSendError SendError_get_node_id_failed(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_get_node_id_failed")] public static extern long SendError_get_node_id_failed(); + // struct LDKSendError SendError_unresolved_introduction_node(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_unresolved_introduction_node")] public static extern long SendError_unresolved_introduction_node(); // struct LDKSendError SendError_blinded_path_advance_failed(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_blinded_path_advance_failed")] public static extern long SendError_blinded_path_advance_failed(); + // uint64_t SendError_hash(const struct LDKSendError *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_hash")] public static extern long SendError_hash(long _o); // bool SendError_eq(const struct LDKSendError *NONNULL_PTR a, const struct LDKSendError *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_SendError_eq")] public static extern bool SendError_eq(long _a, long _b); // void CustomOnionMessageHandler_free(struct LDKCustomOnionMessageHandler this_ptr); @@ -12226,16 +13298,18 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeeledOnion_clone_ptr")] public static extern long PeeledOnion_clone_ptr(long _arg); // struct LDKPeeledOnion PeeledOnion_clone(const struct LDKPeeledOnion *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeeledOnion_clone")] public static extern long PeeledOnion_clone(long _orig); - // struct LDKPeeledOnion PeeledOnion_forward(struct LDKPublicKey a, struct LDKOnionMessage b); + // struct LDKPeeledOnion PeeledOnion_forward(struct LDKNextMessageHop a, struct LDKOnionMessage b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeeledOnion_forward")] public static extern long PeeledOnion_forward(long _a, long _b); // struct LDKPeeledOnion PeeledOnion_receive(struct LDKParsedOnionMessageContents a, struct LDKThirtyTwoBytes b, struct LDKBlindedPath c); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PeeledOnion_receive")] public static extern long PeeledOnion_receive(long _a, long _b, long _c); - // struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_onion_message")] public static extern long create_onion_message(long _entropy_source, long _node_signer, long _path, long _contents, long _reply_path); + // struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_onion_message_resolving_destination")] public static extern long create_onion_message_resolving_destination(long _entropy_source, long _node_signer, long _node_id_lookup, long _network_graph, long _path, long _contents, long _reply_path); + // struct LDKCResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(const struct LDKEntropySource *NONNULL_PTR entropy_source, const struct LDKNodeSigner *NONNULL_PTR node_signer, const struct LDKNodeIdLookUp *NONNULL_PTR node_id_lookup, struct LDKOnionMessagePath path, struct LDKOnionMessageContents contents, struct LDKBlindedPath reply_path); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_create_onion_message")] public static extern long create_onion_message(long _entropy_source, long _node_signer, long _node_id_lookup, long _path, long _contents, long _reply_path); // struct LDKCResult_PeeledOnionNoneZ peel_onion_message(const struct LDKOnionMessage *NONNULL_PTR msg, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKCustomOnionMessageHandler custom_handler); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_peel_onion_message")] public static extern long peel_onion_message(long _msg, long _node_signer, long _logger, long _custom_handler); - // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_new")] public static extern long OnionMessenger_new(long _entropy_source, long _node_signer, long _logger, long _message_router, long _offers_handler, long _custom_handler); + // MUST_USE_RES struct LDKOnionMessenger OnionMessenger_new(struct LDKEntropySource entropy_source, struct LDKNodeSigner node_signer, struct LDKLogger logger, struct LDKNodeIdLookUp node_id_lookup, struct LDKMessageRouter message_router, struct LDKOffersMessageHandler offers_handler, struct LDKCustomOnionMessageHandler custom_handler); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_new")] public static extern long OnionMessenger_new(long _entropy_source, long _node_signer, long _logger, long _node_id_lookup, long _message_router, long _offers_handler, long _custom_handler); // MUST_USE_RES struct LDKCResult_SendSuccessSendErrorZ OnionMessenger_send_onion_message(const struct LDKOnionMessenger *NONNULL_PTR this_arg, struct LDKOnionMessageContents contents, struct LDKDestination destination, struct LDKBlindedPath reply_path); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessenger_send_onion_message")] public static extern long OnionMessenger_send_onion_message(long _this_arg, long _contents, long _destination, long _reply_path); // struct LDKOnionMessageHandler OnionMessenger_as_OnionMessageHandler(const struct LDKOnionMessenger *NONNULL_PTR this_arg); @@ -12312,12 +13386,26 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_clone")] public static extern long OnionMessageContents_clone(long _orig); // void OnionMessageContents_free(struct LDKOnionMessageContents this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_OnionMessageContents_free")] public static extern void OnionMessageContents_free(long _this_ptr); + // void NextMessageHop_free(struct LDKNextMessageHop this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_free")] public static extern void NextMessageHop_free(long _this_ptr); + // uint64_t NextMessageHop_clone_ptr(LDKNextMessageHop *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_clone_ptr")] public static extern long NextMessageHop_clone_ptr(long _arg); + // struct LDKNextMessageHop NextMessageHop_clone(const struct LDKNextMessageHop *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_clone")] public static extern long NextMessageHop_clone(long _orig); + // struct LDKNextMessageHop NextMessageHop_node_id(struct LDKPublicKey a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_node_id")] public static extern long NextMessageHop_node_id(long _a); + // struct LDKNextMessageHop NextMessageHop_short_channel_id(uint64_t a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_short_channel_id")] public static extern long NextMessageHop_short_channel_id(long _a); + // uint64_t NextMessageHop_hash(const struct LDKNextMessageHop *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_hash")] public static extern long NextMessageHop_hash(long _o); + // bool NextMessageHop_eq(const struct LDKNextMessageHop *NONNULL_PTR a, const struct LDKNextMessageHop *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NextMessageHop_eq")] public static extern bool NextMessageHop_eq(long _a, long _b); // void BlindedPath_free(struct LDKBlindedPath this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_free")] public static extern void BlindedPath_free(long _this_obj); - // struct LDKPublicKey BlindedPath_get_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_ptr); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_get_introduction_node_id")] public static extern long BlindedPath_get_introduction_node_id(long _this_ptr); - // void BlindedPath_set_introduction_node_id(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_set_introduction_node_id")] public static extern void BlindedPath_set_introduction_node_id(long _this_ptr, long _val); + // struct LDKIntroductionNode BlindedPath_get_introduction_node(const struct LDKBlindedPath *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_get_introduction_node")] public static extern long BlindedPath_get_introduction_node(long _this_ptr); + // void BlindedPath_set_introduction_node(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKIntroductionNode val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_set_introduction_node")] public static extern void BlindedPath_set_introduction_node(long _this_ptr, long _val); // struct LDKPublicKey BlindedPath_get_blinding_point(const struct LDKBlindedPath *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_get_blinding_point")] public static extern long BlindedPath_get_blinding_point(long _this_ptr); // void BlindedPath_set_blinding_point(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKPublicKey val); @@ -12326,8 +13414,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_get_blinded_hops")] public static extern long BlindedPath_get_blinded_hops(long _this_ptr); // void BlindedPath_set_blinded_hops(struct LDKBlindedPath *NONNULL_PTR this_ptr, struct LDKCVec_BlindedHopZ val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_set_blinded_hops")] public static extern void BlindedPath_set_blinded_hops(long _this_ptr, long _val); - // MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKPublicKey introduction_node_id_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new")] public static extern long BlindedPath_new(long _introduction_node_id_arg, long _blinding_point_arg, long _blinded_hops_arg); + // MUST_USE_RES struct LDKBlindedPath BlindedPath_new(struct LDKIntroductionNode introduction_node_arg, struct LDKPublicKey blinding_point_arg, struct LDKCVec_BlindedHopZ blinded_hops_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new")] public static extern long BlindedPath_new(long _introduction_node_arg, long _blinding_point_arg, long _blinded_hops_arg); // uint64_t BlindedPath_clone_ptr(LDKBlindedPath *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_clone_ptr")] public static extern long BlindedPath_clone_ptr(long _arg); // struct LDKBlindedPath BlindedPath_clone(const struct LDKBlindedPath *NONNULL_PTR orig); @@ -12336,6 +13424,38 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_hash")] public static extern long BlindedPath_hash(long _o); // bool BlindedPath_eq(const struct LDKBlindedPath *NONNULL_PTR a, const struct LDKBlindedPath *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_eq")] public static extern bool BlindedPath_eq(long _a, long _b); + // void IntroductionNode_free(struct LDKIntroductionNode this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_free")] public static extern void IntroductionNode_free(long _this_ptr); + // uint64_t IntroductionNode_clone_ptr(LDKIntroductionNode *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_clone_ptr")] public static extern long IntroductionNode_clone_ptr(long _arg); + // struct LDKIntroductionNode IntroductionNode_clone(const struct LDKIntroductionNode *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_clone")] public static extern long IntroductionNode_clone(long _orig); + // struct LDKIntroductionNode IntroductionNode_node_id(struct LDKPublicKey a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_node_id")] public static extern long IntroductionNode_node_id(long _a); + // struct LDKIntroductionNode IntroductionNode_directed_short_channel_id(enum LDKDirection a, uint64_t b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_directed_short_channel_id")] public static extern long IntroductionNode_directed_short_channel_id(Direction _a, long _b); + // uint64_t IntroductionNode_hash(const struct LDKIntroductionNode *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_hash")] public static extern long IntroductionNode_hash(long _o); + // bool IntroductionNode_eq(const struct LDKIntroductionNode *NONNULL_PTR a, const struct LDKIntroductionNode *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_IntroductionNode_eq")] public static extern bool IntroductionNode_eq(long _a, long _b); + // enum LDKDirection Direction_clone(const enum LDKDirection *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Direction_clone")] public static extern Direction Direction_clone(long _orig); + // enum LDKDirection Direction_node_one(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Direction_node_one")] public static extern Direction Direction_node_one(); + // enum LDKDirection Direction_node_two(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Direction_node_two")] public static extern Direction Direction_node_two(); + // uint64_t Direction_hash(const enum LDKDirection *NONNULL_PTR o); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Direction_hash")] public static extern long Direction_hash(long _o); + // bool Direction_eq(const enum LDKDirection *NONNULL_PTR a, const enum LDKDirection *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Direction_eq")] public static extern bool Direction_eq(long _a, long _b); + // void NodeIdLookUp_free(struct LDKNodeIdLookUp this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_NodeIdLookUp_free")] public static extern void NodeIdLookUp_free(long _this_ptr); + // void EmptyNodeIdLookUp_free(struct LDKEmptyNodeIdLookUp this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EmptyNodeIdLookUp_free")] public static extern void EmptyNodeIdLookUp_free(long _this_obj); + // MUST_USE_RES struct LDKEmptyNodeIdLookUp EmptyNodeIdLookUp_new(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EmptyNodeIdLookUp_new")] public static extern long EmptyNodeIdLookUp_new(); + // struct LDKNodeIdLookUp EmptyNodeIdLookUp_as_NodeIdLookUp(const struct LDKEmptyNodeIdLookUp *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_EmptyNodeIdLookUp_as_NodeIdLookUp")] public static extern long EmptyNodeIdLookUp_as_NodeIdLookUp(long _this_arg); // void BlindedHop_free(struct LDKBlindedHop this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_free")] public static extern void BlindedHop_free(long _this_obj); // struct LDKPublicKey BlindedHop_get_blinded_node_id(const struct LDKBlindedHop *NONNULL_PTR this_ptr); @@ -12356,14 +13476,16 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_hash")] public static extern long BlindedHop_hash(long _o); // bool BlindedHop_eq(const struct LDKBlindedHop *NONNULL_PTR a, const struct LDKBlindedHop *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedHop_eq")] public static extern bool BlindedHop_eq(long _a, long _b); - // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, const struct LDKEntropySource *NONNULL_PTR entropy_source); + // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_one_hop_for_message(struct LDKPublicKey recipient_node_id, struct LDKEntropySource entropy_source); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_one_hop_for_message")] public static extern long BlindedPath_one_hop_for_message(long _recipient_node_id, long _entropy_source); - // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, const struct LDKEntropySource *NONNULL_PTR entropy_source); + // MUST_USE_RES struct LDKCResult_BlindedPathNoneZ BlindedPath_new_for_message(struct LDKCVec_PublicKeyZ node_pks, struct LDKEntropySource entropy_source); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new_for_message")] public static extern long BlindedPath_new_for_message(long _node_pks, long _entropy_source); - // MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, const struct LDKEntropySource *NONNULL_PTR entropy_source); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_one_hop_for_payment")] public static extern long BlindedPath_one_hop_for_payment(long _payee_node_id, long _payee_tlvs, long _entropy_source); - // MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, const struct LDKEntropySource *NONNULL_PTR entropy_source); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new_for_payment")] public static extern long BlindedPath_new_for_payment(long _intermediate_nodes, long _payee_node_id, long _payee_tlvs, long _htlc_maximum_msat, long _entropy_source); + // MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_one_hop_for_payment")] public static extern long BlindedPath_one_hop_for_payment(long _payee_node_id, long _payee_tlvs, short _min_final_cltv_expiry_delta, long _entropy_source); + // MUST_USE_RES struct LDKCResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(struct LDKCVec_ForwardNodeZ intermediate_nodes, struct LDKPublicKey payee_node_id, struct LDKReceiveTlvs payee_tlvs, uint64_t htlc_maximum_msat, uint16_t min_final_cltv_expiry_delta, struct LDKEntropySource entropy_source); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_new_for_payment")] public static extern long BlindedPath_new_for_payment(long _intermediate_nodes, long _payee_node_id, long _payee_tlvs, long _htlc_maximum_msat, short _min_final_cltv_expiry_delta, long _entropy_source); + // MUST_USE_RES struct LDKNodeId BlindedPath_public_introduction_node_id(const struct LDKBlindedPath *NONNULL_PTR this_arg, const struct LDKReadOnlyNetworkGraph *NONNULL_PTR network_graph); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_public_introduction_node_id")] public static extern long BlindedPath_public_introduction_node_id(long _this_arg, long _network_graph); // struct LDKCVec_u8Z BlindedPath_write(const struct LDKBlindedPath *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BlindedPath_write")] public static extern long BlindedPath_write(long _obj); // struct LDKCResult_BlindedPathDecodeErrorZ BlindedPath_read(struct LDKu8slice ser); @@ -12426,8 +13548,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_get_payment_constraints")] public static extern long ReceiveTlvs_get_payment_constraints(long _this_ptr); // void ReceiveTlvs_set_payment_constraints(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentConstraints val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_set_payment_constraints")] public static extern void ReceiveTlvs_set_payment_constraints(long _this_ptr, long _val); - // MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_new")] public static extern long ReceiveTlvs_new(long _payment_secret_arg, long _payment_constraints_arg); + // struct LDKPaymentContext ReceiveTlvs_get_payment_context(const struct LDKReceiveTlvs *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_get_payment_context")] public static extern long ReceiveTlvs_get_payment_context(long _this_ptr); + // void ReceiveTlvs_set_payment_context(struct LDKReceiveTlvs *NONNULL_PTR this_ptr, struct LDKPaymentContext val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_set_payment_context")] public static extern void ReceiveTlvs_set_payment_context(long _this_ptr, long _val); + // MUST_USE_RES struct LDKReceiveTlvs ReceiveTlvs_new(struct LDKThirtyTwoBytes payment_secret_arg, struct LDKPaymentConstraints payment_constraints_arg, struct LDKPaymentContext payment_context_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_new")] public static extern long ReceiveTlvs_new(long _payment_secret_arg, long _payment_constraints_arg, long _payment_context_arg); // uint64_t ReceiveTlvs_clone_ptr(LDKReceiveTlvs *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ReceiveTlvs_clone_ptr")] public static extern long ReceiveTlvs_clone_ptr(long _arg); // struct LDKReceiveTlvs ReceiveTlvs_clone(const struct LDKReceiveTlvs *NONNULL_PTR orig); @@ -12468,6 +13594,56 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentConstraints_clone_ptr")] public static extern long PaymentConstraints_clone_ptr(long _arg); // struct LDKPaymentConstraints PaymentConstraints_clone(const struct LDKPaymentConstraints *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentConstraints_clone")] public static extern long PaymentConstraints_clone(long _orig); + // void PaymentContext_free(struct LDKPaymentContext this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_free")] public static extern void PaymentContext_free(long _this_ptr); + // uint64_t PaymentContext_clone_ptr(LDKPaymentContext *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_clone_ptr")] public static extern long PaymentContext_clone_ptr(long _arg); + // struct LDKPaymentContext PaymentContext_clone(const struct LDKPaymentContext *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_clone")] public static extern long PaymentContext_clone(long _orig); + // struct LDKPaymentContext PaymentContext_unknown(struct LDKUnknownPaymentContext a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_unknown")] public static extern long PaymentContext_unknown(long _a); + // struct LDKPaymentContext PaymentContext_bolt12_offer(struct LDKBolt12OfferContext a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_bolt12_offer")] public static extern long PaymentContext_bolt12_offer(long _a); + // struct LDKPaymentContext PaymentContext_bolt12_refund(struct LDKBolt12RefundContext a); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_bolt12_refund")] public static extern long PaymentContext_bolt12_refund(long _a); + // bool PaymentContext_eq(const struct LDKPaymentContext *NONNULL_PTR a, const struct LDKPaymentContext *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_eq")] public static extern bool PaymentContext_eq(long _a, long _b); + // void UnknownPaymentContext_free(struct LDKUnknownPaymentContext this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnknownPaymentContext_free")] public static extern void UnknownPaymentContext_free(long _this_obj); + // uint64_t UnknownPaymentContext_clone_ptr(LDKUnknownPaymentContext *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnknownPaymentContext_clone_ptr")] public static extern long UnknownPaymentContext_clone_ptr(long _arg); + // struct LDKUnknownPaymentContext UnknownPaymentContext_clone(const struct LDKUnknownPaymentContext *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnknownPaymentContext_clone")] public static extern long UnknownPaymentContext_clone(long _orig); + // bool UnknownPaymentContext_eq(const struct LDKUnknownPaymentContext *NONNULL_PTR a, const struct LDKUnknownPaymentContext *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnknownPaymentContext_eq")] public static extern bool UnknownPaymentContext_eq(long _a, long _b); + // void Bolt12OfferContext_free(struct LDKBolt12OfferContext this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_free")] public static extern void Bolt12OfferContext_free(long _this_obj); + // struct LDKOfferId Bolt12OfferContext_get_offer_id(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_get_offer_id")] public static extern long Bolt12OfferContext_get_offer_id(long _this_ptr); + // void Bolt12OfferContext_set_offer_id(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKOfferId val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_set_offer_id")] public static extern void Bolt12OfferContext_set_offer_id(long _this_ptr, long _val); + // struct LDKInvoiceRequestFields Bolt12OfferContext_get_invoice_request(const struct LDKBolt12OfferContext *NONNULL_PTR this_ptr); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_get_invoice_request")] public static extern long Bolt12OfferContext_get_invoice_request(long _this_ptr); + // void Bolt12OfferContext_set_invoice_request(struct LDKBolt12OfferContext *NONNULL_PTR this_ptr, struct LDKInvoiceRequestFields val); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_set_invoice_request")] public static extern void Bolt12OfferContext_set_invoice_request(long _this_ptr, long _val); + // MUST_USE_RES struct LDKBolt12OfferContext Bolt12OfferContext_new(struct LDKOfferId offer_id_arg, struct LDKInvoiceRequestFields invoice_request_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_new")] public static extern long Bolt12OfferContext_new(long _offer_id_arg, long _invoice_request_arg); + // uint64_t Bolt12OfferContext_clone_ptr(LDKBolt12OfferContext *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_clone_ptr")] public static extern long Bolt12OfferContext_clone_ptr(long _arg); + // struct LDKBolt12OfferContext Bolt12OfferContext_clone(const struct LDKBolt12OfferContext *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_clone")] public static extern long Bolt12OfferContext_clone(long _orig); + // bool Bolt12OfferContext_eq(const struct LDKBolt12OfferContext *NONNULL_PTR a, const struct LDKBolt12OfferContext *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_eq")] public static extern bool Bolt12OfferContext_eq(long _a, long _b); + // void Bolt12RefundContext_free(struct LDKBolt12RefundContext this_obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_free")] public static extern void Bolt12RefundContext_free(long _this_obj); + // MUST_USE_RES struct LDKBolt12RefundContext Bolt12RefundContext_new(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_new")] public static extern long Bolt12RefundContext_new(); + // uint64_t Bolt12RefundContext_clone_ptr(LDKBolt12RefundContext *NONNULL_PTR arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_clone_ptr")] public static extern long Bolt12RefundContext_clone_ptr(long _arg); + // struct LDKBolt12RefundContext Bolt12RefundContext_clone(const struct LDKBolt12RefundContext *NONNULL_PTR orig); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_clone")] public static extern long Bolt12RefundContext_clone(long _orig); + // bool Bolt12RefundContext_eq(const struct LDKBolt12RefundContext *NONNULL_PTR a, const struct LDKBolt12RefundContext *NONNULL_PTR b); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_eq")] public static extern bool Bolt12RefundContext_eq(long _a, long _b); // struct LDKCVec_u8Z ForwardTlvs_write(const struct LDKForwardTlvs *NONNULL_PTR obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ForwardTlvs_write")] public static extern long ForwardTlvs_write(long _obj); // struct LDKCVec_u8Z ReceiveTlvs_write(const struct LDKReceiveTlvs *NONNULL_PTR obj); @@ -12480,14 +13656,34 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentConstraints_write")] public static extern long PaymentConstraints_write(long _obj); // struct LDKCResult_PaymentConstraintsDecodeErrorZ PaymentConstraints_read(struct LDKu8slice ser); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentConstraints_read")] public static extern long PaymentConstraints_read(long _ser); + // struct LDKCVec_u8Z PaymentContext_write(const struct LDKPaymentContext *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_write")] public static extern long PaymentContext_write(long _obj); + // struct LDKCResult_PaymentContextDecodeErrorZ PaymentContext_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentContext_read")] public static extern long PaymentContext_read(long _ser); + // struct LDKCVec_u8Z UnknownPaymentContext_write(const struct LDKUnknownPaymentContext *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnknownPaymentContext_write")] public static extern long UnknownPaymentContext_write(long _obj); + // struct LDKCResult_UnknownPaymentContextDecodeErrorZ UnknownPaymentContext_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_UnknownPaymentContext_read")] public static extern long UnknownPaymentContext_read(long _ser); + // struct LDKCVec_u8Z Bolt12OfferContext_write(const struct LDKBolt12OfferContext *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_write")] public static extern long Bolt12OfferContext_write(long _obj); + // struct LDKCResult_Bolt12OfferContextDecodeErrorZ Bolt12OfferContext_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12OfferContext_read")] public static extern long Bolt12OfferContext_read(long _ser); + // struct LDKCVec_u8Z Bolt12RefundContext_write(const struct LDKBolt12RefundContext *NONNULL_PTR obj); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_write")] public static extern long Bolt12RefundContext_write(long _obj); + // struct LDKCResult_Bolt12RefundContextDecodeErrorZ Bolt12RefundContext_read(struct LDKu8slice ser); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt12RefundContext_read")] public static extern long Bolt12RefundContext_read(long _ser); // void PaymentPurpose_free(struct LDKPaymentPurpose this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_free")] public static extern void PaymentPurpose_free(long _this_ptr); // uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_clone_ptr")] public static extern long PaymentPurpose_clone_ptr(long _arg); // struct LDKPaymentPurpose PaymentPurpose_clone(const struct LDKPaymentPurpose *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_clone")] public static extern long PaymentPurpose_clone(long _orig); - // struct LDKPaymentPurpose PaymentPurpose_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_invoice_payment")] public static extern long PaymentPurpose_invoice_payment(long _payment_preimage, long _payment_secret); + // struct LDKPaymentPurpose PaymentPurpose_bolt11_invoice_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_bolt11_invoice_payment")] public static extern long PaymentPurpose_bolt11_invoice_payment(long _payment_preimage, long _payment_secret); + // struct LDKPaymentPurpose PaymentPurpose_bolt12_offer_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12OfferContext payment_context); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_bolt12_offer_payment")] public static extern long PaymentPurpose_bolt12_offer_payment(long _payment_preimage, long _payment_secret, long _payment_context); + // struct LDKPaymentPurpose PaymentPurpose_bolt12_refund_payment(struct LDKCOption_ThirtyTwoBytesZ payment_preimage, struct LDKThirtyTwoBytes payment_secret, struct LDKBolt12RefundContext payment_context); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_bolt12_refund_payment")] public static extern long PaymentPurpose_bolt12_refund_payment(long _payment_preimage, long _payment_secret, long _payment_context); // struct LDKPaymentPurpose PaymentPurpose_spontaneous_payment(struct LDKThirtyTwoBytes a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_spontaneous_payment")] public static extern long PaymentPurpose_spontaneous_payment(long _a); // bool PaymentPurpose_eq(const struct LDKPaymentPurpose *NONNULL_PTR a, const struct LDKPaymentPurpose *NONNULL_PTR b); @@ -12500,9 +13696,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_PaymentPurpose_read")] public static extern long PaymentPurpose_read(long _ser); // void ClaimedHTLC_free(struct LDKClaimedHTLC this_obj); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_free")] public static extern void ClaimedHTLC_free(long _this_obj); - // const uint8_t (*ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr))[32]; + // struct LDKChannelId ClaimedHTLC_get_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_get_channel_id")] public static extern long ClaimedHTLC_get_channel_id(long _this_ptr); - // void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKThirtyTwoBytes val); + // void ClaimedHTLC_set_channel_id(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, struct LDKChannelId val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_set_channel_id")] public static extern void ClaimedHTLC_set_channel_id(long _this_ptr, long _val); // struct LDKU128 ClaimedHTLC_get_user_channel_id(const struct LDKClaimedHTLC *NONNULL_PTR this_ptr); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_get_user_channel_id")] public static extern long ClaimedHTLC_get_user_channel_id(long _this_ptr); @@ -12520,7 +13716,7 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_get_counterparty_skimmed_fee_msat")] public static extern long ClaimedHTLC_get_counterparty_skimmed_fee_msat(long _this_ptr); // void ClaimedHTLC_set_counterparty_skimmed_fee_msat(struct LDKClaimedHTLC *NONNULL_PTR this_ptr, uint64_t val); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_set_counterparty_skimmed_fee_msat")] public static extern void ClaimedHTLC_set_counterparty_skimmed_fee_msat(long _this_ptr, long _val); - // MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKThirtyTwoBytes channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg); + // MUST_USE_RES struct LDKClaimedHTLC ClaimedHTLC_new(struct LDKChannelId channel_id_arg, struct LDKU128 user_channel_id_arg, uint32_t cltv_expiry_arg, uint64_t value_msat_arg, uint64_t counterparty_skimmed_fee_msat_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_new")] public static extern long ClaimedHTLC_new(long _channel_id_arg, long _user_channel_id_arg, int _cltv_expiry_arg, long _value_msat_arg, long _counterparty_skimmed_fee_msat_arg); // uint64_t ClaimedHTLC_clone_ptr(LDKClaimedHTLC *NONNULL_PTR arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClaimedHTLC_clone_ptr")] public static extern long ClaimedHTLC_clone_ptr(long _arg); @@ -12558,8 +13754,12 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_counterparty_force_closed")] public static extern long ClosureReason_counterparty_force_closed(long _peer_msg); // struct LDKClosureReason ClosureReason_holder_force_closed(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_holder_force_closed")] public static extern long ClosureReason_holder_force_closed(); - // struct LDKClosureReason ClosureReason_cooperative_closure(void); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_cooperative_closure")] public static extern long ClosureReason_cooperative_closure(); + // struct LDKClosureReason ClosureReason_legacy_cooperative_closure(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_legacy_cooperative_closure")] public static extern long ClosureReason_legacy_cooperative_closure(); + // struct LDKClosureReason ClosureReason_counterparty_initiated_cooperative_closure(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_counterparty_initiated_cooperative_closure")] public static extern long ClosureReason_counterparty_initiated_cooperative_closure(); + // struct LDKClosureReason ClosureReason_locally_initiated_cooperative_closure(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_locally_initiated_cooperative_closure")] public static extern long ClosureReason_locally_initiated_cooperative_closure(); // struct LDKClosureReason ClosureReason_commitment_tx_confirmed(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_commitment_tx_confirmed")] public static extern long ClosureReason_commitment_tx_confirmed(); // struct LDKClosureReason ClosureReason_funding_timed_out(void); @@ -12574,6 +13774,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_counterparty_coop_closed_unfunded_channel")] public static extern long ClosureReason_counterparty_coop_closed_unfunded_channel(); // struct LDKClosureReason ClosureReason_funding_batch_closure(void); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_funding_batch_closure")] public static extern long ClosureReason_funding_batch_closure(); + // struct LDKClosureReason ClosureReason_htlcs_timed_out(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_htlcs_timed_out")] public static extern long ClosureReason_htlcs_timed_out(); // bool ClosureReason_eq(const struct LDKClosureReason *NONNULL_PTR a, const struct LDKClosureReason *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_ClosureReason_eq")] public static extern bool ClosureReason_eq(long _a, long _b); // struct LDKCVec_u8Z ClosureReason_write(const struct LDKClosureReason *NONNULL_PTR obj); @@ -12586,12 +13788,14 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_clone_ptr")] public static extern long HTLCDestination_clone_ptr(long _arg); // struct LDKHTLCDestination HTLCDestination_clone(const struct LDKHTLCDestination *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_clone")] public static extern long HTLCDestination_clone(long _orig); - // struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKThirtyTwoBytes channel_id); + // struct LDKHTLCDestination HTLCDestination_next_hop_channel(struct LDKPublicKey node_id, struct LDKChannelId channel_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_next_hop_channel")] public static extern long HTLCDestination_next_hop_channel(long _node_id, long _channel_id); // struct LDKHTLCDestination HTLCDestination_unknown_next_hop(uint64_t requested_forward_scid); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_unknown_next_hop")] public static extern long HTLCDestination_unknown_next_hop(long _requested_forward_scid); // struct LDKHTLCDestination HTLCDestination_invalid_forward(uint64_t requested_forward_scid); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_invalid_forward")] public static extern long HTLCDestination_invalid_forward(long _requested_forward_scid); + // struct LDKHTLCDestination HTLCDestination_invalid_onion(void); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_invalid_onion")] public static extern long HTLCDestination_invalid_onion(); // struct LDKHTLCDestination HTLCDestination_failed_payment(struct LDKThirtyTwoBytes payment_hash); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_HTLCDestination_failed_payment")] public static extern long HTLCDestination_failed_payment(long _payment_hash); // bool HTLCDestination_eq(const struct LDKHTLCDestination *NONNULL_PTR a, const struct LDKHTLCDestination *NONNULL_PTR b); @@ -12626,9 +13830,9 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone_ptr")] public static extern long Event_clone_ptr(long _arg); // struct LDKEvent Event_clone(const struct LDKEvent *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_clone")] public static extern long Event_clone(long _orig); - // struct LDKEvent Event_funding_generation_ready(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id); + // struct LDKEvent Event_funding_generation_ready(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t channel_value_satoshis, struct LDKCVec_u8Z output_script, struct LDKU128 user_channel_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_funding_generation_ready")] public static extern long Event_funding_generation_ready(long _temporary_channel_id, long _counterparty_node_id, long _channel_value_satoshis, long _output_script, long _user_channel_id); - // struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKCOption_ThirtyTwoBytesZ via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline); + // struct LDKEvent Event_payment_claimable(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, struct LDKRecipientOnionFields onion_fields, uint64_t amount_msat, uint64_t counterparty_skimmed_fee_msat, struct LDKPaymentPurpose purpose, struct LDKChannelId via_channel_id, struct LDKCOption_U128Z via_user_channel_id, struct LDKCOption_u32Z claim_deadline); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_claimable")] public static extern long Event_payment_claimable(long _receiver_node_id, long _payment_hash, long _onion_fields, long _amount_msat, long _counterparty_skimmed_fee_msat, long _purpose, long _via_channel_id, long _via_user_channel_id, long _claim_deadline); // struct LDKEvent Event_payment_claimed(struct LDKPublicKey receiver_node_id, struct LDKThirtyTwoBytes payment_hash, uint64_t amount_msat, struct LDKPaymentPurpose purpose, struct LDKCVec_ClaimedHTLCZ htlcs, struct LDKCOption_u64Z sender_intended_total_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_claimed")] public static extern long Event_payment_claimed(long _receiver_node_id, long _payment_hash, long _amount_msat, long _purpose, long _htlcs, long _sender_intended_total_msat); @@ -12652,21 +13856,21 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_pending_htlcs_forwardable")] public static extern long Event_pending_htlcs_forwardable(long _time_forwardable); // struct LDKEvent Event_htlcintercepted(struct LDKThirtyTwoBytes intercept_id, uint64_t requested_next_hop_scid, struct LDKThirtyTwoBytes payment_hash, uint64_t inbound_amount_msat, uint64_t expected_outbound_amount_msat); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_htlcintercepted")] public static extern long Event_htlcintercepted(long _intercept_id, long _requested_next_hop_scid, long _payment_hash, long _inbound_amount_msat, long _expected_outbound_amount_msat); - // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKCOption_ThirtyTwoBytesZ channel_id); + // struct LDKEvent Event_spendable_outputs(struct LDKCVec_SpendableOutputDescriptorZ outputs, struct LDKChannelId channel_id); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_spendable_outputs")] public static extern long Event_spendable_outputs(long _outputs, long _channel_id); - // struct LDKEvent Event_payment_forwarded(struct LDKCOption_ThirtyTwoBytesZ prev_channel_id, struct LDKCOption_ThirtyTwoBytesZ next_channel_id, struct LDKCOption_u64Z fee_earned_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_forwarded")] public static extern long Event_payment_forwarded(long _prev_channel_id, long _next_channel_id, long _fee_earned_msat, bool _claim_from_onchain_tx, long _outbound_amount_forwarded_msat); - // struct LDKEvent Event_channel_pending(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKCOption_ThirtyTwoBytesZ former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_pending")] public static extern long Event_channel_pending(long _channel_id, long _user_channel_id, long _former_temporary_channel_id, long _counterparty_node_id, long _funding_txo); - // struct LDKEvent Event_channel_ready(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type); + // struct LDKEvent Event_payment_forwarded(struct LDKChannelId prev_channel_id, struct LDKChannelId next_channel_id, struct LDKCOption_U128Z prev_user_channel_id, struct LDKCOption_U128Z next_user_channel_id, struct LDKCOption_u64Z total_fee_earned_msat, struct LDKCOption_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, struct LDKCOption_u64Z outbound_amount_forwarded_msat); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_payment_forwarded")] public static extern long Event_payment_forwarded(long _prev_channel_id, long _next_channel_id, long _prev_user_channel_id, long _next_user_channel_id, long _total_fee_earned_msat, long _skimmed_fee_msat, bool _claim_from_onchain_tx, long _outbound_amount_forwarded_msat); + // struct LDKEvent Event_channel_pending(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKChannelId former_temporary_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKOutPoint funding_txo, struct LDKChannelTypeFeatures channel_type); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_pending")] public static extern long Event_channel_pending(long _channel_id, long _user_channel_id, long _former_temporary_channel_id, long _counterparty_node_id, long _funding_txo, long _channel_type); + // struct LDKEvent Event_channel_ready(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKPublicKey counterparty_node_id, struct LDKChannelTypeFeatures channel_type); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_ready")] public static extern long Event_channel_ready(long _channel_id, long _user_channel_id, long _counterparty_node_id, long _channel_type); - // struct LDKEvent Event_channel_closed(struct LDKThirtyTwoBytes channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo); + // struct LDKEvent Event_channel_closed(struct LDKChannelId channel_id, struct LDKU128 user_channel_id, struct LDKClosureReason reason, struct LDKPublicKey counterparty_node_id, struct LDKCOption_u64Z channel_capacity_sats, struct LDKOutPoint channel_funding_txo); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_channel_closed")] public static extern long Event_channel_closed(long _channel_id, long _user_channel_id, long _reason, long _counterparty_node_id, long _channel_capacity_sats, long _channel_funding_txo); - // struct LDKEvent Event_discard_funding(struct LDKThirtyTwoBytes channel_id, struct LDKTransaction transaction); + // struct LDKEvent Event_discard_funding(struct LDKChannelId channel_id, struct LDKTransaction transaction); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_discard_funding")] public static extern long Event_discard_funding(long _channel_id, long _transaction); - // struct LDKEvent Event_open_channel_request(struct LDKThirtyTwoBytes temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type); + // struct LDKEvent Event_open_channel_request(struct LDKChannelId temporary_channel_id, struct LDKPublicKey counterparty_node_id, uint64_t funding_satoshis, uint64_t push_msat, struct LDKChannelTypeFeatures channel_type); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_open_channel_request")] public static extern long Event_open_channel_request(long _temporary_channel_id, long _counterparty_node_id, long _funding_satoshis, long _push_msat, long _channel_type); - // struct LDKEvent Event_htlchandling_failed(struct LDKThirtyTwoBytes prev_channel_id, struct LDKHTLCDestination failed_next_destination); + // struct LDKEvent Event_htlchandling_failed(struct LDKChannelId prev_channel_id, struct LDKHTLCDestination failed_next_destination); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_htlchandling_failed")] public static extern long Event_htlchandling_failed(long _prev_channel_id, long _failed_next_destination); // struct LDKEvent Event_bump_transaction(struct LDKBumpTransactionEvent a); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Event_bump_transaction")] public static extern long Event_bump_transaction(long _a); @@ -12794,10 +13998,10 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_clone_ptr")] public static extern long BumpTransactionEvent_clone_ptr(long _arg); // struct LDKBumpTransactionEvent BumpTransactionEvent_clone(const struct LDKBumpTransactionEvent *NONNULL_PTR orig); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_clone")] public static extern long BumpTransactionEvent_clone(long _orig); - // struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_channel_close")] public static extern long BumpTransactionEvent_channel_close(long _claim_id, int _package_target_feerate_sat_per_1000_weight, long _commitment_tx, long _commitment_tx_fee_satoshis, long _anchor_descriptor, long _pending_htlcs); - // struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time); - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_htlcresolution")] public static extern long BumpTransactionEvent_htlcresolution(long _claim_id, int _target_feerate_sat_per_1000_weight, long _htlc_descriptors, int _tx_lock_time); + // struct LDKBumpTransactionEvent BumpTransactionEvent_channel_close(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t package_target_feerate_sat_per_1000_weight, struct LDKTransaction commitment_tx, uint64_t commitment_tx_fee_satoshis, struct LDKAnchorDescriptor anchor_descriptor, struct LDKCVec_HTLCOutputInCommitmentZ pending_htlcs); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_channel_close")] public static extern long BumpTransactionEvent_channel_close(long _channel_id, long _counterparty_node_id, long _claim_id, int _package_target_feerate_sat_per_1000_weight, long _commitment_tx, long _commitment_tx_fee_satoshis, long _anchor_descriptor, long _pending_htlcs); + // struct LDKBumpTransactionEvent BumpTransactionEvent_htlcresolution(struct LDKChannelId channel_id, struct LDKPublicKey counterparty_node_id, struct LDKThirtyTwoBytes claim_id, uint32_t target_feerate_sat_per_1000_weight, struct LDKCVec_HTLCDescriptorZ htlc_descriptors, uint32_t tx_lock_time); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_htlcresolution")] public static extern long BumpTransactionEvent_htlcresolution(long _channel_id, long _counterparty_node_id, long _claim_id, int _target_feerate_sat_per_1000_weight, long _htlc_descriptors, int _tx_lock_time); // bool BumpTransactionEvent_eq(const struct LDKBumpTransactionEvent *NONNULL_PTR a, const struct LDKBumpTransactionEvent *NONNULL_PTR b); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_BumpTransactionEvent_eq")] public static extern bool BumpTransactionEvent_eq(long _a, long _b); // void Input_free(struct LDKInput this_obj); @@ -13226,6 +14430,8 @@ internal class bindings { [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_features")] public static extern long Bolt11Invoice_features(long _this_arg); // MUST_USE_RES struct LDKPublicKey Bolt11Invoice_recover_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_recover_payee_pub_key")] public static extern long Bolt11Invoice_recover_payee_pub_key(long _this_arg); + // MUST_USE_RES struct LDKPublicKey Bolt11Invoice_get_payee_pub_key(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_get_payee_pub_key")] public static extern long Bolt11Invoice_get_payee_pub_key(long _this_arg); // MUST_USE_RES struct LDKCOption_u64Z Bolt11Invoice_expires_at(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); [DllImport ("ldkcsharp", EntryPoint="CS_LDK_Bolt11Invoice_expires_at")] public static extern long Bolt11Invoice_expires_at(long _this_arg); // MUST_USE_RES uint64_t Bolt11Invoice_expiry_time(const struct LDKBolt11Invoice *NONNULL_PTR this_arg); @@ -13468,21 +14674,21 @@ internal class bindings { Environment.Exit(44); } return ((LDKSignerProvider)obj).get_destination_script(a); - case 62: + case 64: if (!(obj is LDKPersister)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersister in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKPersister)obj).persist_manager(a); - case 63: + case 65: if (!(obj is LDKPersister)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersister in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKPersister)obj).persist_graph(a); - case 64: + case 66: if (!(obj is LDKPersister)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersister in l_l"); Console.Error.Flush(); @@ -13504,83 +14710,104 @@ internal class bindings { } return ((LDKOffersMessageHandler)obj).handle_message(a); case 118: + if (!(obj is LDKNodeIdLookUp)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKNodeIdLookUp in l_l"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKNodeIdLookUp)obj).next_node_id(a); + case 119: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_node_announcement(a); - case 119: + case 120: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_channel_announcement(a); - case 120: + case 121: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_channel_update(a); - case 121: + case 122: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).get_next_channel_announcement(a); - case 122: + case 123: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).get_next_node_announcement(a); - case 130: + case 131: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).provided_init_features(a); - case 133: + case 134: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOnionMessageHandler)obj).next_onion_message_for_peer(a); - case 138: + case 139: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOnionMessageHandler)obj).provided_init_features(a); - case 143: + case 144: if (!(obj is LDKCustomMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCustomMessageHandler)obj).provided_init_features(a); - case 144: + case 145: if (!(obj is LDKCustomOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomOnionMessageHandler in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCustomOnionMessageHandler)obj).handle_custom_message(a); + case 152: + if (!(obj is LDKSignBolt12InvoiceFn)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKSignBolt12InvoiceFn in l_l"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKSignBolt12InvoiceFn)obj).sign_invoice(a); case 153: + if (!(obj is LDKSignInvoiceRequestFn)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKSignInvoiceRequestFn in l_l"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKSignInvoiceRequestFn)obj).sign_invoice_request(a); + case 156: if (!(obj is LDKCoinSelectionSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCoinSelectionSource in l_l"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCoinSelectionSource)obj).sign_psbt(a); - case 156: + case 159: if (!(obj is LDKWalletSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWalletSource in l_l"); Console.Error.Flush(); @@ -13660,49 +14887,49 @@ internal class bindings { Environment.Exit(44); } return ((LDKMessageRouter)obj).create_blinded_paths(a, b); - case 61: + case 62: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKKVStore)obj).list(a, b); - case 124: + case 125: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_reply_channel_range(a, b); - case 125: + case 126: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_reply_short_channel_ids_end(a, b); - case 126: + case 127: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_query_channel_range(a, b); - case 127: + case 128: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).handle_query_short_channel_ids(a, b); - case 140: + case 141: if (!(obj is LDKCustomMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageHandler in l_ll"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCustomMessageHandler)obj).handle_custom_message(a, b); - case 145: + case 146: if (!(obj is LDKCustomOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomOnionMessageHandler in l_ll"); Console.Error.Flush(); @@ -13831,14 +15058,21 @@ internal class bindings { Environment.Exit(44); } return ((LDKOnionMessageContents)obj).debug_str(); - case 74: + case 58: + if (!(obj is LDKChangeDestinationSource)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKChangeDestinationSource in l_"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKChangeDestinationSource)obj).get_change_destination_script(); + case 76: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKConfirm)obj).get_relevant_txids(); - case 77: + case 80: if (!(obj is LDKMessageSendEventsProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKMessageSendEventsProvider in l_"); Console.Error.Flush(); @@ -13866,70 +15100,70 @@ internal class bindings { Environment.Exit(44); } return ((LDKOffersMessageHandler)obj).release_pending_messages(); - case 129: + case 130: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).provided_node_features(); - case 131: + case 132: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOnionMessageHandler)obj).get_and_clear_connections_needed(); - case 137: + case 138: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKOnionMessageHandler)obj).provided_node_features(); - case 141: + case 142: if (!(obj is LDKCustomMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCustomMessageHandler)obj).get_and_clear_pending_msg(); - case 142: + case 143: if (!(obj is LDKCustomMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCustomMessageHandler)obj).provided_node_features(); - case 146: + case 147: if (!(obj is LDKCustomOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomOnionMessageHandler in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKCustomOnionMessageHandler)obj).release_pending_custom_messages(); - case 150: + case 151: if (!(obj is LDKSocketDescriptor)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKSocketDescriptor)obj).hash(); - case 151: + case 154: if (!(obj is LDKScore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKScore in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKScore)obj).write(); - case 154: + case 157: if (!(obj is LDKWalletSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWalletSource in l_"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKWalletSource)obj).list_confirmed_utxos(); - case 155: + case 158: if (!(obj is LDKWalletSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKWalletSource in l_"); Console.Error.Flush(); @@ -14000,7 +15234,15 @@ internal class bindings { } ((LDKFilter)obj).register_output(a); return; - case 72: + case 69: + if (!(obj is LDKPersist)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKPersist in void_l"); + Console.Error.Flush(); + Environment.Exit(44); + } + ((LDKPersist)obj).archive_persisted_channel(a); + return; + case 74: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in void_l"); Console.Error.Flush(); @@ -14008,7 +15250,7 @@ internal class bindings { } ((LDKConfirm)obj).transaction_unconfirmed(a); return; - case 75: + case 78: if (!(obj is LDKEventHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKEventHandler in void_l"); Console.Error.Flush(); @@ -14016,7 +15258,7 @@ internal class bindings { } ((LDKEventHandler)obj).handle_event(a); return; - case 76: + case 79: if (!(obj is LDKEventsProvider)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKEventsProvider in void_l"); Console.Error.Flush(); @@ -14032,7 +15274,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).peer_disconnected(a); return; - case 135: + case 136: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_l"); Console.Error.Flush(); @@ -14092,7 +15334,7 @@ internal class bindings { Environment.Exit(44); } return ((LDKMessageRouter)obj).find_path(a, b, c); - case 58: + case 59: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_lll"); Console.Error.Flush(); @@ -14144,7 +15386,7 @@ internal class bindings { Environment.Exit(44); } return ((LDKRouter)obj).create_blinded_payment_paths(a, b, c, d); - case 59: + case 60: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_llll"); Console.Error.Flush(); @@ -14277,37 +15519,13 @@ internal class bindings { } ((LDKFilter)obj).register_tx(a, b); return; - case 78: - if (!(obj is LDKChannelMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); - Console.Error.Flush(); - Environment.Exit(44); - } - ((LDKChannelMessageHandler)obj).handle_open_channel(a, b); - return; - case 79: - if (!(obj is LDKChannelMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); - Console.Error.Flush(); - Environment.Exit(44); - } - ((LDKChannelMessageHandler)obj).handle_open_channel_v2(a, b); - return; - case 80: - if (!(obj is LDKChannelMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); - Console.Error.Flush(); - Environment.Exit(44); - } - ((LDKChannelMessageHandler)obj).handle_accept_channel(a, b); - return; case 81: if (!(obj is LDKChannelMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKChannelMessageHandler in void_ll"); Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_accept_channel_v2(a, b); + ((LDKChannelMessageHandler)obj).handle_open_channel(a, b); return; case 82: if (!(obj is LDKChannelMessageHandler)) { @@ -14315,7 +15533,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_funding_created(a, b); + ((LDKChannelMessageHandler)obj).handle_open_channel_v2(a, b); return; case 83: if (!(obj is LDKChannelMessageHandler)) { @@ -14323,7 +15541,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_funding_signed(a, b); + ((LDKChannelMessageHandler)obj).handle_accept_channel(a, b); return; case 84: if (!(obj is LDKChannelMessageHandler)) { @@ -14331,7 +15549,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_channel_ready(a, b); + ((LDKChannelMessageHandler)obj).handle_accept_channel_v2(a, b); return; case 85: if (!(obj is LDKChannelMessageHandler)) { @@ -14339,7 +15557,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_shutdown(a, b); + ((LDKChannelMessageHandler)obj).handle_funding_created(a, b); return; case 86: if (!(obj is LDKChannelMessageHandler)) { @@ -14347,7 +15565,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_closing_signed(a, b); + ((LDKChannelMessageHandler)obj).handle_funding_signed(a, b); return; case 87: if (!(obj is LDKChannelMessageHandler)) { @@ -14355,7 +15573,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_stfu(a, b); + ((LDKChannelMessageHandler)obj).handle_channel_ready(a, b); return; case 88: if (!(obj is LDKChannelMessageHandler)) { @@ -14363,7 +15581,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_splice(a, b); + ((LDKChannelMessageHandler)obj).handle_shutdown(a, b); return; case 89: if (!(obj is LDKChannelMessageHandler)) { @@ -14371,7 +15589,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_splice_ack(a, b); + ((LDKChannelMessageHandler)obj).handle_closing_signed(a, b); return; case 90: if (!(obj is LDKChannelMessageHandler)) { @@ -14379,7 +15597,7 @@ internal class bindings { Console.Error.Flush(); Environment.Exit(44); } - ((LDKChannelMessageHandler)obj).handle_splice_locked(a, b); + ((LDKChannelMessageHandler)obj).handle_stfu(a, b); return; case 91: if (!(obj is LDKChannelMessageHandler)) { @@ -14541,7 +15759,7 @@ internal class bindings { } ((LDKChannelMessageHandler)obj).handle_error(a, b); return; - case 132: + case 133: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_ll"); Console.Error.Flush(); @@ -14821,7 +16039,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 60: + case 61: if (!(obj is LDKKVStore)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKKVStore in l_lllb"); Console.Error.Flush(); @@ -14839,6 +16057,37 @@ internal class bindings { static l_lllb_callback l_lllb_callback_inst = c_callback_l_lllb; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_l_lllb_invoker")] public static extern int register_l_lllb_invoker(l_lllb_callback callee); static int _run_l_lllb_registration = register_l_lllb_invoker(l_lllb_callback_inst); + static long c_callback_l_lllil(int obj_ptr, int fn_id, long a, long b, long c, int d, long e) { + if (obj_ptr >= js_objs.Count) { + Console.Error.WriteLine("Got function call on unknown/free'd JS object in l_lllil"); + Console.Error.Flush(); + Environment.Exit(42); + } + object obj = js_objs[obj_ptr].Target; + if (obj == null) { + Console.Error.WriteLine("Got function call on GC'd JS object in l_lllil"); + Console.Error.Flush(); + Environment.Exit(43); + } + switch (fn_id) { + case 63: + if (!(obj is LDKOutputSpender)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKOutputSpender in l_lllil"); + Console.Error.Flush(); + Environment.Exit(44); + } + return ((LDKOutputSpender)obj).spend_spendable_outputs(a, b, c, d, e); + default: + Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in l_lllil"); + Console.Error.Flush(); + Environment.Exit(45); + return 0; + } + } + public delegate long l_lllil_callback(int obj_ptr, int fn_id, long a, long b, long c, int d, long e); + static l_lllil_callback l_lllil_callback_inst = c_callback_l_lllil; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_l_lllil_invoker")] public static extern int register_l_lllil_invoker(l_lllil_callback callee); + static int _run_l_lllil_registration = register_l_lllil_invoker(l_lllil_callback_inst); static ChannelMonitorUpdateStatus c_callback_ChannelMonitorUpdateStatus_lll(int obj_ptr, int fn_id, long a, long b, long c) { if (obj_ptr >= js_objs.Count) { Console.Error.WriteLine("Got function call on unknown/free'd JS object in ChannelMonitorUpdateStatus_lll"); @@ -14852,7 +16101,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 65: + case 67: if (!(obj is LDKPersist)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersist in ChannelMonitorUpdateStatus_lll"); Console.Error.Flush(); @@ -14883,7 +16132,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 66: + case 68: if (!(obj is LDKPersist)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKPersist in ChannelMonitorUpdateStatus_llll"); Console.Error.Flush(); @@ -14901,54 +16150,6 @@ internal class bindings { static ChannelMonitorUpdateStatus_llll_callback ChannelMonitorUpdateStatus_llll_callback_inst = c_callback_ChannelMonitorUpdateStatus_llll; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_ChannelMonitorUpdateStatus_llll_invoker")] public static extern int register_ChannelMonitorUpdateStatus_llll_invoker(ChannelMonitorUpdateStatus_llll_callback callee); static int _run_ChannelMonitorUpdateStatus_llll_registration = register_ChannelMonitorUpdateStatus_llll_invoker(ChannelMonitorUpdateStatus_llll_callback_inst); - static void c_callback_void_(int obj_ptr, int fn_id) { - if (obj_ptr >= js_objs.Count) { - Console.Error.WriteLine("Got function call on unknown/free'd JS object in void_"); - Console.Error.Flush(); - Environment.Exit(42); - } - object obj = js_objs[obj_ptr].Target; - if (obj == null) { - Console.Error.WriteLine("Got function call on GC'd JS object in void_"); - Console.Error.Flush(); - Environment.Exit(43); - } - switch (fn_id) { - case 67: - if (!(obj is LDKFutureCallback)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKFutureCallback in void_"); - Console.Error.Flush(); - Environment.Exit(44); - } - ((LDKFutureCallback)obj).call(); - return; - case 136: - if (!(obj is LDKOnionMessageHandler)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_"); - Console.Error.Flush(); - Environment.Exit(44); - } - ((LDKOnionMessageHandler)obj).timer_tick_occurred(); - return; - case 148: - if (!(obj is LDKSocketDescriptor)) { - Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in void_"); - Console.Error.Flush(); - Environment.Exit(44); - } - ((LDKSocketDescriptor)obj).disconnect_socket(); - return; - default: - Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in void_"); - Console.Error.Flush(); - Environment.Exit(45); - return; - } - } - public delegate void void__callback(int obj_ptr, int fn_id); - static void__callback void__callback_inst = c_callback_void_; - [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_void__invoker")] public static extern int register_void__invoker(void__callback callee); - static int _run_void__registration = register_void__invoker(void__callback_inst); static void c_callback_void_lli(int obj_ptr, int fn_id, long a, long b, int c) { if (obj_ptr >= js_objs.Count) { Console.Error.WriteLine("Got function call on unknown/free'd JS object in void_lli"); @@ -14962,7 +16163,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 68: + case 70: if (!(obj is LDKListen)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKListen in void_lli"); Console.Error.Flush(); @@ -14970,7 +16171,7 @@ internal class bindings { } ((LDKListen)obj).filtered_block_connected(a, b, c); return; - case 71: + case 73: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in void_lli"); Console.Error.Flush(); @@ -15002,7 +16203,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 69: + case 71: if (!(obj is LDKListen)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKListen in void_li"); Console.Error.Flush(); @@ -15010,7 +16211,7 @@ internal class bindings { } ((LDKListen)obj).block_connected(a, b); return; - case 70: + case 72: if (!(obj is LDKListen)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKListen in void_li"); Console.Error.Flush(); @@ -15018,7 +16219,7 @@ internal class bindings { } ((LDKListen)obj).block_disconnected(a, b); return; - case 73: + case 75: if (!(obj is LDKConfirm)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKConfirm in void_li"); Console.Error.Flush(); @@ -15037,6 +16238,54 @@ internal class bindings { static void_li_callback void_li_callback_inst = c_callback_void_li; [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_void_li_invoker")] public static extern int register_void_li_invoker(void_li_callback callee); static int _run_void_li_registration = register_void_li_invoker(void_li_callback_inst); + static void c_callback_void_(int obj_ptr, int fn_id) { + if (obj_ptr >= js_objs.Count) { + Console.Error.WriteLine("Got function call on unknown/free'd JS object in void_"); + Console.Error.Flush(); + Environment.Exit(42); + } + object obj = js_objs[obj_ptr].Target; + if (obj == null) { + Console.Error.WriteLine("Got function call on GC'd JS object in void_"); + Console.Error.Flush(); + Environment.Exit(43); + } + switch (fn_id) { + case 77: + if (!(obj is LDKFutureCallback)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKFutureCallback in void_"); + Console.Error.Flush(); + Environment.Exit(44); + } + ((LDKFutureCallback)obj).call(); + return; + case 137: + if (!(obj is LDKOnionMessageHandler)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in void_"); + Console.Error.Flush(); + Environment.Exit(44); + } + ((LDKOnionMessageHandler)obj).timer_tick_occurred(); + return; + case 149: + if (!(obj is LDKSocketDescriptor)) { + Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in void_"); + Console.Error.Flush(); + Environment.Exit(44); + } + ((LDKSocketDescriptor)obj).disconnect_socket(); + return; + default: + Console.Error.WriteLine("Got unknown function call with id " + fn_id + " from C in void_"); + Console.Error.Flush(); + Environment.Exit(45); + return; + } + } + public delegate void void__callback(int obj_ptr, int fn_id); + static void__callback void__callback_inst = c_callback_void_; + [DllImport ("ldkcsharp", EntryPoint="CS_LDK_register_void__invoker")] public static extern int register_void__invoker(void__callback callee); + static int _run_void__registration = register_void__invoker(void__callback_inst); static long c_callback_l_llb(int obj_ptr, int fn_id, long a, long b, bool c) { if (obj_ptr >= js_objs.Count) { Console.Error.WriteLine("Got function call on unknown/free'd JS object in l_llb"); @@ -15057,14 +16306,14 @@ internal class bindings { Environment.Exit(44); } return ((LDKChannelMessageHandler)obj).peer_connected(a, b, c); - case 123: + case 124: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in l_llb"); Console.Error.Flush(); Environment.Exit(44); } return ((LDKRoutingMessageHandler)obj).peer_connected(a, b, c); - case 134: + case 135: if (!(obj is LDKOnionMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKOnionMessageHandler in l_llb"); Console.Error.Flush(); @@ -15095,7 +16344,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 128: + case 129: if (!(obj is LDKRoutingMessageHandler)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKRoutingMessageHandler in b_"); Console.Error.Flush(); @@ -15126,7 +16375,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 139: + case 140: if (!(obj is LDKCustomMessageReader)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCustomMessageReader in l_sl"); Console.Error.Flush(); @@ -15157,7 +16406,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 147: + case 148: if (!(obj is LDKSocketDescriptor)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in l_lb"); Console.Error.Flush(); @@ -15188,7 +16437,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 149: + case 150: if (!(obj is LDKSocketDescriptor)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKSocketDescriptor in b_l"); Console.Error.Flush(); @@ -15219,7 +16468,7 @@ internal class bindings { Environment.Exit(43); } switch (fn_id) { - case 152: + case 155: if (!(obj is LDKCoinSelectionSource)) { Console.Error.WriteLine("Got function call to object that wasn't a LDKCoinSelectionSource in l_llli"); Console.Error.Flush(); diff --git a/c_sharp/src/org/ldk/structs/APIError.cs b/c_sharp/src/org/ldk/structs/APIError.cs index a9218c88..8284b363 100644 --- a/c_sharp/src/org/ldk/structs/APIError.cs +++ b/c_sharp/src/org/ldk/structs/APIError.cs @@ -182,7 +182,7 @@ public class APIError : CommonBase { * Utility method to constructs a new IncompatibleShutdownScript-variant APIError */ public static APIError incompatible_shutdown_script(org.ldk.structs.ShutdownScript script) { - long ret = bindings.APIError_incompatible_shutdown_script(script == null ? 0 : script.ptr); + long ret = bindings.APIError_incompatible_shutdown_script(script.ptr); GC.KeepAlive(script); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.APIError ret_hu_conv = org.ldk.structs.APIError.constr_from_ptr(ret); @@ -196,7 +196,7 @@ public class APIError : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.APIError b) { - bool ret = bindings.APIError_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.APIError_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/AcceptChannel.cs b/c_sharp/src/org/ldk/structs/AcceptChannel.cs index ffa4cfa0..5a19a661 100644 --- a/c_sharp/src/org/ldk/structs/AcceptChannel.cs +++ b/c_sharp/src/org/ldk/structs/AcceptChannel.cs @@ -20,59 +20,25 @@ public class AcceptChannel : CommonBase { } /** - * A temporary channel ID, until the funding outpoint is announced + * Common fields of `accept_channel(2)`-like messages */ - public byte[] get_temporary_channel_id() { - long ret = bindings.AcceptChannel_get_temporary_channel_id(this.ptr); + public CommonAcceptChannelFields get_common_fields() { + long ret = bindings.AcceptChannel_get_common_fields(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * A temporary channel ID, until the funding outpoint is announced - */ - public void set_temporary_channel_id(byte[] val) { - bindings.AcceptChannel_set_temporary_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The threshold below which outputs on transactions broadcast by sender will be omitted - */ - public long get_dust_limit_satoshis() { - long ret = bindings.AcceptChannel_get_dust_limit_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The threshold below which outputs on transactions broadcast by sender will be omitted - */ - public void set_dust_limit_satoshis(long val) { - bindings.AcceptChannel_set_dust_limit_satoshis(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum inbound HTLC value in flight towards sender, in milli-satoshi - */ - public long get_max_htlc_value_in_flight_msat() { - long ret = bindings.AcceptChannel_get_max_htlc_value_in_flight_msat(this.ptr); - GC.KeepAlive(this); - return ret; + org.ldk.structs.CommonAcceptChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonAcceptChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + * Common fields of `accept_channel(2)`-like messages */ - public void set_max_htlc_value_in_flight_msat(long val) { - bindings.AcceptChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); + public void set_common_fields(org.ldk.structs.CommonAcceptChannelFields val) { + bindings.AcceptChannel_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -93,282 +59,17 @@ public class AcceptChannel : CommonBase { GC.KeepAlive(val); } - /** - * The minimum HTLC size incoming to sender, in milli-satoshi - */ - public long get_htlc_minimum_msat() { - long ret = bindings.AcceptChannel_get_htlc_minimum_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The minimum HTLC size incoming to sender, in milli-satoshi - */ - public void set_htlc_minimum_msat(long val) { - bindings.AcceptChannel_set_htlc_minimum_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Minimum depth of the funding transaction before the channel is considered open - */ - public int get_minimum_depth() { - int ret = bindings.AcceptChannel_get_minimum_depth(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Minimum depth of the funding transaction before the channel is considered open - */ - public void set_minimum_depth(int val) { - bindings.AcceptChannel_set_minimum_depth(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction - */ - public short get_to_self_delay() { - short ret = bindings.AcceptChannel_get_to_self_delay(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they broadcast a commitment transaction - */ - public void set_to_self_delay(short val) { - bindings.AcceptChannel_set_to_self_delay(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum number of inbound HTLCs towards sender - */ - public short get_max_accepted_htlcs() { - short ret = bindings.AcceptChannel_get_max_accepted_htlcs(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum number of inbound HTLCs towards sender - */ - public void set_max_accepted_htlcs(short val) { - bindings.AcceptChannel_set_max_accepted_htlcs(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The sender's key controlling the funding transaction - */ - public byte[] get_funding_pubkey() { - long ret = bindings.AcceptChannel_get_funding_pubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The sender's key controlling the funding transaction - */ - public void set_funding_pubkey(byte[] val) { - bindings.AcceptChannel_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public byte[] get_revocation_basepoint() { - long ret = bindings.AcceptChannel_get_revocation_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public void set_revocation_basepoint(byte[] val) { - bindings.AcceptChannel_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A payment key to sender for transactions broadcast by counterparty - */ - public byte[] get_payment_point() { - long ret = bindings.AcceptChannel_get_payment_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * A payment key to sender for transactions broadcast by counterparty - */ - public void set_payment_point(byte[] val) { - bindings.AcceptChannel_set_payment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a payment key to sender for transactions broadcast by sender - */ - public byte[] get_delayed_payment_basepoint() { - long ret = bindings.AcceptChannel_get_delayed_payment_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a payment key to sender for transactions broadcast by sender - */ - public void set_delayed_payment_basepoint(byte[] val) { - bindings.AcceptChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty - */ - public byte[] get_htlc_basepoint() { - long ret = bindings.AcceptChannel_get_htlc_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive an HTLC payment key to sender for transactions broadcast by counterparty - */ - public void set_htlc_basepoint(byte[] val) { - bindings.AcceptChannel_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The first to-be-broadcast-by-sender transaction's per commitment point - */ - public byte[] get_first_per_commitment_point() { - long ret = bindings.AcceptChannel_get_first_per_commitment_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The first to-be-broadcast-by-sender transaction's per commitment point - */ - public void set_first_per_commitment_point(byte[] val) { - bindings.AcceptChannel_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close - */ - public Option_CVec_u8ZZ get_shutdown_scriptpubkey() { - long ret = bindings.AcceptChannel_get_shutdown_scriptpubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * A request to pre-set the to-sender output's scriptPubkey for when we collaboratively close - */ - public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) { - bindings.AcceptChannel_set_shutdown_scriptpubkey(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * The channel type that this channel will represent. - * - * If this is `None`, we derive the channel type from the intersection of - * our feature bits with our counterparty's feature bits from the [`Init`] message. - * This is required to match the equivalent field in [`OpenChannel::channel_type`]. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public ChannelTypeFeatures get_channel_type() { - long ret = bindings.AcceptChannel_get_channel_type(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The channel type that this channel will represent. - * - * If this is `None`, we derive the channel type from the intersection of - * our feature bits with our counterparty's feature bits from the [`Init`] message. - * This is required to match the equivalent field in [`OpenChannel::channel_type`]. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { - bindings.AcceptChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - /** * Constructs a new AcceptChannel given each field - * - * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static AcceptChannel of(byte[] temporary_channel_id_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long channel_reserve_satoshis_arg, long htlc_minimum_msat_arg, int minimum_depth_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg) { - long ret = bindings.AcceptChannel_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id_arg, 32)), 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, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_point_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr); - GC.KeepAlive(temporary_channel_id_arg); - GC.KeepAlive(dust_limit_satoshis_arg); - GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + public static AcceptChannel of(org.ldk.structs.CommonAcceptChannelFields common_fields_arg, long channel_reserve_satoshis_arg) { + long ret = bindings.AcceptChannel_new(common_fields_arg.ptr, channel_reserve_satoshis_arg); + GC.KeepAlive(common_fields_arg); GC.KeepAlive(channel_reserve_satoshis_arg); - GC.KeepAlive(htlc_minimum_msat_arg); - GC.KeepAlive(minimum_depth_arg); - GC.KeepAlive(to_self_delay_arg); - GC.KeepAlive(max_accepted_htlcs_arg); - GC.KeepAlive(funding_pubkey_arg); - GC.KeepAlive(revocation_basepoint_arg); - GC.KeepAlive(payment_point_arg); - GC.KeepAlive(delayed_payment_basepoint_arg); - GC.KeepAlive(htlc_basepoint_arg); - GC.KeepAlive(first_per_commitment_point_arg); - GC.KeepAlive(shutdown_scriptpubkey_arg); - GC.KeepAlive(channel_type_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AcceptChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannel(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(common_fields_arg); }; return ret_hu_conv; } @@ -408,7 +109,7 @@ public class AcceptChannel : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.AcceptChannel b) { - bool ret = bindings.AcceptChannel_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.AcceptChannel_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs b/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs index 1090715d..65be5633 100644 --- a/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs +++ b/c_sharp/src/org/ldk/structs/AcceptChannelV2.cs @@ -18,23 +18,25 @@ public class AcceptChannelV2 : CommonBase { } /** - * The same `temporary_channel_id` received from the initiator's `open_channel2` message. + * Common fields of `accept_channel(2)`-like messages */ - public byte[] get_temporary_channel_id() { - long ret = bindings.AcceptChannelV2_get_temporary_channel_id(this.ptr); + public CommonAcceptChannelFields get_common_fields() { + long ret = bindings.AcceptChannelV2_get_common_fields(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.CommonAcceptChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonAcceptChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * The same `temporary_channel_id` received from the initiator's `open_channel2` message. + * Common fields of `accept_channel(2)`-like messages */ - public void set_temporary_channel_id(byte[] val) { - bindings.AcceptChannelV2_set_temporary_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_common_fields(org.ldk.structs.CommonAcceptChannelFields val) { + bindings.AcceptChannelV2_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -55,240 +57,6 @@ public class AcceptChannelV2 : CommonBase { GC.KeepAlive(val); } - /** - * The threshold below which outputs on transactions broadcast by the channel acceptor will be - * omitted - */ - public long get_dust_limit_satoshis() { - long ret = bindings.AcceptChannelV2_get_dust_limit_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The threshold below which outputs on transactions broadcast by the channel acceptor will be - * omitted - */ - public void set_dust_limit_satoshis(long val) { - bindings.AcceptChannelV2_set_dust_limit_satoshis(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi - */ - public long get_max_htlc_value_in_flight_msat() { - long ret = bindings.AcceptChannelV2_get_max_htlc_value_in_flight_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum inbound HTLC value in flight towards channel acceptor, in milli-satoshi - */ - public void set_max_htlc_value_in_flight_msat(long val) { - bindings.AcceptChannelV2_set_max_htlc_value_in_flight_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The minimum HTLC size incoming to channel acceptor, in milli-satoshi - */ - public long get_htlc_minimum_msat() { - long ret = bindings.AcceptChannelV2_get_htlc_minimum_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The minimum HTLC size incoming to channel acceptor, in milli-satoshi - */ - public void set_htlc_minimum_msat(long val) { - bindings.AcceptChannelV2_set_htlc_minimum_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Minimum depth of the funding transaction before the channel is considered open - */ - public int get_minimum_depth() { - int ret = bindings.AcceptChannelV2_get_minimum_depth(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Minimum depth of the funding transaction before the channel is considered open - */ - public void set_minimum_depth(int val) { - bindings.AcceptChannelV2_set_minimum_depth(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they - * broadcast a commitment transaction - */ - public short get_to_self_delay() { - short ret = bindings.AcceptChannelV2_get_to_self_delay(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they - * broadcast a commitment transaction - */ - public void set_to_self_delay(short val) { - bindings.AcceptChannelV2_set_to_self_delay(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum number of inbound HTLCs towards channel acceptor - */ - public short get_max_accepted_htlcs() { - short ret = bindings.AcceptChannelV2_get_max_accepted_htlcs(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum number of inbound HTLCs towards channel acceptor - */ - public void set_max_accepted_htlcs(short val) { - bindings.AcceptChannelV2_set_max_accepted_htlcs(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The channel acceptor's key controlling the funding transaction - */ - public byte[] get_funding_pubkey() { - long ret = bindings.AcceptChannelV2_get_funding_pubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The channel acceptor's key controlling the funding transaction - */ - public void set_funding_pubkey(byte[] val) { - bindings.AcceptChannelV2_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public byte[] get_revocation_basepoint() { - long ret = bindings.AcceptChannelV2_get_revocation_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public void set_revocation_basepoint(byte[] val) { - bindings.AcceptChannelV2_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A payment key to channel acceptor for transactions broadcast by counterparty - */ - public byte[] get_payment_basepoint() { - long ret = bindings.AcceptChannelV2_get_payment_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * A payment key to channel acceptor for transactions broadcast by counterparty - */ - public void set_payment_basepoint(byte[] val) { - bindings.AcceptChannelV2_set_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a payment key to channel acceptor for transactions broadcast by channel - * acceptor - */ - public byte[] get_delayed_payment_basepoint() { - long ret = bindings.AcceptChannelV2_get_delayed_payment_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a payment key to channel acceptor for transactions broadcast by channel - * acceptor - */ - public void set_delayed_payment_basepoint(byte[] val) { - bindings.AcceptChannelV2_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty - */ - public byte[] get_htlc_basepoint() { - long ret = bindings.AcceptChannelV2_get_htlc_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty - */ - public void set_htlc_basepoint(byte[] val) { - bindings.AcceptChannelV2_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point - */ - public byte[] get_first_per_commitment_point() { - long ret = bindings.AcceptChannelV2_get_first_per_commitment_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point - */ - public void set_first_per_commitment_point(byte[] val) { - bindings.AcceptChannelV2_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * The second to-be-broadcast-by-channel-acceptor transaction's per commitment point */ @@ -309,64 +77,6 @@ public class AcceptChannelV2 : CommonBase { GC.KeepAlive(val); } - /** - * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we - * collaboratively close - */ - public Option_CVec_u8ZZ get_shutdown_scriptpubkey() { - long ret = bindings.AcceptChannelV2_get_shutdown_scriptpubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we - * collaboratively close - */ - public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) { - bindings.AcceptChannelV2_set_shutdown_scriptpubkey(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. - * - * This is required to match the equivalent field in [`OpenChannelV2::channel_type`]. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public ChannelTypeFeatures get_channel_type() { - long ret = bindings.AcceptChannelV2_get_channel_type(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. - * - * This is required to match the equivalent field in [`OpenChannelV2::channel_type`]. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { - bindings.AcceptChannelV2_set_channel_type(this.ptr, val == null ? 0 : val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - /** * Optionally, a requirement that only confirmed inputs can be added */ @@ -387,34 +97,17 @@ public class AcceptChannelV2 : CommonBase { /** * Constructs a new AcceptChannelV2 given each field - * - * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static AcceptChannelV2 of(byte[] temporary_channel_id_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, int minimum_depth_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg) { - long ret = bindings.AcceptChannelV2_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id_arg, 32)), 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, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(second_per_commitment_point_arg, 33)), shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, require_confirmed_inputs_arg); - GC.KeepAlive(temporary_channel_id_arg); + public static AcceptChannelV2 of(org.ldk.structs.CommonAcceptChannelFields common_fields_arg, long funding_satoshis_arg, byte[] second_per_commitment_point_arg, COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.AcceptChannelV2_new(common_fields_arg.ptr, funding_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(second_per_commitment_point_arg, 33)), require_confirmed_inputs_arg); + GC.KeepAlive(common_fields_arg); GC.KeepAlive(funding_satoshis_arg); - GC.KeepAlive(dust_limit_satoshis_arg); - GC.KeepAlive(max_htlc_value_in_flight_msat_arg); - GC.KeepAlive(htlc_minimum_msat_arg); - GC.KeepAlive(minimum_depth_arg); - GC.KeepAlive(to_self_delay_arg); - GC.KeepAlive(max_accepted_htlcs_arg); - GC.KeepAlive(funding_pubkey_arg); - GC.KeepAlive(revocation_basepoint_arg); - GC.KeepAlive(payment_basepoint_arg); - GC.KeepAlive(delayed_payment_basepoint_arg); - GC.KeepAlive(htlc_basepoint_arg); - GC.KeepAlive(first_per_commitment_point_arg); GC.KeepAlive(second_per_commitment_point_arg); - GC.KeepAlive(shutdown_scriptpubkey_arg); - GC.KeepAlive(channel_type_arg); GC.KeepAlive(require_confirmed_inputs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AcceptChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AcceptChannelV2(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(common_fields_arg); }; return ret_hu_conv; } @@ -454,7 +147,7 @@ public class AcceptChannelV2 : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.AcceptChannelV2 b) { - bool ret = bindings.AcceptChannelV2_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.AcceptChannelV2_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Amount.cs b/c_sharp/src/org/ldk/structs/Amount.cs index 3450ea90..49ffeef5 100644 --- a/c_sharp/src/org/ldk/structs/Amount.cs +++ b/c_sharp/src/org/ldk/structs/Amount.cs @@ -5,17 +5,53 @@ using System; namespace org { namespace ldk { namespace structs { - /** * The minimum amount required for an item in an [`Offer`], denominated in either bitcoin or * another currency. */ public class Amount : CommonBase { - internal Amount(object _dummy, long ptr) : base(ptr) { } + protected Amount(object _dummy, long ptr) : base(ptr) { } ~Amount() { if (ptr != 0) { bindings.Amount_free(ptr); } } + internal static Amount constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKAmount_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Amount_Bitcoin(ptr); + case 1: return new Amount_Currency(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Amount of type Bitcoin */ + public class Amount_Bitcoin : Amount { + /** + * The amount in millisatoshi. + */ + public long amount_msats; + internal Amount_Bitcoin(long ptr) : base(null, ptr) { + this.amount_msats = bindings.LDKAmount_Bitcoin_get_amount_msats(ptr); + } + } + /** A Amount of type Currency */ + public class Amount_Currency : Amount { + /** + * The currency that the amount is denominated in. + */ + public byte[] iso4217_code; + /** + * The amount in the currency unit adjusted by the ISO 4712 exponent (e.g., USD cents). + */ + public long amount; + internal Amount_Currency(long ptr) : base(null, ptr) { + long iso4217_code = bindings.LDKAmount_Currency_get_iso4217_code(ptr); + byte[] iso4217_code_conv = InternalUtils.decodeUint8Array(iso4217_code); + this.iso4217_code = iso4217_code_conv; + this.amount = bindings.LDKAmount_Currency_get_amount(ptr); + } + } internal long clone_ptr() { long ret = bindings.Amount_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -29,10 +65,35 @@ public class Amount : CommonBase { long ret = bindings.Amount_clone(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Amount ret_hu_conv = org.ldk.structs.Amount.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } + /** + * Utility method to constructs a new Bitcoin-variant Amount + */ + public static Amount bitcoin(long amount_msats) { + long ret = bindings.Amount_bitcoin(amount_msats); + GC.KeepAlive(amount_msats); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Amount ret_hu_conv = org.ldk.structs.Amount.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Currency-variant Amount + */ + public static Amount currency(byte[] iso4217_code, long amount) { + long ret = bindings.Amount_currency(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(iso4217_code, 3)), amount); + GC.KeepAlive(iso4217_code); + GC.KeepAlive(amount); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Amount ret_hu_conv = org.ldk.structs.Amount.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs b/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs index 0fd35131..b452326b 100644 --- a/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/AnchorDescriptor.cs @@ -31,7 +31,7 @@ public class AnchorDescriptor : CommonBase { * The parameters required to derive the signer for the anchor input. */ public void set_channel_derivation_parameters(org.ldk.structs.ChannelDerivationParameters val) { - bindings.AnchorDescriptor_set_channel_derivation_parameters(this.ptr, val == null ? 0 : val.ptr); + bindings.AnchorDescriptor_set_channel_derivation_parameters(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -55,7 +55,7 @@ public class AnchorDescriptor : CommonBase { * output. */ public void set_outpoint(org.ldk.structs.OutPoint val) { - bindings.AnchorDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + bindings.AnchorDescriptor_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -65,7 +65,7 @@ public class AnchorDescriptor : CommonBase { * Constructs a new AnchorDescriptor given each field */ public static AnchorDescriptor of(org.ldk.structs.ChannelDerivationParameters channel_derivation_parameters_arg, org.ldk.structs.OutPoint outpoint_arg) { - long ret = bindings.AnchorDescriptor_new(channel_derivation_parameters_arg == null ? 0 : channel_derivation_parameters_arg.ptr, outpoint_arg == null ? 0 : outpoint_arg.ptr); + long ret = bindings.AnchorDescriptor_new(channel_derivation_parameters_arg.ptr, outpoint_arg.ptr); GC.KeepAlive(channel_derivation_parameters_arg); GC.KeepAlive(outpoint_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -100,7 +100,7 @@ public class AnchorDescriptor : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.AnchorDescriptor b) { - bool ret = bindings.AnchorDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.AnchorDescriptor_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs b/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs index cebd823c..064273e4 100644 --- a/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs +++ b/c_sharp/src/org/ldk/structs/AnnouncementSignatures.cs @@ -20,21 +20,23 @@ public class AnnouncementSignatures : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.AnnouncementSignatures_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.AnnouncementSignatures_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.AnnouncementSignatures_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -98,8 +100,8 @@ public class AnnouncementSignatures : CommonBase { /** * Constructs a new AnnouncementSignatures given each field */ - public static AnnouncementSignatures of(byte[] channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) { - long ret = bindings.AnnouncementSignatures_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), short_channel_id_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_signature_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(bitcoin_signature_arg, 64))); + public static AnnouncementSignatures of(org.ldk.structs.ChannelId channel_id_arg, long short_channel_id_arg, byte[] node_signature_arg, byte[] bitcoin_signature_arg) { + long ret = bindings.AnnouncementSignatures_new(channel_id_arg.ptr, short_channel_id_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_signature_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(bitcoin_signature_arg, 64))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(short_channel_id_arg); GC.KeepAlive(node_signature_arg); @@ -107,6 +109,7 @@ public class AnnouncementSignatures : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.AnnouncementSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.AnnouncementSignatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -146,7 +149,7 @@ public class AnnouncementSignatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.AnnouncementSignatures b) { - bool ret = bindings.AnnouncementSignatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.AnnouncementSignatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs b/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs index 188408db..24843df0 100644 --- a/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs +++ b/c_sharp/src/org/ldk/structs/BackgroundProcessor.cs @@ -29,6 +29,8 @@ namespace org { namespace ldk { namespace structs { * However, as long as [`ChannelMonitor`] backups are sound, no funds besides those used for * unilateral chain closure fees are at risk. * + * [`ChannelManager`]: lightning::ln::channelmanager::ChannelManager + * [`ChannelManager::timer_tick_occurred`]: lightning::ln::channelmanager::ChannelManager::timer_tick_occurred * [`ChannelMonitor`]: lightning::chain::channelmonitor::ChannelMonitor * [`Event`]: lightning::events::Event * [`PeerManager::timer_tick_occurred`]: lightning::ln::peer_handler::PeerManager::timer_tick_occurred @@ -88,7 +90,7 @@ public class BackgroundProcessor : CommonBase { * [`NetworkGraph::write`]: lightning::routing::gossip::NetworkGraph#impl-Writeable */ public static BackgroundProcessor start(org.ldk.structs.Persister persister, org.ldk.structs.EventHandler event_handler, org.ldk.structs.ChainMonitor chain_monitor, org.ldk.structs.ChannelManager channel_manager, org.ldk.structs.GossipSync gossip_sync, org.ldk.structs.PeerManager peer_manager, org.ldk.structs.Logger logger, org.ldk.structs.Option_WriteableScoreZ scorer) { - long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor == null ? 0 : chain_monitor.ptr, channel_manager == null ? 0 : channel_manager.ptr, gossip_sync.ptr, peer_manager == null ? 0 : peer_manager.ptr, logger.ptr, scorer.ptr); + long ret = bindings.BackgroundProcessor_start(persister.ptr, event_handler.ptr, chain_monitor.ptr, channel_manager.ptr, gossip_sync.ptr, peer_manager.ptr, logger.ptr, scorer.ptr); GC.KeepAlive(persister); GC.KeepAlive(event_handler); GC.KeepAlive(chain_monitor); diff --git a/c_sharp/src/org/ldk/structs/Balance.cs b/c_sharp/src/org/ldk/structs/Balance.cs index 74d10f64..18313917 100644 --- a/c_sharp/src/org/ldk/structs/Balance.cs +++ b/c_sharp/src/org/ldk/structs/Balance.cs @@ -254,7 +254,7 @@ public class Balance : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.Balance b) { - bool ret = bindings.Balance_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Balance_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/BestBlock.cs b/c_sharp/src/org/ldk/structs/BestBlock.cs index 3d46e2b0..b8b816ee 100644 --- a/c_sharp/src/org/ldk/structs/BestBlock.cs +++ b/c_sharp/src/org/ldk/structs/BestBlock.cs @@ -15,6 +15,57 @@ public class BestBlock : CommonBase { if (ptr != 0) { bindings.BestBlock_free(ptr); } } + /** + * The block's hash + */ + public byte[] get_block_hash() { + long ret = bindings.BestBlock_get_block_hash(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The block's hash + */ + public void set_block_hash(byte[] val) { + bindings.BestBlock_set_block_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The height at which the block was confirmed. + */ + public int get_height() { + int ret = bindings.BestBlock_get_height(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The height at which the block was confirmed. + */ + public void set_height(int val) { + bindings.BestBlock_set_height(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new BestBlock given each field + */ + public static BestBlock of(byte[] block_hash_arg, int height_arg) { + long ret = bindings.BestBlock_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(block_hash_arg, 32)), height_arg); + GC.KeepAlive(block_hash_arg); + GC.KeepAlive(height_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + internal long clone_ptr() { long ret = bindings.BestBlock_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -33,13 +84,25 @@ public class BestBlock : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the BestBlock. + */ + public long hash() { + long ret = bindings.BestBlock_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Checks if two BestBlocks contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BestBlock b) { - bool ret = bindings.BestBlock_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BestBlock_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -64,23 +127,10 @@ public class BestBlock : CommonBase { } /** - * Returns a `BestBlock` as identified by the given block hash and height. + * Serialize the BestBlock object into a byte array which can be read by BestBlock_read */ - public static BestBlock of(byte[] block_hash, int height) { - long ret = bindings.BestBlock_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(block_hash, 32)), height); - GC.KeepAlive(block_hash); - GC.KeepAlive(height); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - - /** - * Returns the best block hash. - */ - public byte[] block_hash() { - long ret = bindings.BestBlock_block_hash(this.ptr); + public byte[] write() { + long ret = bindings.BestBlock_write(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } byte[] ret_conv = InternalUtils.decodeUint8Array(ret); @@ -88,12 +138,14 @@ public class BestBlock : CommonBase { } /** - * Returns the best block height. + * Read a BestBlock from a byte array, created by BestBlock_write */ - public int height() { - int ret = bindings.BestBlock_height(this.ptr); - GC.KeepAlive(this); - return ret; + public static Result_BestBlockDecodeErrorZ read(byte[] ser) { + long ret = bindings.BestBlock_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BestBlockDecodeErrorZ ret_hu_conv = Result_BestBlockDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; } } diff --git a/c_sharp/src/org/ldk/structs/BigSize.cs b/c_sharp/src/org/ldk/structs/BigSize.cs index 2a0b0a4e..d1ec9561 100644 --- a/c_sharp/src/org/ldk/structs/BigSize.cs +++ b/c_sharp/src/org/ldk/structs/BigSize.cs @@ -81,7 +81,7 @@ public class BigSize : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BigSize b) { - bool ret = bindings.BigSize_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BigSize_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/BlindedForward.cs b/c_sharp/src/org/ldk/structs/BlindedForward.cs index 12a542dd..da99ae4d 100644 --- a/c_sharp/src/org/ldk/structs/BlindedForward.cs +++ b/c_sharp/src/org/ldk/structs/BlindedForward.cs @@ -108,7 +108,7 @@ public class BlindedForward : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BlindedForward b) { - bool ret = bindings.BlindedForward_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BlindedForward_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/BlindedHop.cs b/c_sharp/src/org/ldk/structs/BlindedHop.cs index 95bbe09e..5829ee0f 100644 --- a/c_sharp/src/org/ldk/structs/BlindedHop.cs +++ b/c_sharp/src/org/ldk/structs/BlindedHop.cs @@ -108,7 +108,7 @@ public class BlindedHop : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BlindedHop b) { - bool ret = bindings.BlindedHop_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BlindedHop_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs b/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs index d6de7e38..c1cf013f 100644 --- a/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs +++ b/c_sharp/src/org/ldk/structs/BlindedHopFeatures.cs @@ -21,7 +21,7 @@ public class BlindedHopFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BlindedHopFeatures b) { - bool ret = bindings.BlindedHopFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BlindedHopFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class BlindedHopFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.BlindedHopFeatures other) { - bool ret = bindings.BlindedHopFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.BlindedHopFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; diff --git a/c_sharp/src/org/ldk/structs/BlindedPath.cs b/c_sharp/src/org/ldk/structs/BlindedPath.cs index 4a24c4f3..ee027ffb 100644 --- a/c_sharp/src/org/ldk/structs/BlindedPath.cs +++ b/c_sharp/src/org/ldk/structs/BlindedPath.cs @@ -18,30 +18,32 @@ public class BlindedPath : CommonBase { /** * To send to a blinded path, the sender first finds a route to the unblinded - * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion + * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion * message or payment's next hop and forward it along. * * [`encrypted_payload`]: BlindedHop::encrypted_payload */ - public byte[] get_introduction_node_id() { - long ret = bindings.BlindedPath_get_introduction_node_id(this.ptr); + public IntroductionNode get_introduction_node() { + long ret = bindings.BlindedPath_get_introduction_node(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * To send to a blinded path, the sender first finds a route to the unblinded - * `introduction_node_id`, which can unblind its [`encrypted_payload`] to find out the onion + * `introduction_node`, which can unblind its [`encrypted_payload`] to find out the onion * message or payment's next hop and forward it along. * * [`encrypted_payload`]: BlindedHop::encrypted_payload */ - public void set_introduction_node_id(byte[] val) { - bindings.BlindedPath_set_introduction_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + public void set_introduction_node(org.ldk.structs.IntroductionNode val) { + bindings.BlindedPath_set_introduction_node(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -93,7 +95,7 @@ public class BlindedPath : CommonBase { * The hops composing the blinded path. */ public void set_blinded_hops(BlindedHop[] val) { - bindings.BlindedPath_set_blinded_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_12 => val_conv_12 == null ? 0 : val_conv_12.ptr))); + bindings.BlindedPath_set_blinded_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_12 => val_conv_12.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (BlindedHop val_conv_12 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_12); }; }; @@ -102,14 +104,15 @@ public class BlindedPath : CommonBase { /** * Constructs a new BlindedPath given each field */ - public static BlindedPath of(byte[] introduction_node_id_arg, byte[] blinding_point_arg, BlindedHop[] blinded_hops_arg) { - long ret = bindings.BlindedPath_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(introduction_node_id_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_hops_arg, blinded_hops_arg_conv_12 => blinded_hops_arg_conv_12 == null ? 0 : blinded_hops_arg_conv_12.ptr))); - GC.KeepAlive(introduction_node_id_arg); + public static BlindedPath of(org.ldk.structs.IntroductionNode introduction_node_arg, byte[] blinding_point_arg, BlindedHop[] blinded_hops_arg) { + long ret = bindings.BlindedPath_new(introduction_node_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_hops_arg, blinded_hops_arg_conv_12 => blinded_hops_arg_conv_12.ptr))); + GC.KeepAlive(introduction_node_arg); GC.KeepAlive(blinding_point_arg); GC.KeepAlive(blinded_hops_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BlindedPath ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BlindedPath(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(introduction_node_arg); }; foreach (BlindedHop blinded_hops_arg_conv_12 in blinded_hops_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(blinded_hops_arg_conv_12); }; }; return ret_hu_conv; } @@ -150,7 +153,7 @@ public class BlindedPath : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BlindedPath b) { - bool ret = bindings.BlindedPath_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BlindedPath_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -190,6 +193,23 @@ public class BlindedPath : CommonBase { return ret_hu_conv; } + /** + * Returns the introduction [`NodeId`] of the blinded path, if it is publicly reachable (i.e., + * it is found in the network graph). + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public NodeId public_introduction_node_id(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { + long ret = bindings.BlindedPath_public_introduction_node_id(this.ptr, network_graph.ptr); + GC.KeepAlive(this); + GC.KeepAlive(network_graph); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + if (this != null) { this.ptrs_to.AddLast(network_graph); }; + return ret_hu_conv; + } + /** * Serialize the BlindedPath object into a byte array which can be read by BlindedPath_read */ diff --git a/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs b/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs index e788659b..c68aaa7a 100644 --- a/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs +++ b/c_sharp/src/org/ldk/structs/BlindedPayInfo.cs @@ -135,7 +135,7 @@ public class BlindedPayInfo : CommonBase { * onion payload. */ public void set_features(org.ldk.structs.BlindedHopFeatures val) { - bindings.BlindedPayInfo_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.BlindedPayInfo_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -145,7 +145,7 @@ public class BlindedPayInfo : CommonBase { * Constructs a new BlindedPayInfo given each field */ public static BlindedPayInfo of(int fee_base_msat_arg, int fee_proportional_millionths_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.BlindedHopFeatures features_arg) { - long ret = bindings.BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg == null ? 0 : features_arg.ptr); + long ret = bindings.BlindedPayInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, features_arg.ptr); GC.KeepAlive(fee_base_msat_arg); GC.KeepAlive(fee_proportional_millionths_arg); GC.KeepAlive(cltv_expiry_delta_arg); @@ -195,7 +195,7 @@ public class BlindedPayInfo : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BlindedPayInfo b) { - bool ret = bindings.BlindedPayInfo_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BlindedPayInfo_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/BlindedTail.cs b/c_sharp/src/org/ldk/structs/BlindedTail.cs index a92b3ac7..b27ce406 100644 --- a/c_sharp/src/org/ldk/structs/BlindedTail.cs +++ b/c_sharp/src/org/ldk/structs/BlindedTail.cs @@ -45,7 +45,7 @@ public class BlindedTail : CommonBase { * [`BlindedPath`]: crate::blinded_path::BlindedPath */ public void set_hops(BlindedHop[] val) { - bindings.BlindedTail_set_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_12 => val_conv_12 == null ? 0 : val_conv_12.ptr))); + bindings.BlindedTail_set_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_12 => val_conv_12.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (BlindedHop val_conv_12 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_12); }; }; @@ -117,7 +117,7 @@ public class BlindedTail : CommonBase { * Constructs a new BlindedTail given each field */ public static BlindedTail of(BlindedHop[] hops_arg, byte[] blinding_point_arg, int excess_final_cltv_expiry_delta_arg, long final_value_msat_arg) { - long ret = bindings.BlindedTail_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(hops_arg, hops_arg_conv_12 => hops_arg_conv_12 == null ? 0 : hops_arg_conv_12.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), excess_final_cltv_expiry_delta_arg, final_value_msat_arg); + long ret = bindings.BlindedTail_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(hops_arg, hops_arg_conv_12 => hops_arg_conv_12.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), excess_final_cltv_expiry_delta_arg, final_value_msat_arg); GC.KeepAlive(hops_arg); GC.KeepAlive(blinding_point_arg); GC.KeepAlive(excess_final_cltv_expiry_delta_arg); @@ -165,7 +165,7 @@ public class BlindedTail : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.BlindedTail b) { - bool ret = bindings.BlindedTail_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BlindedTail_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs index 753798b9..a44f6c86 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11Invoice.cs @@ -28,7 +28,7 @@ public class Bolt11Invoice : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Bolt11Invoice b) { - bool ret = bindings.Bolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Bolt11Invoice_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -127,7 +127,7 @@ public class Bolt11Invoice : CommonBase { * ``` */ public static Result_Bolt11InvoiceBolt11SemanticErrorZ from_signed(org.ldk.structs.SignedRawBolt11Invoice signed_invoice) { - long ret = bindings.Bolt11Invoice_from_signed(signed_invoice == null ? 0 : signed_invoice.ptr); + long ret = bindings.Bolt11Invoice_from_signed(signed_invoice.ptr); GC.KeepAlive(signed_invoice); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); @@ -225,6 +225,18 @@ public class Bolt11Invoice : CommonBase { return ret_conv; } + /** + * Recover the payee's public key if one was included in the invoice, otherwise return the + * recovered public key from the signature + */ + public byte[] get_payee_pub_key() { + long ret = bindings.Bolt11Invoice_get_payee_pub_key(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Returns the Duration since the Unix epoch at which the invoice expires. * Returning None if overflow occurred. diff --git a/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs index 7b649b24..317cc0da 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11InvoiceFeatures.cs @@ -21,7 +21,7 @@ public class Bolt11InvoiceFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Bolt11InvoiceFeatures b) { - bool ret = bindings.Bolt11InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Bolt11InvoiceFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class Bolt11InvoiceFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.Bolt11InvoiceFeatures other) { - bool ret = bindings.Bolt11InvoiceFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.Bolt11InvoiceFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; @@ -324,5 +324,39 @@ public class Bolt11InvoiceFeatures : CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_trampoline_routing_optional() { + bindings.Bolt11InvoiceFeatures_set_trampoline_routing_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_trampoline_routing_required() { + bindings.Bolt11InvoiceFeatures_set_trampoline_routing_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_trampoline_routing() { + bool ret = bindings.Bolt11InvoiceFeatures_supports_trampoline_routing(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_trampoline_routing() { + bool ret = bindings.Bolt11InvoiceFeatures_requires_trampoline_routing(this.ptr); + GC.KeepAlive(this); + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs b/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs index aed040ab..e6c65abc 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11InvoiceSignature.cs @@ -51,7 +51,7 @@ public class Bolt11InvoiceSignature : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Bolt11InvoiceSignature b) { - bool ret = bindings.Bolt11InvoiceSignature_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Bolt11InvoiceSignature_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs b/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs index abf9712f..27cdaea3 100644 --- a/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs +++ b/c_sharp/src/org/ldk/structs/Bolt11ParseError.cs @@ -377,7 +377,7 @@ public class Bolt11ParseError : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.Bolt11ParseError b) { - bool ret = bindings.Bolt11ParseError_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Bolt11ParseError_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs b/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs index 35f4e651..e498a962 100644 --- a/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs +++ b/c_sharp/src/org/ldk/structs/Bolt12Invoice.cs @@ -99,14 +99,12 @@ public class Bolt12Invoice : CommonBase { * * [`Offer`]: crate::offers::offer::Offer * [`Offer::amount`]: crate::offers::offer::Offer::amount - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Amount amount() { + public Option_AmountZ amount() { long ret = bindings.Bolt12Invoice_amount(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -137,6 +135,8 @@ public class Bolt12Invoice : CommonBase { * From [`Offer::description`] or [`Refund::description`]. * * [`Offer::description`]: crate::offers::offer::Offer::description + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public PrintableString description() { long ret = bindings.Bolt12Invoice_description(this.ptr); @@ -211,14 +211,12 @@ public class Bolt12Invoice : CommonBase { * [`Refund`]. * * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Quantity supported_quantity() { + public Option_QuantityZ supported_quantity() { long ret = bindings.Bolt12Invoice_supported_quantity(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Option_QuantityZ ret_hu_conv = org.ldk.structs.Option_QuantityZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -392,7 +390,7 @@ public class Bolt12Invoice : CommonBase { * the associated [`PaymentId`] to use when sending the payment. */ public Result_ThirtyTwoBytesNoneZ verify(org.ldk.structs.ExpandedKey key) { - long ret = bindings.Bolt12Invoice_verify(this.ptr, key == null ? 0 : key.ptr); + long ret = bindings.Bolt12Invoice_verify(this.ptr, key.ptr); GC.KeepAlive(this); GC.KeepAlive(key); if (ret >= 0 && ret <= 4096) { return null; } @@ -401,6 +399,18 @@ public class Bolt12Invoice : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the Bolt12Invoice. + */ + public long hash() { + long ret = bindings.Bolt12Invoice_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Serialize the Bolt12Invoice object into a byte array which can be read by Bolt12Invoice_read */ diff --git a/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs b/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs index 98b72e12..ac0f264b 100644 --- a/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs +++ b/c_sharp/src/org/ldk/structs/Bolt12InvoiceFeatures.cs @@ -21,7 +21,7 @@ public class Bolt12InvoiceFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Bolt12InvoiceFeatures b) { - bool ret = bindings.Bolt12InvoiceFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Bolt12InvoiceFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class Bolt12InvoiceFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.Bolt12InvoiceFeatures other) { - bool ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.Bolt12InvoiceFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; diff --git a/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs b/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs new file mode 100644 index 00000000..c75a4349 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt12OfferContext.cs @@ -0,0 +1,147 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The context of a payment made for an invoice requested from a BOLT 12 [`Offer`]. + * + * [`Offer`]: crate::offers::offer::Offer + */ +public class Bolt12OfferContext : CommonBase { + internal Bolt12OfferContext(object _dummy, long ptr) : base(ptr) { } + ~Bolt12OfferContext() { + if (ptr != 0) { bindings.Bolt12OfferContext_free(ptr); } + } + + /** + * The identifier of the [`Offer`]. + * + * [`Offer`]: crate::offers::offer::Offer + */ + public OfferId get_offer_id() { + long ret = bindings.Bolt12OfferContext_get_offer_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The identifier of the [`Offer`]. + * + * [`Offer`]: crate::offers::offer::Offer + */ + public void set_offer_id(org.ldk.structs.OfferId val) { + bindings.Bolt12OfferContext_set_offer_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public InvoiceRequestFields get_invoice_request() { + long ret = bindings.Bolt12OfferContext_get_invoice_request(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Fields from an [`InvoiceRequest`] sent for a [`Bolt12Invoice`]. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public void set_invoice_request(org.ldk.structs.InvoiceRequestFields val) { + bindings.Bolt12OfferContext_set_invoice_request(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new Bolt12OfferContext given each field + */ + public static Bolt12OfferContext of(org.ldk.structs.OfferId offer_id_arg, org.ldk.structs.InvoiceRequestFields invoice_request_arg) { + long ret = bindings.Bolt12OfferContext_new(offer_id_arg.ptr, invoice_request_arg.ptr); + GC.KeepAlive(offer_id_arg); + GC.KeepAlive(invoice_request_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12OfferContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(offer_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(invoice_request_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.Bolt12OfferContext_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt12OfferContext + */ + public Bolt12OfferContext clone() { + long ret = bindings.Bolt12OfferContext_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12OfferContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two Bolt12OfferContexts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Bolt12OfferContext b) { + bool ret = bindings.Bolt12OfferContext_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt12OfferContext)) return false; + return this.eq((Bolt12OfferContext)o); + } + /** + * Serialize the Bolt12OfferContext object into a byte array which can be read by Bolt12OfferContext_read + */ + public byte[] write() { + long ret = bindings.Bolt12OfferContext_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a Bolt12OfferContext from a byte array, created by Bolt12OfferContext_write + */ + public static Result_Bolt12OfferContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12OfferContext_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12OfferContextDecodeErrorZ ret_hu_conv = Result_Bolt12OfferContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Bolt12RefundContext.cs b/c_sharp/src/org/ldk/structs/Bolt12RefundContext.cs new file mode 100644 index 00000000..f5833378 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Bolt12RefundContext.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The context of a payment made for an invoice sent for a BOLT 12 [`Refund`]. + * + * [`Refund`]: crate::offers::refund::Refund + */ +public class Bolt12RefundContext : CommonBase { + internal Bolt12RefundContext(object _dummy, long ptr) : base(ptr) { } + ~Bolt12RefundContext() { + if (ptr != 0) { bindings.Bolt12RefundContext_free(ptr); } + } + + /** + * Constructs a new Bolt12RefundContext given each field + */ + public static Bolt12RefundContext of() { + long ret = bindings.Bolt12RefundContext_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12RefundContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12RefundContext(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.Bolt12RefundContext_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the Bolt12RefundContext + */ + public Bolt12RefundContext clone() { + long ret = bindings.Bolt12RefundContext_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Bolt12RefundContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Bolt12RefundContext(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two Bolt12RefundContexts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.Bolt12RefundContext b) { + bool ret = bindings.Bolt12RefundContext_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is Bolt12RefundContext)) return false; + return this.eq((Bolt12RefundContext)o); + } + /** + * Serialize the Bolt12RefundContext object into a byte array which can be read by Bolt12RefundContext_read + */ + public byte[] write() { + long ret = bindings.Bolt12RefundContext_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a Bolt12RefundContext from a byte array, created by Bolt12RefundContext_write + */ + public static Result_Bolt12RefundContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.Bolt12RefundContext_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12RefundContextDecodeErrorZ ret_hu_conv = Result_Bolt12RefundContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs b/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs index 95b58176..e5d55621 100644 --- a/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs +++ b/c_sharp/src/org/ldk/structs/BumpTransactionEvent.cs @@ -26,6 +26,14 @@ public class BumpTransactionEvent : CommonBase { /** A BumpTransactionEvent of type ChannelClose */ public class BumpTransactionEvent_ChannelClose : BumpTransactionEvent { + /** + * The `channel_id` of the channel which has been closed. + */ + public ChannelId channel_id; + /** + * Counterparty in the closed channel. + */ + public byte[] counterparty_node_id; /** * The unique identifier for the claim of the anchor output in the commitment transaction. * @@ -61,6 +69,13 @@ public class BumpTransactionEvent : CommonBase { */ public HTLCOutputInCommitment[] pending_htlcs; internal BumpTransactionEvent_ChannelClose(long ptr) : base(null, ptr) { + long channel_id = bindings.LDKBumpTransactionEvent_ChannelClose_get_channel_id(ptr); + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; + long counterparty_node_id = bindings.LDKBumpTransactionEvent_ChannelClose_get_counterparty_node_id(ptr); + byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id); + this.counterparty_node_id = counterparty_node_id_conv; long claim_id = bindings.LDKBumpTransactionEvent_ChannelClose_get_claim_id(ptr); byte[] claim_id_conv = InternalUtils.decodeUint8Array(claim_id); this.claim_id = claim_id_conv; @@ -88,6 +103,14 @@ public class BumpTransactionEvent : CommonBase { } /** A BumpTransactionEvent of type HTLCResolution */ public class BumpTransactionEvent_HTLCResolution : BumpTransactionEvent { + /** + * The `channel_id` of the channel which has been closed. + */ + public ChannelId channel_id; + /** + * Counterparty in the closed channel. + */ + public byte[] counterparty_node_id; /** * The unique identifier for the claim of the HTLCs in the confirmed commitment * transaction. @@ -111,6 +134,13 @@ public class BumpTransactionEvent : CommonBase { */ public int tx_lock_time; internal BumpTransactionEvent_HTLCResolution(long ptr) : base(null, ptr) { + long channel_id = bindings.LDKBumpTransactionEvent_HTLCResolution_get_channel_id(ptr); + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; + long counterparty_node_id = bindings.LDKBumpTransactionEvent_HTLCResolution_get_counterparty_node_id(ptr); + byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id); + this.counterparty_node_id = counterparty_node_id_conv; long claim_id = bindings.LDKBumpTransactionEvent_HTLCResolution_get_claim_id(ptr); byte[] claim_id_conv = InternalUtils.decodeUint8Array(claim_id); this.claim_id = claim_id_conv; @@ -150,8 +180,10 @@ public class BumpTransactionEvent : CommonBase { /** * Utility method to constructs a new ChannelClose-variant BumpTransactionEvent */ - public static BumpTransactionEvent channel_close(byte[] claim_id, int package_target_feerate_sat_per_1000_weight, byte[] commitment_tx, long commitment_tx_fee_satoshis, org.ldk.structs.AnchorDescriptor anchor_descriptor, HTLCOutputInCommitment[] pending_htlcs) { - long ret = bindings.BumpTransactionEvent_channel_close(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(claim_id, 32)), package_target_feerate_sat_per_1000_weight, InternalUtils.encodeUint8Array(commitment_tx), commitment_tx_fee_satoshis, anchor_descriptor == null ? 0 : anchor_descriptor.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_htlcs, pending_htlcs_conv_24 => pending_htlcs_conv_24 == null ? 0 : pending_htlcs_conv_24.ptr))); + public static BumpTransactionEvent channel_close(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, byte[] claim_id, int package_target_feerate_sat_per_1000_weight, byte[] commitment_tx, long commitment_tx_fee_satoshis, org.ldk.structs.AnchorDescriptor anchor_descriptor, HTLCOutputInCommitment[] pending_htlcs) { + long ret = bindings.BumpTransactionEvent_channel_close(channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(claim_id, 32)), package_target_feerate_sat_per_1000_weight, InternalUtils.encodeUint8Array(commitment_tx), commitment_tx_fee_satoshis, anchor_descriptor.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(pending_htlcs, pending_htlcs_conv_24 => pending_htlcs_conv_24.ptr))); + GC.KeepAlive(channel_id); + GC.KeepAlive(counterparty_node_id); GC.KeepAlive(claim_id); GC.KeepAlive(package_target_feerate_sat_per_1000_weight); GC.KeepAlive(commitment_tx); @@ -161,6 +193,7 @@ public class BumpTransactionEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(anchor_descriptor); }; foreach (HTLCOutputInCommitment pending_htlcs_conv_24 in pending_htlcs) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(pending_htlcs_conv_24); }; }; return ret_hu_conv; @@ -169,8 +202,10 @@ public class BumpTransactionEvent : CommonBase { /** * Utility method to constructs a new HTLCResolution-variant BumpTransactionEvent */ - public static BumpTransactionEvent htlcresolution(byte[] claim_id, int target_feerate_sat_per_1000_weight, HTLCDescriptor[] htlc_descriptors, int tx_lock_time) { - long ret = bindings.BumpTransactionEvent_htlcresolution(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(claim_id, 32)), target_feerate_sat_per_1000_weight, InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlc_descriptors, htlc_descriptors_conv_16 => htlc_descriptors_conv_16 == null ? 0 : htlc_descriptors_conv_16.ptr)), tx_lock_time); + public static BumpTransactionEvent htlcresolution(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, byte[] claim_id, int target_feerate_sat_per_1000_weight, HTLCDescriptor[] htlc_descriptors, int tx_lock_time) { + long ret = bindings.BumpTransactionEvent_htlcresolution(channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(claim_id, 32)), target_feerate_sat_per_1000_weight, InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlc_descriptors, htlc_descriptors_conv_16 => htlc_descriptors_conv_16.ptr)), tx_lock_time); + GC.KeepAlive(channel_id); + GC.KeepAlive(counterparty_node_id); GC.KeepAlive(claim_id); GC.KeepAlive(target_feerate_sat_per_1000_weight); GC.KeepAlive(htlc_descriptors); @@ -178,6 +213,7 @@ public class BumpTransactionEvent : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.BumpTransactionEvent ret_hu_conv = org.ldk.structs.BumpTransactionEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; foreach (HTLCDescriptor htlc_descriptors_conv_16 in htlc_descriptors) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_descriptors_conv_16); }; }; return ret_hu_conv; } @@ -187,7 +223,7 @@ public class BumpTransactionEvent : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.BumpTransactionEvent b) { - bool ret = bindings.BumpTransactionEvent_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.BumpTransactionEvent_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs b/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs index 08202f7b..9fbf9ee7 100644 --- a/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs +++ b/c_sharp/src/org/ldk/structs/BumpTransactionEventHandler.cs @@ -44,7 +44,7 @@ public class BumpTransactionEventHandler : CommonBase { * Handles all variants of [`BumpTransactionEvent`]. */ public void handle_event(org.ldk.structs.BumpTransactionEvent _event) { - bindings.BumpTransactionEventHandler_handle_event(this.ptr, _event == null ? 0 : _event.ptr); + bindings.BumpTransactionEventHandler_handle_event(this.ptr, _event.ptr); GC.KeepAlive(this); GC.KeepAlive(_event); } diff --git a/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs b/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs index 39a5020a..766d93b4 100644 --- a/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs +++ b/c_sharp/src/org/ldk/structs/CandidateRouteHop.cs @@ -102,7 +102,7 @@ public class CandidateRouteHop : CommonBase { * Utility method to constructs a new FirstHop-variant CandidateRouteHop */ public static CandidateRouteHop first_hop(org.ldk.structs.FirstHopCandidate a) { - long ret = bindings.CandidateRouteHop_first_hop(a == null ? 0 : a.ptr); + long ret = bindings.CandidateRouteHop_first_hop(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); @@ -115,7 +115,7 @@ public class CandidateRouteHop : CommonBase { * Utility method to constructs a new PublicHop-variant CandidateRouteHop */ public static CandidateRouteHop public_hop(org.ldk.structs.PublicHopCandidate a) { - long ret = bindings.CandidateRouteHop_public_hop(a == null ? 0 : a.ptr); + long ret = bindings.CandidateRouteHop_public_hop(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); @@ -128,7 +128,7 @@ public class CandidateRouteHop : CommonBase { * Utility method to constructs a new PrivateHop-variant CandidateRouteHop */ public static CandidateRouteHop private_hop(org.ldk.structs.PrivateHopCandidate a) { - long ret = bindings.CandidateRouteHop_private_hop(a == null ? 0 : a.ptr); + long ret = bindings.CandidateRouteHop_private_hop(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); @@ -141,7 +141,7 @@ public class CandidateRouteHop : CommonBase { * Utility method to constructs a new Blinded-variant CandidateRouteHop */ public static CandidateRouteHop blinded(org.ldk.structs.BlindedPathCandidate a) { - long ret = bindings.CandidateRouteHop_blinded(a == null ? 0 : a.ptr); + long ret = bindings.CandidateRouteHop_blinded(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); @@ -154,7 +154,7 @@ public class CandidateRouteHop : CommonBase { * Utility method to constructs a new OneHopBlinded-variant CandidateRouteHop */ public static CandidateRouteHop one_hop_blinded(org.ldk.structs.OneHopBlindedPathCandidate a) { - long ret = bindings.CandidateRouteHop_one_hop_blinded(a == null ? 0 : a.ptr); + long ret = bindings.CandidateRouteHop_one_hop_blinded(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CandidateRouteHop ret_hu_conv = org.ldk.structs.CandidateRouteHop.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/ChainMonitor.cs b/c_sharp/src/org/ldk/structs/ChainMonitor.cs index b3285516..f52ce0f3 100644 --- a/c_sharp/src/org/ldk/structs/ChainMonitor.cs +++ b/c_sharp/src/org/ldk/structs/ChainMonitor.cs @@ -69,7 +69,7 @@ public class ChainMonitor : CommonBase { * inclusion in the return value. */ public Balance[] get_claimable_balances(ChannelDetails[] ignored_channels) { - long ret = bindings.ChainMonitor_get_claimable_balances(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(ignored_channels, ignored_channels_conv_16 => ignored_channels_conv_16 == null ? 0 : ignored_channels_conv_16.ptr))); + long ret = bindings.ChainMonitor_get_claimable_balances(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(ignored_channels, ignored_channels_conv_16 => ignored_channels_conv_16.ptr))); GC.KeepAlive(this); GC.KeepAlive(ignored_channels); if (ret >= 0 && ret <= 4096) { return null; } @@ -94,7 +94,7 @@ public class ChainMonitor : CommonBase { * indefinitely. */ public Result_LockedChannelMonitorNoneZ get_monitor(org.ldk.structs.OutPoint funding_txo) { - long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo == null ? 0 : funding_txo.ptr); + long ret = bindings.ChainMonitor_get_monitor(this.ptr, funding_txo.ptr); GC.KeepAlive(this); GC.KeepAlive(funding_txo); if (ret >= 0 && ret <= 4096) { return null; } @@ -104,25 +104,25 @@ public class ChainMonitor : CommonBase { } /** - * Lists the funding outpoint of each [`ChannelMonitor`] being monitored. + * Lists the funding outpoint and channel ID of each [`ChannelMonitor`] being monitored. * * Note that [`ChannelMonitor`]s are not removed when a channel is closed as they are always * monitoring for on-chain state resolutions. */ - public OutPoint[] list_monitors() { + public TwoTuple_OutPointChannelIdZ[] list_monitors() { long ret = bindings.ChainMonitor_list_monitors(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_10_len = InternalUtils.getArrayLength(ret); - OutPoint[] ret_conv_10_arr = new OutPoint[ret_conv_10_len]; - for (int k = 0; k < ret_conv_10_len; k++) { - long ret_conv_10 = InternalUtils.getU64ArrayElem(ret, k); - org.ldk.structs.OutPoint ret_conv_10_hu_conv = null; if (ret_conv_10 < 0 || ret_conv_10 > 4096) { ret_conv_10_hu_conv = new org.ldk.structs.OutPoint(null, ret_conv_10); } - if (ret_conv_10_hu_conv != null) { ret_conv_10_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_10_arr[k] = ret_conv_10_hu_conv; + int ret_conv_29_len = InternalUtils.getArrayLength(ret); + TwoTuple_OutPointChannelIdZ[] ret_conv_29_arr = new TwoTuple_OutPointChannelIdZ[ret_conv_29_len]; + for (int d = 0; d < ret_conv_29_len; d++) { + long ret_conv_29 = InternalUtils.getU64ArrayElem(ret, d); + TwoTuple_OutPointChannelIdZ ret_conv_29_hu_conv = new TwoTuple_OutPointChannelIdZ(null, ret_conv_29); + if (ret_conv_29_hu_conv != null) { ret_conv_29_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_29_arr[d] = ret_conv_29_hu_conv; } bindings.free_buffer(ret); - return ret_conv_10_arr; + return ret_conv_29_arr; } /** @@ -160,7 +160,7 @@ public class ChainMonitor : CommonBase { * registered [`ChannelMonitor`]s. */ public Result_NoneAPIErrorZ channel_monitor_updated(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.MonitorUpdateId completed_update_id) { - long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, completed_update_id == null ? 0 : completed_update_id.ptr); + long ret = bindings.ChainMonitor_channel_monitor_updated(this.ptr, funding_txo.ptr, completed_update_id.ptr); GC.KeepAlive(this); GC.KeepAlive(funding_txo); GC.KeepAlive(completed_update_id); @@ -202,6 +202,37 @@ public class ChainMonitor : CommonBase { GC.KeepAlive(this); } + /** + * Triggers rebroadcasts of pending claims from force-closed channels after a transaction + * signature generation failure. + * + * `monitor_opt` can be used as a filter to only trigger them for a specific channel monitor. + * + * Note that monitor_opt (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void signer_unblocked(org.ldk.structs.OutPoint monitor_opt) { + bindings.ChainMonitor_signer_unblocked(this.ptr, monitor_opt == null ? 0 : monitor_opt.ptr); + GC.KeepAlive(this); + GC.KeepAlive(monitor_opt); + if (this != null) { this.ptrs_to.AddLast(monitor_opt); }; + } + + /** + * Archives fully resolved channel monitors by calling [`Persist::archive_persisted_channel`]. + * + * This is useful for pruning fully resolved monitors from the monitor set and primary + * storage so they are not kept in memory and reloaded on restart. + * + * Should be called occasionally (once every handful of blocks or on startup). + * + * Depending on the implementation of [`Persist::archive_persisted_channel`] the monitor + * data could be moved to an archive location or removed entirely. + */ + public void archive_fully_resolved_channel_monitors() { + bindings.ChainMonitor_archive_fully_resolved_channel_monitors(this.ptr); + GC.KeepAlive(this); + } + /** * Constructs a new Listen which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is diff --git a/c_sharp/src/org/ldk/structs/ChainParameters.cs b/c_sharp/src/org/ldk/structs/ChainParameters.cs index 2341a1ec..59e2af07 100644 --- a/c_sharp/src/org/ldk/structs/ChainParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChainParameters.cs @@ -57,7 +57,7 @@ public class ChainParameters : CommonBase { * Used to track on-chain channel funding outputs and send payments with reliable timelocks. */ public void set_best_block(org.ldk.structs.BestBlock val) { - bindings.ChainParameters_set_best_block(this.ptr, val == null ? 0 : val.ptr); + bindings.ChainParameters_set_best_block(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -67,7 +67,7 @@ public class ChainParameters : CommonBase { * Constructs a new ChainParameters given each field */ public static ChainParameters of(Network network_arg, org.ldk.structs.BestBlock best_block_arg) { - long ret = bindings.ChainParameters_new(network_arg, best_block_arg == null ? 0 : best_block_arg.ptr); + long ret = bindings.ChainParameters_new(network_arg, best_block_arg.ptr); GC.KeepAlive(network_arg); GC.KeepAlive(best_block_arg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/ChangeDestinationSource.cs b/c_sharp/src/org/ldk/structs/ChangeDestinationSource.cs new file mode 100644 index 00000000..fa7ffba7 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ChangeDestinationSource.cs @@ -0,0 +1,76 @@ + +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + + +/** An implementation of ChangeDestinationSource */ +public interface ChangeDestinationSourceInterface { + /**Returns a script pubkey which can be used as a change destination for + * [`OutputSpender::spend_spendable_outputs`]. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds controlled to the same user. + */ + Result_CVec_u8ZNoneZ get_change_destination_script(); +} + +/** + * A helper trait that describes an on-chain wallet capable of returning a (change) destination + * script. + */ +public class ChangeDestinationSource : CommonBase { + internal bindings.LDKChangeDestinationSource bindings_instance; + internal long instance_idx; + + internal ChangeDestinationSource(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + ~ChangeDestinationSource() { + if (ptr != 0) { bindings.ChangeDestinationSource_free(ptr); } + } + + private class LDKChangeDestinationSourceHolder { internal ChangeDestinationSource held; } + private class LDKChangeDestinationSourceImpl : bindings.LDKChangeDestinationSource { + internal LDKChangeDestinationSourceImpl(ChangeDestinationSourceInterface arg, LDKChangeDestinationSourceHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private ChangeDestinationSourceInterface arg; + private LDKChangeDestinationSourceHolder impl_holder; + public long get_change_destination_script() { + Result_CVec_u8ZNoneZ ret = arg.get_change_destination_script(); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; + } + } + + /** Creates a new instance of ChangeDestinationSource from a given implementation */ + public static ChangeDestinationSource new_impl(ChangeDestinationSourceInterface arg) { + LDKChangeDestinationSourceHolder impl_holder = new LDKChangeDestinationSourceHolder(); + LDKChangeDestinationSourceImpl impl = new LDKChangeDestinationSourceImpl(arg, impl_holder); + long[] ptr_idx = bindings.LDKChangeDestinationSource_new(impl); + + impl_holder.held = new ChangeDestinationSource(null, ptr_idx[0]); + impl_holder.held.instance_idx = ptr_idx[1]; + impl_holder.held.bindings_instance = impl; + return impl_holder.held; + } + + /** + * Returns a script pubkey which can be used as a change destination for + * [`OutputSpender::spend_spendable_outputs`]. + * + * This method should return a different value each time it is called, to avoid linking + * on-chain funds controlled to the same user. + */ + public Result_CVec_u8ZNoneZ get_change_destination_script() { + long ret = bindings.ChangeDestinationSource_get_change_destination_script(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_CVec_u8ZNoneZ ret_hu_conv = Result_CVec_u8ZNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs b/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs index 33682123..af7d0859 100644 --- a/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/ChannelAnnouncement.cs @@ -113,7 +113,7 @@ public class ChannelAnnouncement : CommonBase { * The actual announcement */ public void set_contents(org.ldk.structs.UnsignedChannelAnnouncement val) { - bindings.ChannelAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelAnnouncement_set_contents(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -123,7 +123,7 @@ public class ChannelAnnouncement : CommonBase { * Constructs a new ChannelAnnouncement given each field */ public static ChannelAnnouncement of(byte[] node_signature_1_arg, byte[] node_signature_2_arg, byte[] bitcoin_signature_1_arg, byte[] bitcoin_signature_2_arg, org.ldk.structs.UnsignedChannelAnnouncement contents_arg) { - long ret = bindings.ChannelAnnouncement_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_signature_1_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_signature_2_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64)), contents_arg == null ? 0 : contents_arg.ptr); + long ret = bindings.ChannelAnnouncement_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_signature_1_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_signature_2_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(bitcoin_signature_1_arg, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(bitcoin_signature_2_arg, 64)), contents_arg.ptr); GC.KeepAlive(node_signature_1_arg); GC.KeepAlive(node_signature_2_arg); GC.KeepAlive(bitcoin_signature_1_arg); @@ -172,7 +172,7 @@ public class ChannelAnnouncement : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelAnnouncement b) { - bool ret = bindings.ChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelAnnouncement_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelConfig.cs b/c_sharp/src/org/ldk/structs/ChannelConfig.cs index 9f86419e..a541b2e4 100644 --- a/c_sharp/src/org/ldk/structs/ChannelConfig.cs +++ b/c_sharp/src/org/ldk/structs/ChannelConfig.cs @@ -139,13 +139,16 @@ public class ChannelConfig : CommonBase { } /** - * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too - * small to claim on-chain. + * Limit our total exposure to potential loss to on-chain fees on close, including in-flight + * HTLCs which are burned to fees as they are too small to claim on-chain and fees on + * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate. + * + * # HTLC-based Dust Exposure * * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will * not be claimable on-chain, instead being turned into additional miner fees if either * party force-closes the channel. Because the threshold is per-HTLC, our total exposure - * to such payments may be sustantial if there are many dust HTLCs present when the + * to such payments may be substantial if there are many dust HTLCs present when the * channel is force-closed. * * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a @@ -159,7 +162,37 @@ public class ChannelConfig : CommonBase { * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total * exposure across all three types per-channel. * - * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000. + * # Transaction Fee Dust Exposure + * + * Further, counterparties broadcasting a commitment transaction in a force-close may result + * in other balance being burned to fees, and thus all fees on commitment and HTLC + * transactions in excess of our local fee estimates are included in the dust calculation. + * + * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750 + * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per + * non-dust HTLC we're allowed to have with our peers before risking a force-closure for + * inbound channels. + * + * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500 + * sat/KW), we risk force-closure if we disagree with our peer by: + * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in + * both directions (the maximum), + * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both + * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`]) + * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs + * in both directions (the maximum), + * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs + * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`]) + * + * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement + * will scale linearly with increases (or decreases) in the our feerate estimates. Further, + * for anchor channels we expect our counterparty to use a relatively low feerate estimate + * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and + * feerate disagreement force-closures should only occur when theirs is higher than ours. + * + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000. + * + * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep */ public MaxDustHTLCExposure get_max_dust_htlc_exposure() { long ret = bindings.ChannelConfig_get_max_dust_htlc_exposure(this.ptr); @@ -171,13 +204,16 @@ public class ChannelConfig : CommonBase { } /** - * Limit our total exposure to in-flight HTLCs which are burned to fees as they are too - * small to claim on-chain. + * Limit our total exposure to potential loss to on-chain fees on close, including in-flight + * HTLCs which are burned to fees as they are too small to claim on-chain and fees on + * commitment transaction(s) broadcasted by our counterparty in excess of our own fee estimate. + * + * # HTLC-based Dust Exposure * * When an HTLC present in one of our channels is below a \"dust\" threshold, the HTLC will * not be claimable on-chain, instead being turned into additional miner fees if either * party force-closes the channel. Because the threshold is per-HTLC, our total exposure - * to such payments may be sustantial if there are many dust HTLCs present when the + * to such payments may be substantial if there are many dust HTLCs present when the * channel is force-closed. * * The dust threshold for each HTLC is based on the `dust_limit_satoshis` for each party in a @@ -191,7 +227,37 @@ public class ChannelConfig : CommonBase { * The selected limit is applied for sent, forwarded, and received HTLCs and limits the total * exposure across all three types per-channel. * - * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 5000. + * # Transaction Fee Dust Exposure + * + * Further, counterparties broadcasting a commitment transaction in a force-close may result + * in other balance being burned to fees, and thus all fees on commitment and HTLC + * transactions in excess of our local fee estimates are included in the dust calculation. + * + * Because of this, another way to look at this limit is to divide it by 43,000 (or 218,750 + * for non-anchor channels) and see it as the maximum feerate disagreement (in sats/vB) per + * non-dust HTLC we're allowed to have with our peers before risking a force-closure for + * inbound channels. + * + * Thus, for the default value of 10_000 * a current feerate estimate of 10 sat/vB (or 2,500 + * sat/KW), we risk force-closure if we disagree with our peer by: + * `10_000 * 2_500 / 43_000 / (483*2)` = 0.6 sat/vB for anchor channels with 483 HTLCs in + * both directions (the maximum), + * `10_000 * 2_500 / 43_000 / (50*2)` = 5.8 sat/vB for anchor channels with 50 HTLCs in both + * directions (the LDK default max from [`ChannelHandshakeConfig::our_max_accepted_htlcs`]) + * `10_000 * 2_500 / 218_750 / (483*2)` = 0.1 sat/vB for non-anchor channels with 483 HTLCs + * in both directions (the maximum), + * `10_000 * 2_500 / 218_750 / (50*2)` = 1.1 sat/vB for non-anchor channels with 50 HTLCs + * in both (the LDK default maximum from [`ChannelHandshakeConfig::our_max_accepted_htlcs`]) + * + * Note that when using [`MaxDustHTLCExposure::FeeRateMultiplier`] this maximum disagreement + * will scale linearly with increases (or decreases) in the our feerate estimates. Further, + * for anchor channels we expect our counterparty to use a relatively low feerate estimate + * while we use [`ConfirmationTarget::OnChainSweep`] (which should be relatively high) and + * feerate disagreement force-closures should only occur when theirs is higher than ours. + * + * Default value: [`MaxDustHTLCExposure::FeeRateMultiplier`] with a multiplier of 10_000. + * + * [`ConfirmationTarget::OnChainSweep`]: crate::chain::chaininterface::ConfirmationTarget::OnChainSweep */ public void set_max_dust_htlc_exposure(org.ldk.structs.MaxDustHTLCExposure val) { bindings.ChannelConfig_set_max_dust_htlc_exposure(this.ptr, val.ptr); @@ -380,7 +446,7 @@ public class ChannelConfig : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelConfig b) { - bool ret = bindings.ChannelConfig_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelConfig_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -395,7 +461,7 @@ public class ChannelConfig : CommonBase { * Applies the given [`ChannelConfigUpdate`] as a partial update to the [`ChannelConfig`]. */ public void apply(org.ldk.structs.ChannelConfigUpdate update) { - bindings.ChannelConfig_apply(this.ptr, update == null ? 0 : update.ptr); + bindings.ChannelConfig_apply(this.ptr, update.ptr); GC.KeepAlive(this); GC.KeepAlive(update); if (this != null) { this.ptrs_to.AddLast(update); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs b/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs index c994ea6c..7768ddf9 100644 --- a/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs +++ b/c_sharp/src/org/ldk/structs/ChannelCounterparty.cs @@ -56,7 +56,7 @@ public class ChannelCounterparty : CommonBase { * many routing-relevant features are present in the init context. */ public void set_features(org.ldk.structs.InitFeatures val) { - bindings.ChannelCounterparty_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelCounterparty_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -174,7 +174,7 @@ public class ChannelCounterparty : CommonBase { * Note that forwarding_info_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static ChannelCounterparty of(byte[] node_id_arg, org.ldk.structs.InitFeatures features_arg, long unspendable_punishment_reserve_arg, org.ldk.structs.CounterpartyForwardingInfo forwarding_info_arg, org.ldk.structs.Option_u64Z outbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z outbound_htlc_maximum_msat_arg) { - long ret = bindings.ChannelCounterparty_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_arg, 33)), features_arg == null ? 0 : features_arg.ptr, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr, outbound_htlc_minimum_msat_arg.ptr, outbound_htlc_maximum_msat_arg.ptr); + long ret = bindings.ChannelCounterparty_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_arg, 33)), features_arg.ptr, unspendable_punishment_reserve_arg, forwarding_info_arg == null ? 0 : forwarding_info_arg.ptr, outbound_htlc_minimum_msat_arg.ptr, outbound_htlc_maximum_msat_arg.ptr); GC.KeepAlive(node_id_arg); GC.KeepAlive(features_arg); GC.KeepAlive(unspendable_punishment_reserve_arg); diff --git a/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs b/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs index 0b0d2d1d..79775c84 100644 --- a/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChannelDerivationParameters.cs @@ -71,7 +71,7 @@ public class ChannelDerivationParameters : CommonBase { * [`ChannelSigner::provide_channel_parameters`]. */ public void set_transaction_parameters(org.ldk.structs.ChannelTransactionParameters val) { - bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelDerivationParameters_set_transaction_parameters(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -81,7 +81,7 @@ public class ChannelDerivationParameters : CommonBase { * Constructs a new ChannelDerivationParameters given each field */ public static ChannelDerivationParameters of(long value_satoshis_arg, byte[] keys_id_arg, org.ldk.structs.ChannelTransactionParameters transaction_parameters_arg) { - long ret = bindings.ChannelDerivationParameters_new(value_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(keys_id_arg, 32)), transaction_parameters_arg == null ? 0 : transaction_parameters_arg.ptr); + long ret = bindings.ChannelDerivationParameters_new(value_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(keys_id_arg, 32)), transaction_parameters_arg.ptr); GC.KeepAlive(value_satoshis_arg); GC.KeepAlive(keys_id_arg); GC.KeepAlive(transaction_parameters_arg); @@ -116,7 +116,7 @@ public class ChannelDerivationParameters : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelDerivationParameters b) { - bool ret = bindings.ChannelDerivationParameters_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelDerivationParameters_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelDetails.cs b/c_sharp/src/org/ldk/structs/ChannelDetails.cs index dfaa9e4d..2295e2ea 100644 --- a/c_sharp/src/org/ldk/structs/ChannelDetails.cs +++ b/c_sharp/src/org/ldk/structs/ChannelDetails.cs @@ -21,12 +21,13 @@ public class ChannelDetails : CommonBase { * Note that this means this value is *not* persistent - it can change once during the * lifetime of the channel. */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.ChannelDetails_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** @@ -35,10 +36,11 @@ public class ChannelDetails : CommonBase { * Note that this means this value is *not* persistent - it can change once during the * lifetime of the channel. */ - public void set_channel_id(byte[] val) { - bindings.ChannelDetails_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ChannelDetails_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -57,7 +59,7 @@ public class ChannelDetails : CommonBase { * Parameters which apply to our counterparty. See individual fields for more information. */ public void set_counterparty(org.ldk.structs.ChannelCounterparty val) { - bindings.ChannelDetails_set_counterparty(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelDetails_set_counterparty(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -67,9 +69,6 @@ public class ChannelDetails : CommonBase { * The Channel's funding transaction output, if we've negotiated the funding transaction with * our counterparty already. * - * Note that, if this has been set, `channel_id` will be equivalent to - * `funding_txo.unwrap().to_channel_id()`. - * * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public OutPoint get_funding_txo() { @@ -85,9 +84,6 @@ public class ChannelDetails : CommonBase { * The Channel's funding transaction output, if we've negotiated the funding transaction with * our counterparty already. * - * Note that, if this has been set, `channel_id` will be equivalent to - * `funding_txo.unwrap().to_channel_id()`. - * * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ public void set_funding_txo(org.ldk.structs.OutPoint val) { @@ -825,63 +821,6 @@ public class ChannelDetails : CommonBase { if (this != null) { this.ptrs_to.AddLast(val); }; } - /** - * Constructs a new ChannelDetails given each field - * - * Note that funding_txo_arg (or a relevant inner pointer) may be NULL or all-0s to represent None - * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None - * Note that config_arg (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public static ChannelDetails of(byte[] channel_id_arg, org.ldk.structs.ChannelCounterparty counterparty_arg, org.ldk.structs.OutPoint funding_txo_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, org.ldk.structs.Option_u64Z short_channel_id_arg, org.ldk.structs.Option_u64Z outbound_scid_alias_arg, org.ldk.structs.Option_u64Z inbound_scid_alias_arg, long channel_value_satoshis_arg, org.ldk.structs.Option_u64Z unspendable_punishment_reserve_arg, org.ldk.util.UInt128 user_channel_id_arg, org.ldk.structs.Option_u32Z feerate_sat_per_1000_weight_arg, long balance_msat_arg, long outbound_capacity_msat_arg, long next_outbound_htlc_limit_msat_arg, long next_outbound_htlc_minimum_msat_arg, long inbound_capacity_msat_arg, org.ldk.structs.Option_u32Z confirmations_required_arg, org.ldk.structs.Option_u32Z confirmations_arg, org.ldk.structs.Option_u16Z force_close_spend_delay_arg, bool is_outbound_arg, bool is_channel_ready_arg, org.ldk.structs.Option_ChannelShutdownStateZ channel_shutdown_state_arg, bool is_usable_arg, bool is_public_arg, org.ldk.structs.Option_u64Z inbound_htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z inbound_htlc_maximum_msat_arg, org.ldk.structs.ChannelConfig config_arg) { - long ret = bindings.ChannelDetails_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), counterparty_arg == null ? 0 : counterparty_arg.ptr, funding_txo_arg == null ? 0 : funding_txo_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, short_channel_id_arg.ptr, outbound_scid_alias_arg.ptr, inbound_scid_alias_arg.ptr, channel_value_satoshis_arg, unspendable_punishment_reserve_arg.ptr, InternalUtils.encodeUint8Array(user_channel_id_arg.getLEBytes()), feerate_sat_per_1000_weight_arg.ptr, 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.ptr, confirmations_arg.ptr, force_close_spend_delay_arg.ptr, is_outbound_arg, is_channel_ready_arg, channel_shutdown_state_arg.ptr, is_usable_arg, is_public_arg, inbound_htlc_minimum_msat_arg.ptr, inbound_htlc_maximum_msat_arg.ptr, config_arg == null ? 0 : config_arg.ptr); - GC.KeepAlive(channel_id_arg); - GC.KeepAlive(counterparty_arg); - GC.KeepAlive(funding_txo_arg); - GC.KeepAlive(channel_type_arg); - GC.KeepAlive(short_channel_id_arg); - GC.KeepAlive(outbound_scid_alias_arg); - GC.KeepAlive(inbound_scid_alias_arg); - GC.KeepAlive(channel_value_satoshis_arg); - GC.KeepAlive(unspendable_punishment_reserve_arg); - GC.KeepAlive(user_channel_id_arg); - GC.KeepAlive(feerate_sat_per_1000_weight_arg); - GC.KeepAlive(balance_msat_arg); - GC.KeepAlive(outbound_capacity_msat_arg); - GC.KeepAlive(next_outbound_htlc_limit_msat_arg); - GC.KeepAlive(next_outbound_htlc_minimum_msat_arg); - GC.KeepAlive(inbound_capacity_msat_arg); - GC.KeepAlive(confirmations_required_arg); - GC.KeepAlive(confirmations_arg); - GC.KeepAlive(force_close_spend_delay_arg); - GC.KeepAlive(is_outbound_arg); - GC.KeepAlive(is_channel_ready_arg); - GC.KeepAlive(channel_shutdown_state_arg); - GC.KeepAlive(is_usable_arg); - GC.KeepAlive(is_public_arg); - GC.KeepAlive(inbound_htlc_minimum_msat_arg); - GC.KeepAlive(inbound_htlc_maximum_msat_arg); - GC.KeepAlive(config_arg); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelDetails(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(counterparty_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_scid_alias_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_scid_alias_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(unspendable_punishment_reserve_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(feerate_sat_per_1000_weight_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_required_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(confirmations_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(force_close_spend_delay_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_shutdown_state_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_minimum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(inbound_htlc_maximum_msat_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(config_arg); }; - return ret_hu_conv; - } - internal long clone_ptr() { long ret = bindings.ChannelDetails_clone_ptr(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/ChannelFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelFeatures.cs index d6e08e34..29956b15 100644 --- a/c_sharp/src/org/ldk/structs/ChannelFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelFeatures.cs @@ -21,7 +21,7 @@ public class ChannelFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelFeatures b) { - bool ret = bindings.ChannelFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class ChannelFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.ChannelFeatures other) { - bool ret = bindings.ChannelFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.ChannelFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelId.cs b/c_sharp/src/org/ldk/structs/ChannelId.cs new file mode 100644 index 00000000..466e7271 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/ChannelId.cs @@ -0,0 +1,224 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A unique 32-byte identifier for a channel. + * Depending on how the ID is generated, several varieties are distinguished + * (but all are stored as 32 bytes): + * _v1_ and _temporary_. + * A _v1_ channel ID is generated based on funding tx outpoint (txid & index). + * A _temporary_ ID is generated randomly. + * (Later revocation-point-based _v2_ is a possibility.) + * The variety (context) is not stored, it is relevant only at creation. + */ +public class ChannelId : CommonBase { + internal ChannelId(object _dummy, long ptr) : base(ptr) { } + ~ChannelId() { + if (ptr != 0) { bindings.ChannelId_free(ptr); } + } + + public byte[] get_a() { + long ret = bindings.ChannelId_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + public void set_a(byte[] val) { + bindings.ChannelId_set_a(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new ChannelId given each field + */ + public static ChannelId of(byte[] a_arg) { + long ret = bindings.ChannelId_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a_arg, 32))); + GC.KeepAlive(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.ChannelId_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the ChannelId + */ + public ChannelId clone() { + long ret = bindings.ChannelId_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two ChannelIds contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.ChannelId b) { + bool ret = bindings.ChannelId_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is ChannelId)) return false; + return this.eq((ChannelId)o); + } + /** + * Generates a non-cryptographic 64-bit hash of the ChannelId. + */ + public long hash() { + long ret = bindings.ChannelId_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Create _v1_ channel ID based on a funding TX ID and output index + */ + public static ChannelId v1_from_funding_txid(byte[] txid, short output_index) { + long ret = bindings.ChannelId_v1_from_funding_txid(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(txid, 32)), output_index); + GC.KeepAlive(txid); + GC.KeepAlive(output_index); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Create _v1_ channel ID from a funding tx outpoint + */ + public static ChannelId v1_from_funding_outpoint(org.ldk.structs.OutPoint outpoint) { + long ret = bindings.ChannelId_v1_from_funding_outpoint(outpoint.ptr); + GC.KeepAlive(outpoint); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint); }; + return ret_hu_conv; + } + + /** + * Create a _temporary_ channel ID randomly, based on an entropy source. + */ + public static ChannelId temporary_from_entropy_source(org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.ChannelId_temporary_from_entropy_source(entropy_source.ptr); + GC.KeepAlive(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Generic constructor; create a new channel ID from the provided data. + * Use a more specific `*_from_*` constructor when possible. + */ + public static ChannelId from_bytes(byte[] data) { + long ret = bindings.ChannelId_from_bytes(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(data, 32))); + GC.KeepAlive(data); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Create a channel ID consisting of all-zeros data (e.g. when uninitialized or a placeholder). + */ + public static ChannelId new_zero() { + long ret = bindings.ChannelId_new_zero(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Check whether ID is consisting of all zeros (uninitialized) + */ + public bool is_zero() { + bool ret = bindings.ChannelId_is_zero(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Create _v2_ channel ID by concatenating the holder revocation basepoint with the counterparty + * revocation basepoint and hashing the result. The basepoints will be concatenated in increasing + * sorted order. + */ + public static ChannelId v2_from_revocation_basepoints(org.ldk.structs.RevocationBasepoint ours, org.ldk.structs.RevocationBasepoint theirs) { + long ret = bindings.ChannelId_v2_from_revocation_basepoints(ours.ptr, theirs.ptr); + GC.KeepAlive(ours); + GC.KeepAlive(theirs); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ours); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(theirs); }; + return ret_hu_conv; + } + + /** + * Create temporary _v2_ channel ID by concatenating a zeroed out basepoint with the holder + * revocation basepoint and hashing the result. + */ + public static ChannelId temporary_v2_from_revocation_basepoint(org.ldk.structs.RevocationBasepoint our_revocation_basepoint) { + long ret = bindings.ChannelId_temporary_v2_from_revocation_basepoint(our_revocation_basepoint.ptr); + GC.KeepAlive(our_revocation_basepoint); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(our_revocation_basepoint); }; + return ret_hu_conv; + } + + /** + * Serialize the ChannelId object into a byte array which can be read by ChannelId_read + */ + public byte[] write() { + long ret = bindings.ChannelId_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a ChannelId from a byte array, created by ChannelId_write + */ + public static Result_ChannelIdDecodeErrorZ read(byte[] ser) { + long ret = bindings.ChannelId_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdDecodeErrorZ ret_hu_conv = Result_ChannelIdDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ChannelInfo.cs b/c_sharp/src/org/ldk/structs/ChannelInfo.cs index 8a0d79a6..cf9775c8 100644 --- a/c_sharp/src/org/ldk/structs/ChannelInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelInfo.cs @@ -32,7 +32,7 @@ public class ChannelInfo : CommonBase { * Protocol features of a channel communicated during its announcement */ public void set_features(org.ldk.structs.ChannelFeatures val) { - bindings.ChannelInfo_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelInfo_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -54,7 +54,7 @@ public class ChannelInfo : CommonBase { * Source node of the first direction of a channel */ public void set_node_one(org.ldk.structs.NodeId val) { - bindings.ChannelInfo_set_node_one(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelInfo_set_node_one(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -102,7 +102,7 @@ public class ChannelInfo : CommonBase { * Source node of the second direction of a channel */ public void set_node_two(org.ldk.structs.NodeId val) { - bindings.ChannelInfo_set_node_two(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelInfo_set_node_two(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -212,7 +212,7 @@ public class ChannelInfo : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelInfo b) { - bool ret = bindings.ChannelInfo_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelInfo_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelManager.cs b/c_sharp/src/org/ldk/structs/ChannelManager.cs index 567fbd56..0382bd75 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManager.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManager.cs @@ -7,11 +7,629 @@ namespace org { namespace ldk { namespace structs { /** - * Manager which keeps track of a number of channels and sends messages to the appropriate - * channel, also tracking HTLC preimages and forwarding onion packets appropriately. + * A lightning node's channel state machine and payment management logic, which facilitates + * sending, forwarding, and receiving payments through lightning channels. * - * Implements [`ChannelMessageHandler`], handling the multi-channel parts and passing things through - * to individual Channels. + * [`ChannelManager`] is parameterized by a number of components to achieve this. + * - [`chain::Watch`] (typically [`ChainMonitor`]) for on-chain monitoring and enforcement of each + * channel + * - [`BroadcasterInterface`] for broadcasting transactions related to opening, funding, and + * closing channels + * - [`EntropySource`] for providing random data needed for cryptographic operations + * - [`NodeSigner`] for cryptographic operations scoped to the node + * - [`SignerProvider`] for providing signers whose operations are scoped to individual channels + * - [`FeeEstimator`] to determine transaction fee rates needed to have a transaction mined in a + * timely manner + * - [`Router`] for finding payment paths when initiating and retrying payments + * - [`Logger`] for logging operational information of varying degrees + * + * Additionally, it implements the following traits: + * - [`ChannelMessageHandler`] to handle off-chain channel activity from peers + * - [`MessageSendEventsProvider`] to similarly send such messages to peers + * - [`OffersMessageHandler`] for BOLT 12 message handling and sending + * - [`EventsProvider`] to generate user-actionable [`Event`]s + * - [`chain::Listen`] and [`chain::Confirm`] for notification of on-chain activity + * + * Thus, [`ChannelManager`] is typically used to parameterize a [`MessageHandler`] and an + * [`OnionMessenger`]. The latter is required to support BOLT 12 functionality. + * + * # `ChannelManager` vs `ChannelMonitor` + * + * It's important to distinguish between the *off-chain* management and *on-chain* enforcement of + * lightning channels. [`ChannelManager`] exchanges messages with peers to manage the off-chain + * state of each channel. During this process, it generates a [`ChannelMonitor`] for each channel + * and a [`ChannelMonitorUpdate`] for each relevant change, notifying its parameterized + * [`chain::Watch`] of them. + * + * An implementation of [`chain::Watch`], such as [`ChainMonitor`], is responsible for aggregating + * these [`ChannelMonitor`]s and applying any [`ChannelMonitorUpdate`]s to them. It then monitors + * for any pertinent on-chain activity, enforcing claims as needed. + * + * This division of off-chain management and on-chain enforcement allows for interesting node + * setups. For instance, on-chain enforcement could be moved to a separate host or have added + * redundancy, possibly as a watchtower. See [`chain::Watch`] for the relevant interface. + * + * # Initialization + * + * Use [`ChannelManager::new`] with the most recent [`BlockHash`] when creating a fresh instance. + * Otherwise, if restarting, construct [`ChannelManagerReadArgs`] with the necessary parameters and + * references to any deserialized [`ChannelMonitor`]s that were previously persisted. Use this to + * deserialize the [`ChannelManager`] and feed it any new chain data since it was last online, as + * detailed in the [`ChannelManagerReadArgs`] documentation. + * + * ``` + * use bitcoin::BlockHash; + * use bitcoin::network::constants::Network; + * use lightning::chain::BestBlock; + * # use lightning::chain::channelmonitor::ChannelMonitor; + * use lightning::ln::channelmanager::{ChainParameters, ChannelManager, ChannelManagerReadArgs}; + * # use lightning::routing::gossip::NetworkGraph; + * use lightning::util::config::UserConfig; + * use lightning::util::ser::ReadableArgs; + * + * # fn read_channel_monitors() -> Vec> { vec![] } + * # fn example< + * # 'a, + * # L: lightning::util::logger::Logger, + * # ES: lightning::sign::EntropySource, + * # S: for <'b> lightning::routing::scoring::LockableScore<'b, ScoreLookUp = SL>, + * # SL: lightning::routing::scoring::ScoreLookUp, + * # SP: Sized, + * # R: lightning::io::Read, + * # >( + * # fee_estimator: &dyn lightning::chain::chaininterface::FeeEstimator, + * # chain_monitor: &dyn lightning::chain::Watch, + * # tx_broadcaster: &dyn lightning::chain::chaininterface::BroadcasterInterface, + * # router: &lightning::routing::router::DefaultRouter<&NetworkGraph<&'a L>, &'a L, &ES, &S, SP, SL>, + * # logger: &L, + * # entropy_source: &ES, + * # node_signer: &dyn lightning::sign::NodeSigner, + * # signer_provider: &lightning::sign::DynSignerProvider, + * # best_block: lightning::chain::BestBlock, + * # current_timestamp: u32, + * # mut reader: R, + * # ) -> Result<(), lightning::ln::msgs::DecodeError> { + * Fresh start with no channels + * let params = ChainParameters { + * network: Network::Bitcoin, + * best_block, + * }; + * let default_config = UserConfig::default(); + * let channel_manager = ChannelManager::new( + * fee_estimator, chain_monitor, tx_broadcaster, router, logger, entropy_source, node_signer, + * signer_provider, default_config, params, current_timestamp + * ); + * + * Restart from deserialized data + * let mut channel_monitors = read_channel_monitors(); + * let args = ChannelManagerReadArgs::new( + * entropy_source, node_signer, signer_provider, fee_estimator, chain_monitor, tx_broadcaster, + * router, logger, default_config, channel_monitors.iter_mut().collect() + * ); + * let (block_hash, channel_manager) = + * <(BlockHash, ChannelManager<_, _, _, _, _, _, _, _>)>::read(&mut reader, args)?; + * + * Update the ChannelManager and ChannelMonitors with the latest chain data + * ... + * + * Move the monitors to the ChannelManager's chain::Watch parameter + * for monitor in channel_monitors { + * chain_monitor.watch_channel(monitor.get_funding_txo().0, monitor); + * } + * # Ok(()) + * # } + * ``` + * + * # Operation + * + * The following is required for [`ChannelManager`] to function properly: + * - Handle messages from peers using its [`ChannelMessageHandler`] implementation (typically + * called by [`PeerManager::read_event`] when processing network I/O) + * - Send messages to peers obtained via its [`MessageSendEventsProvider`] implementation + * (typically initiated when [`PeerManager::process_events`] is called) + * - Feed on-chain activity using either its [`chain::Listen`] or [`chain::Confirm`] implementation + * as documented by those traits + * - Perform any periodic channel and payment checks by calling [`timer_tick_occurred`] roughly + * every minute + * - Persist to disk whenever [`get_and_clear_needs_persistence`] returns `true` using a + * [`Persister`] such as a [`KVStore`] implementation + * - Handle [`Event`]s obtained via its [`EventsProvider`] implementation + * + * The [`Future`] returned by [`get_event_or_persistence_needed_future`] is useful in determining + * when the last two requirements need to be checked. + * + * The [`lightning-block-sync`] and [`lightning-transaction-sync`] crates provide utilities that + * simplify feeding in on-chain activity using the [`chain::Listen`] and [`chain::Confirm`] traits, + * respectively. The remaining requirements can be met using the [`lightning-background-processor`] + * crate. For languages other than Rust, the availability of similar utilities may vary. + * + * # Channels + * + * [`ChannelManager`]'s primary function involves managing a channel state. Without channels, + * payments can't be sent. Use [`list_channels`] or [`list_usable_channels`] for a snapshot of the + * currently open channels. + * + * ``` + * # use lightning::ln::channelmanager::AChannelManager; + * # + * # fn example(channel_manager: T) { + * # let channel_manager = channel_manager.get_cm(); + * let channels = channel_manager.list_usable_channels(); + * for details in channels { + * println!(\"{:?}\", details); + * } + * # } + * ``` + * + * Each channel is identified using a [`ChannelId`], which will change throughout the channel's + * life cycle. Additionally, channels are assigned a `user_channel_id`, which is given in + * [`Event`]s associated with the channel and serves as a fixed identifier but is otherwise unused + * by [`ChannelManager`]. + * + * ## Opening Channels + * + * To an open a channel with a peer, call [`create_channel`]. This will initiate the process of + * opening an outbound channel, which requires self-funding when handling + * [`Event::FundingGenerationReady`]. + * + * ``` + * # use bitcoin::{ScriptBuf, Transaction}; + * # use bitcoin::secp256k1::PublicKey; + * # use lightning::ln::channelmanager::AChannelManager; + * # use lightning::events::{Event, EventsProvider}; + * # + * # trait Wallet { + * # fn create_funding_transaction( + * # &self, _amount_sats: u64, _output_script: ScriptBuf + * # ) -> Transaction; + * # } + * # + * # fn example(channel_manager: T, wallet: W, peer_id: PublicKey) { + * # let channel_manager = channel_manager.get_cm(); + * let value_sats = 1_000_000; + * let push_msats = 10_000_000; + * match channel_manager.create_channel(peer_id, value_sats, push_msats, 42, None, None) { + * Ok(channel_id) => println!(\"Opening channel {}\", channel_id), + * Err(e) => println!(\"Error opening channel: {:?}\", e), + * } + * + * On the event processing thread once the peer has responded + * channel_manager.process_pending_events(&|event| match event { + * Event::FundingGenerationReady { + * temporary_channel_id, counterparty_node_id, channel_value_satoshis, output_script, + * user_channel_id, .. + * } => { + * assert_eq!(user_channel_id, 42); + * let funding_transaction = wallet.create_funding_transaction( + * channel_value_satoshis, output_script + * ); + * match channel_manager.funding_transaction_generated( + * &temporary_channel_id, &counterparty_node_id, funding_transaction + * ) { + * Ok(()) => println!(\"Funding channel {}\", temporary_channel_id), + * Err(e) => println!(\"Error funding channel {}: {:?}\", temporary_channel_id, e), + * } + * }, + * Event::ChannelPending { channel_id, user_channel_id, former_temporary_channel_id, .. } => { + * assert_eq!(user_channel_id, 42); + * println!( + * \"Channel {} now {} pending (funding transaction has been broadcasted)\", channel_id, + * former_temporary_channel_id.unwrap() + * ); + * }, + * Event::ChannelReady { channel_id, user_channel_id, .. } => { + * assert_eq!(user_channel_id, 42); + * println!(\"Channel {} ready\", channel_id); + * }, + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * ## Accepting Channels + * + * Inbound channels are initiated by peers and are automatically accepted unless [`ChannelManager`] + * has [`UserConfig::manually_accept_inbound_channels`] set. In that case, the channel may be + * either accepted or rejected when handling [`Event::OpenChannelRequest`]. + * + * ``` + * # use bitcoin::secp256k1::PublicKey; + * # use lightning::ln::channelmanager::AChannelManager; + * # use lightning::events::{Event, EventsProvider}; + * # + * # fn is_trusted(counterparty_node_id: PublicKey) -> bool { + * # // ... + * # unimplemented!() + * # } + * # + * # fn example(channel_manager: T) { + * # let channel_manager = channel_manager.get_cm(); + * channel_manager.process_pending_events(&|event| match event { + * Event::OpenChannelRequest { temporary_channel_id, counterparty_node_id, .. } => { + * if !is_trusted(counterparty_node_id) { + * match channel_manager.force_close_without_broadcasting_txn( + * &temporary_channel_id, &counterparty_node_id + * ) { + * Ok(()) => println!(\"Rejecting channel {}\", temporary_channel_id), + * Err(e) => println!(\"Error rejecting channel {}: {:?}\", temporary_channel_id, e), + * } + * return; + * } + * + * let user_channel_id = 43; + * match channel_manager.accept_inbound_channel( + * &temporary_channel_id, &counterparty_node_id, user_channel_id + * ) { + * Ok(()) => println!(\"Accepting channel {}\", temporary_channel_id), + * Err(e) => println!(\"Error accepting channel {}: {:?}\", temporary_channel_id, e), + * } + * }, + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * ## Closing Channels + * + * There are two ways to close a channel: either cooperatively using [`close_channel`] or + * unilaterally using [`force_close_broadcasting_latest_txn`]. The former is ideal as it makes for + * lower fees and immediate access to funds. However, the latter may be necessary if the + * counterparty isn't behaving properly or has gone offline. [`Event::ChannelClosed`] is generated + * once the channel has been closed successfully. + * + * ``` + * # use bitcoin::secp256k1::PublicKey; + * # use lightning::ln::types::ChannelId; + * # use lightning::ln::channelmanager::AChannelManager; + * # use lightning::events::{Event, EventsProvider}; + * # + * # fn example( + * # channel_manager: T, channel_id: ChannelId, counterparty_node_id: PublicKey + * # ) { + * # let channel_manager = channel_manager.get_cm(); + * match channel_manager.close_channel(&channel_id, &counterparty_node_id) { + * Ok(()) => println!(\"Closing channel {}\", channel_id), + * Err(e) => println!(\"Error closing channel {}: {:?}\", channel_id, e), + * } + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::ChannelClosed { channel_id, user_channel_id, .. } => { + * assert_eq!(user_channel_id, 42); + * println!(\"Channel {} closed\", channel_id); + * }, + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * # Payments + * + * [`ChannelManager`] is responsible for sending, forwarding, and receiving payments through its + * channels. A payment is typically initiated from a [BOLT 11] invoice or a [BOLT 12] offer, though + * spontaneous (i.e., keysend) payments are also possible. Incoming payments don't require + * maintaining any additional state as [`ChannelManager`] can reconstruct the [`PaymentPreimage`] + * from the [`PaymentSecret`]. Sending payments, however, require tracking in order to retry failed + * HTLCs. + * + * After a payment is initiated, it will appear in [`list_recent_payments`] until a short time + * after either an [`Event::PaymentSent`] or [`Event::PaymentFailed`] is handled. Failed HTLCs + * for a payment will be retried according to the payment's [`Retry`] strategy or until + * [`abandon_payment`] is called. + * + * ## BOLT 11 Invoices + * + * The [`lightning-invoice`] crate is useful for creating BOLT 11 invoices. Specifically, use the + * functions in its `utils` module for constructing invoices that are compatible with + * [`ChannelManager`]. These functions serve as a convenience for building invoices with the + * [`PaymentHash`] and [`PaymentSecret`] returned from [`create_inbound_payment`]. To provide your + * own [`PaymentHash`], use [`create_inbound_payment_for_hash`] or the corresponding functions in + * the [`lightning-invoice`] `utils` module. + * + * [`ChannelManager`] generates an [`Event::PaymentClaimable`] once the full payment has been + * received. Call [`claim_funds`] to release the [`PaymentPreimage`], which in turn will result in + * an [`Event::PaymentClaimed`]. + * + * ``` + * # use lightning::events::{Event, EventsProvider, PaymentPurpose}; + * # use lightning::ln::channelmanager::AChannelManager; + * # + * # fn example(channel_manager: T) { + * # let channel_manager = channel_manager.get_cm(); + * Or use utils::create_invoice_from_channelmanager + * let known_payment_hash = match channel_manager.create_inbound_payment( + * Some(10_000_000), 3600, None + * ) { + * Ok((payment_hash, _payment_secret)) => { + * println!(\"Creating inbound payment {}\", payment_hash); + * payment_hash + * }, + * Err(()) => panic!(\"Error creating inbound payment\"), + * }; + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { + * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: Some(payment_preimage), .. } => { + * assert_eq!(payment_hash, known_payment_hash); + * println!(\"Claiming payment {}\", payment_hash); + * channel_manager.claim_funds(payment_preimage); + * }, + * PaymentPurpose::Bolt11InvoicePayment { payment_preimage: None, .. } => { + * println!(\"Unknown payment hash: {}\", payment_hash); + * }, + * PaymentPurpose::SpontaneousPayment(payment_preimage) => { + * assert_ne!(payment_hash, known_payment_hash); + * println!(\"Claiming spontaneous payment {}\", payment_hash); + * channel_manager.claim_funds(payment_preimage); + * }, + * ... + * # _ => {}, + * }, + * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { + * assert_eq!(payment_hash, known_payment_hash); + * println!(\"Claimed {} msats\", amount_msat); + * }, + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * For paying an invoice, [`lightning-invoice`] provides a `payment` module with convenience + * functions for use with [`send_payment`]. + * + * ``` + * # use lightning::events::{Event, EventsProvider}; + * # use lightning::ln::types::PaymentHash; + * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, RecipientOnionFields, Retry}; + * # use lightning::routing::router::RouteParameters; + * # + * # fn example( + * # channel_manager: T, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, + * # route_params: RouteParameters, retry: Retry + * # ) { + * # let channel_manager = channel_manager.get_cm(); + * let (payment_hash, recipient_onion, route_params) = + * payment::payment_parameters_from_invoice(&invoice); + * let payment_id = PaymentId([42; 32]); + * match channel_manager.send_payment( + * payment_hash, recipient_onion, payment_id, route_params, retry + * ) { + * Ok(()) => println!(\"Sending payment with hash {}\", payment_hash), + * Err(e) => println!(\"Failed sending payment with hash {}: {:?}\", payment_hash, e), + * } + * + * let expected_payment_id = payment_id; + * let expected_payment_hash = payment_hash; + * assert!( + * channel_manager.list_recent_payments().iter().find(|details| matches!( + * details, + * RecentPaymentDetails::Pending { + * payment_id: expected_payment_id, + * payment_hash: expected_payment_hash, + * .. + * } + * )).is_some() + * ); + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::PaymentSent { payment_hash, .. } => println!(\"Paid {}\", payment_hash), + * Event::PaymentFailed { payment_hash, .. } => println!(\"Failed paying {}\", payment_hash), + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * ## BOLT 12 Offers + * + * The [`offers`] module is useful for creating BOLT 12 offers. An [`Offer`] is a precursor to a + * [`Bolt12Invoice`], which must first be requested by the payer. The interchange of these messages + * as defined in the specification is handled by [`ChannelManager`] and its implementation of + * [`OffersMessageHandler`]. However, this only works with an [`Offer`] created using a builder + * returned by [`create_offer_builder`]. With this approach, BOLT 12 offers and invoices are + * stateless just as BOLT 11 invoices are. + * + * ``` + * # use lightning::events::{Event, EventsProvider, PaymentPurpose}; + * # use lightning::ln::channelmanager::AChannelManager; + * # use lightning::offers::parse::Bolt12SemanticError; + * # + * # fn example(channel_manager: T) -> Result<(), Bolt12SemanticError> { + * # let channel_manager = channel_manager.get_cm(); + * let offer = channel_manager + * .create_offer_builder()? + * # ; + * # // Needed for compiling for c_bindings + * # let builder: lightning::offers::offer::OfferBuilder<_, _> = offer.into(); + * # let offer = builder + * .description(\"coffee\".to_string()) + * .amount_msats(10_000_000) + * .build()?; + * let bech32_offer = offer.to_string(); + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { + * PaymentPurpose::Bolt12OfferPayment { payment_preimage: Some(payment_preimage), .. } => { + * println!(\"Claiming payment {}\", payment_hash); + * channel_manager.claim_funds(payment_preimage); + * }, + * PaymentPurpose::Bolt12OfferPayment { payment_preimage: None, .. } => { + * println!(\"Unknown payment hash: {}\", payment_hash); + * }, + * ... + * # _ => {}, + * }, + * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { + * println!(\"Claimed {} msats\", amount_msat); + * }, + * ... + * # _ => {}, + * }); + * # Ok(()) + * # } + * ``` + * + * Use [`pay_for_offer`] to initiated payment, which sends an [`InvoiceRequest`] for an [`Offer`] + * and pays the [`Bolt12Invoice`] response. In addition to success and failure events, + * [`ChannelManager`] may also generate an [`Event::InvoiceRequestFailed`]. + * + * ``` + * # use lightning::events::{Event, EventsProvider}; + * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry}; + * # use lightning::offers::offer::Offer; + * # + * # fn example( + * # channel_manager: T, offer: &Offer, quantity: Option, amount_msats: Option, + * # payer_note: Option, retry: Retry, max_total_routing_fee_msat: Option + * # ) { + * # let channel_manager = channel_manager.get_cm(); + * let payment_id = PaymentId([42; 32]); + * match channel_manager.pay_for_offer( + * offer, quantity, amount_msats, payer_note, payment_id, retry, max_total_routing_fee_msat + * ) { + * Ok(()) => println!(\"Requesting invoice for offer\"), + * Err(e) => println!(\"Unable to request invoice for offer: {:?}\", e), + * } + * + * First the payment will be waiting on an invoice + * let expected_payment_id = payment_id; + * assert!( + * channel_manager.list_recent_payments().iter().find(|details| matches!( + * details, + * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id } + * )).is_some() + * ); + * + * Once the invoice is received, a payment will be sent + * assert!( + * channel_manager.list_recent_payments().iter().find(|details| matches!( + * details, + * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. } + * )).is_some() + * ); + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id), + * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id), + * Event::InvoiceRequestFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id), + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * ## BOLT 12 Refunds + * + * A [`Refund`] is a request for an invoice to be paid. Like *paying* for an [`Offer`], *creating* + * a [`Refund`] involves maintaining state since it represents a future outbound payment. + * Therefore, use [`create_refund_builder`] when creating one, otherwise [`ChannelManager`] will + * refuse to pay any corresponding [`Bolt12Invoice`] that it receives. + * + * ``` + * # use core::time::Duration; + * # use lightning::events::{Event, EventsProvider}; + * # use lightning::ln::channelmanager::{AChannelManager, PaymentId, RecentPaymentDetails, Retry}; + * # use lightning::offers::parse::Bolt12SemanticError; + * # + * # fn example( + * # channel_manager: T, amount_msats: u64, absolute_expiry: Duration, retry: Retry, + * # max_total_routing_fee_msat: Option + * # ) -> Result<(), Bolt12SemanticError> { + * # let channel_manager = channel_manager.get_cm(); + * let payment_id = PaymentId([42; 32]); + * let refund = channel_manager + * .create_refund_builder( + * amount_msats, absolute_expiry, payment_id, retry, max_total_routing_fee_msat + * )? + * # ; + * # // Needed for compiling for c_bindings + * # let builder: lightning::offers::refund::RefundBuilder<_> = refund.into(); + * # let refund = builder + * .description(\"coffee\".to_string()) + * .payer_note(\"refund for order 1234\".to_string()) + * .build()?; + * let bech32_refund = refund.to_string(); + * + * First the payment will be waiting on an invoice + * let expected_payment_id = payment_id; + * assert!( + * channel_manager.list_recent_payments().iter().find(|details| matches!( + * details, + * RecentPaymentDetails::AwaitingInvoice { payment_id: expected_payment_id } + * )).is_some() + * ); + * + * Once the invoice is received, a payment will be sent + * assert!( + * channel_manager.list_recent_payments().iter().find(|details| matches!( + * details, + * RecentPaymentDetails::Pending { payment_id: expected_payment_id, .. } + * )).is_some() + * ); + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::PaymentSent { payment_id: Some(payment_id), .. } => println!(\"Paid {}\", payment_id), + * Event::PaymentFailed { payment_id, .. } => println!(\"Failed paying {}\", payment_id), + * ... + * # _ => {}, + * }); + * # Ok(()) + * # } + * ``` + * + * Use [`request_refund_payment`] to send a [`Bolt12Invoice`] for receiving the refund. Similar to + * creating* an [`Offer`], this is stateless as it represents an inbound payment. + * + * ``` + * # use lightning::events::{Event, EventsProvider, PaymentPurpose}; + * # use lightning::ln::channelmanager::AChannelManager; + * # use lightning::offers::refund::Refund; + * # + * # fn example(channel_manager: T, refund: &Refund) { + * # let channel_manager = channel_manager.get_cm(); + * let known_payment_hash = match channel_manager.request_refund_payment(refund) { + * Ok(invoice) => { + * let payment_hash = invoice.payment_hash(); + * println!(\"Requesting refund payment {}\", payment_hash); + * payment_hash + * }, + * Err(e) => panic!(\"Unable to request payment for refund: {:?}\", e), + * }; + * + * On the event processing thread + * channel_manager.process_pending_events(&|event| match event { + * Event::PaymentClaimable { payment_hash, purpose, .. } => match purpose { + * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: Some(payment_preimage), .. } => { + * assert_eq!(payment_hash, known_payment_hash); + * println!(\"Claiming payment {}\", payment_hash); + * channel_manager.claim_funds(payment_preimage); + * }, + * \tPaymentPurpose::Bolt12RefundPayment { payment_preimage: None, .. } => { + * println!(\"Unknown payment hash: {}\", payment_hash); + * \t}, + * ... + * # _ => {}, + * }, + * Event::PaymentClaimed { payment_hash, amount_msat, .. } => { + * assert_eq!(payment_hash, known_payment_hash); + * println!(\"Claimed {} msats\", amount_msat); + * }, + * ... + * # _ => {}, + * }); + * # } + * ``` + * + * # Persistence * * Implements [`Writeable`] to write out all channel state to disk. Implies [`peer_disconnected`] for * all peers during write/read (though does not modify this instance, only the instance being @@ -32,12 +650,16 @@ namespace org { namespace ldk { namespace structs { * tells you the last block hash which was connected. You should get the best block tip before using the manager. * See [`chain::Listen`] and [`chain::Confirm`] for more details. * + * # `ChannelUpdate` Messages + * * Note that `ChannelManager` is responsible for tracking liveness of its channels and generating * [`ChannelUpdate`] messages informing peers that the channel is temporarily disabled. To avoid * spam due to quick disconnection/reconnection, updates are not sent until the channel has been * offline for a full minute. In order to track this, you must call * [`timer_tick_occurred`] roughly once per minute, though it doesn't have to be perfect. * + * # DoS Mitigation + * * To avoid trivial DoS issues, `ChannelManager` limits the number of inbound connections and * inbound channels without confirmed funding transactions. This may result in nodes which we do * not have a channel with being unable to connect to us or open new channels with us if we have @@ -47,19 +669,53 @@ namespace org { namespace ldk { namespace structs { * exempted from the count of unfunded channels. Similarly, outbound channels and connections are * never limited. Please ensure you limit the count of such channels yourself. * + * # Type Aliases + * * Rather than using a plain `ChannelManager`, it is preferable to use either a [`SimpleArcChannelManager`] * a [`SimpleRefChannelManager`], for conciseness. See their documentation for more details, but * essentially you should default to using a [`SimpleRefChannelManager`], and use a * [`SimpleArcChannelManager`] when you require a `ChannelManager` with a static lifetime, such as when * you're using lightning-net-tokio. * + * [`ChainMonitor`]: crate::chain::chainmonitor::ChainMonitor + * [`MessageHandler`]: crate::ln::peer_handler::MessageHandler + * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * [`PeerManager::read_event`]: crate::ln::peer_handler::PeerManager::read_event + * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events + * [`timer_tick_occurred`]: Self::timer_tick_occurred + * [`get_and_clear_needs_persistence`]: Self::get_and_clear_needs_persistence + * [`Persister`]: crate::util::persist::Persister + * [`KVStore`]: crate::util::persist::KVStore + * [`get_event_or_persistence_needed_future`]: Self::get_event_or_persistence_needed_future + * [`lightning-block-sync`]: https://docs.rs/lightning_block_sync/latest/lightning_block_sync + * [`lightning-transaction-sync`]: https://docs.rs/lightning_transaction_sync/latest/lightning_transaction_sync + * [`lightning-background-processor`]: https://docs.rs/lightning_background_processor/lightning_background_processor + * [`list_channels`]: Self::list_channels + * [`list_usable_channels`]: Self::list_usable_channels + * [`create_channel`]: Self::create_channel + * [`close_channel`]: Self::force_close_broadcasting_latest_txn + * [`force_close_broadcasting_latest_txn`]: Self::force_close_broadcasting_latest_txn + * [BOLT 11]: https://github.com/lightning/bolts/blob/master/11-payment-encoding.md + * [BOLT 12]: https://github.com/rustyrussell/lightning-rfc/blob/guilt/offers/12-offer-encoding.md + * [`list_recent_payments`]: Self::list_recent_payments + * [`abandon_payment`]: Self::abandon_payment + * [`lightning-invoice`]: https://docs.rs/lightning_invoice/latest/lightning_invoice + * [`create_inbound_payment`]: Self::create_inbound_payment + * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash + * [`claim_funds`]: Self::claim_funds + * [`send_payment`]: Self::send_payment + * [`offers`]: crate::offers + * [`create_offer_builder`]: Self::create_offer_builder + * [`pay_for_offer`]: Self::pay_for_offer + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`create_refund_builder`]: Self::create_refund_builder + * [`request_refund_payment`]: Self::request_refund_payment * [`peer_disconnected`]: msgs::ChannelMessageHandler::peer_disconnected * [`funding_created`]: msgs::FundingCreated * [`funding_transaction_generated`]: Self::funding_transaction_generated * [`BlockHash`]: bitcoin::hash_types::BlockHash * [`update_channel`]: chain::Watch::update_channel * [`ChannelUpdate`]: msgs::ChannelUpdate - * [`timer_tick_occurred`]: Self::timer_tick_occurred * [`read`]: ReadableArgs::read */ public class ChannelManager : CommonBase { @@ -88,7 +744,7 @@ public class ChannelManager : CommonBase { * [`params.best_block.block_hash`]: chain::BestBlock::block_hash */ public static ChannelManager of(org.ldk.structs.FeeEstimator fee_est, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.UserConfig config, org.ldk.structs.ChainParameters _params, int current_timestamp) { - long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config == null ? 0 : config.ptr, _params == null ? 0 : _params.ptr, current_timestamp); + long ret = bindings.ChannelManager_new(fee_est.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, entropy_source.ptr, node_signer.ptr, signer_provider.ptr, config.ptr, _params.ptr, current_timestamp); GC.KeepAlive(fee_est); GC.KeepAlive(chain_monitor); GC.KeepAlive(tx_broadcaster); @@ -162,10 +818,11 @@ public class ChannelManager : CommonBase { * [`Event::FundingGenerationReady::temporary_channel_id`]: events::Event::FundingGenerationReady::temporary_channel_id * [`Event::ChannelClosed::channel_id`]: events::Event::ChannelClosed::channel_id * + * Note that temporary_channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None * Note that override_config (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_ThirtyTwoBytesAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.Option_ThirtyTwoBytesZ temporary_channel_id, org.ldk.structs.UserConfig override_config) { - long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_network_key, 33)), channel_value_satoshis, push_msat, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), temporary_channel_id.ptr, override_config == null ? 0 : override_config.ptr); + public Result_ChannelIdAPIErrorZ create_channel(byte[] their_network_key, long channel_value_satoshis, long push_msat, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ChannelId temporary_channel_id, org.ldk.structs.UserConfig override_config) { + long ret = bindings.ChannelManager_create_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_network_key, 33)), channel_value_satoshis, push_msat, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), temporary_channel_id == null ? 0 : temporary_channel_id.ptr, override_config == null ? 0 : override_config.ptr); GC.KeepAlive(this); GC.KeepAlive(their_network_key); GC.KeepAlive(channel_value_satoshis); @@ -174,7 +831,7 @@ public class ChannelManager : CommonBase { GC.KeepAlive(temporary_channel_id); GC.KeepAlive(override_config); if (ret >= 0 && ret <= 4096) { return null; } - Result_ThirtyTwoBytesAPIErrorZ ret_hu_conv = Result_ThirtyTwoBytesAPIErrorZ.constr_from_ptr(ret); + Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(temporary_channel_id); }; if (this != null) { this.ptrs_to.AddLast(override_config); }; return ret_hu_conv; @@ -295,13 +952,14 @@ public class ChannelManager : CommonBase { * [`NonAnchorChannelFee`]: crate::chain::chaininterface::ConfirmationTarget::NonAnchorChannelFee * [`SendShutdown`]: crate::events::MessageSendEvent::SendShutdown */ - public Result_NoneAPIErrorZ close_channel(byte[] channel_id, byte[] counterparty_node_id) { - long ret = bindings.ChannelManager_close_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33))); + public Result_NoneAPIErrorZ close_channel(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id) { + long ret = bindings.ChannelManager_close_channel(this.ptr, channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33))); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } @@ -338,8 +996,8 @@ public class ChannelManager : CommonBase { * * Note that shutdown_script (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Result_NoneAPIErrorZ close_channel_with_feerate_and_script(byte[] channel_id, byte[] counterparty_node_id, org.ldk.structs.Option_u32Z target_feerate_sats_per_1000_weight, org.ldk.structs.ShutdownScript shutdown_script) { - long ret = bindings.ChannelManager_close_channel_with_feerate_and_script(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), target_feerate_sats_per_1000_weight.ptr, shutdown_script == null ? 0 : shutdown_script.ptr); + public Result_NoneAPIErrorZ close_channel_with_feerate_and_script(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id, org.ldk.structs.Option_u32Z target_feerate_sats_per_1000_weight, org.ldk.structs.ShutdownScript shutdown_script) { + long ret = bindings.ChannelManager_close_channel_with_feerate_and_script(this.ptr, channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), target_feerate_sats_per_1000_weight.ptr, shutdown_script == null ? 0 : shutdown_script.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); @@ -347,6 +1005,7 @@ public class ChannelManager : CommonBase { GC.KeepAlive(shutdown_script); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(channel_id); }; if (this != null) { this.ptrs_to.AddLast(target_feerate_sats_per_1000_weight); }; if (this != null) { this.ptrs_to.AddLast(shutdown_script); }; return ret_hu_conv; @@ -358,13 +1017,14 @@ public class ChannelManager : CommonBase { * the manager, or if the `counterparty_node_id` isn't the counterparty of the corresponding * channel. */ - public Result_NoneAPIErrorZ force_close_broadcasting_latest_txn(byte[] channel_id, byte[] counterparty_node_id) { - long ret = bindings.ChannelManager_force_close_broadcasting_latest_txn(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33))); + public Result_NoneAPIErrorZ force_close_broadcasting_latest_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id) { + long ret = bindings.ChannelManager_force_close_broadcasting_latest_txn(this.ptr, channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33))); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } @@ -373,16 +1033,17 @@ public class ChannelManager : CommonBase { * the latest local transaction(s). Fails if `channel_id` is unknown to the manager, or if the * `counterparty_node_id` isn't the counterparty of the corresponding channel. * - * You can always get the latest local transaction(s) to broadcast from - * [`ChannelMonitor::get_latest_holder_commitment_txn`]. + * You can always broadcast the latest local transaction(s) via + * [`ChannelMonitor::broadcast_latest_holder_commitment_txn`]. */ - public Result_NoneAPIErrorZ force_close_without_broadcasting_txn(byte[] channel_id, byte[] counterparty_node_id) { - long ret = bindings.ChannelManager_force_close_without_broadcasting_txn(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33))); + public Result_NoneAPIErrorZ force_close_without_broadcasting_txn(org.ldk.structs.ChannelId channel_id, byte[] counterparty_node_id) { + long ret = bindings.ChannelManager_force_close_without_broadcasting_txn(this.ptr, channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33))); GC.KeepAlive(this); GC.KeepAlive(channel_id); GC.KeepAlive(counterparty_node_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } @@ -458,7 +1119,7 @@ public class ChannelManager : CommonBase { * [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress */ public Result_NonePaymentSendFailureZ send_payment_with_route(org.ldk.structs.Route route, byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) { - long ret = bindings.ChannelManager_send_payment_with_route(this.ptr, route == null ? 0 : route.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + long ret = bindings.ChannelManager_send_payment_with_route(this.ptr, route.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); GC.KeepAlive(this); GC.KeepAlive(route); GC.KeepAlive(payment_hash); @@ -476,7 +1137,7 @@ public class ChannelManager : CommonBase { * `route_params` and retry failed payment paths based on `retry_strategy`. */ public Result_NoneRetryableSendFailureZ send_payment(byte[] payment_hash, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { - long ret = bindings.ChannelManager_send_payment(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), route_params == null ? 0 : route_params.ptr, retry_strategy.ptr); + long ret = bindings.ChannelManager_send_payment(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), route_params.ptr, retry_strategy.ptr); GC.KeepAlive(this); GC.KeepAlive(payment_hash); GC.KeepAlive(recipient_onion); @@ -542,7 +1203,7 @@ public class ChannelManager : CommonBase { * [`send_payment`]: Self::send_payment */ public Result_ThirtyTwoBytesPaymentSendFailureZ send_spontaneous_payment(org.ldk.structs.Route route, org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id) { - long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route == null ? 0 : route.ptr, payment_preimage.ptr, recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + long ret = bindings.ChannelManager_send_spontaneous_payment(this.ptr, route.ptr, payment_preimage.ptr, recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); GC.KeepAlive(this); GC.KeepAlive(route); GC.KeepAlive(payment_preimage); @@ -566,7 +1227,7 @@ public class ChannelManager : CommonBase { * [`PaymentParameters::for_keysend`]: crate::routing::router::PaymentParameters::for_keysend */ public Result_ThirtyTwoBytesRetryableSendFailureZ send_spontaneous_payment_with_retry(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, org.ldk.structs.RecipientOnionFields recipient_onion, byte[] payment_id, org.ldk.structs.RouteParameters route_params, org.ldk.structs.Retry retry_strategy) { - long ret = bindings.ChannelManager_send_spontaneous_payment_with_retry(this.ptr, payment_preimage.ptr, recipient_onion == null ? 0 : recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), route_params == null ? 0 : route_params.ptr, retry_strategy.ptr); + long ret = bindings.ChannelManager_send_spontaneous_payment_with_retry(this.ptr, payment_preimage.ptr, recipient_onion.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), route_params.ptr, retry_strategy.ptr); GC.KeepAlive(this); GC.KeepAlive(payment_preimage); GC.KeepAlive(recipient_onion); @@ -588,7 +1249,7 @@ public class ChannelManager : CommonBase { * us to easily discern them from real payments. */ public Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ send_probe(org.ldk.structs.Path path) { - long ret = bindings.ChannelManager_send_probe(this.ptr, path == null ? 0 : path.ptr); + long ret = bindings.ChannelManager_send_probe(this.ptr, path.ptr); GC.KeepAlive(this); GC.KeepAlive(path); if (ret >= 0 && ret <= 4096) { return null; } @@ -633,7 +1294,7 @@ public class ChannelManager : CommonBase { * probes. If `None` is given as `liquidity_limit_multiplier`, it defaults to `3`. */ public Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ send_preflight_probes(org.ldk.structs.RouteParameters route_params, org.ldk.structs.Option_u64Z liquidity_limit_multiplier) { - long ret = bindings.ChannelManager_send_preflight_probes(this.ptr, route_params == null ? 0 : route_params.ptr, liquidity_limit_multiplier.ptr); + long ret = bindings.ChannelManager_send_preflight_probes(this.ptr, route_params.ptr, liquidity_limit_multiplier.ptr); GC.KeepAlive(this); GC.KeepAlive(route_params); GC.KeepAlive(liquidity_limit_multiplier); @@ -676,14 +1337,15 @@ public class ChannelManager : CommonBase { * [`Event::FundingGenerationReady`]: crate::events::Event::FundingGenerationReady * [`Event::ChannelClosed`]: crate::events::Event::ChannelClosed */ - public Result_NoneAPIErrorZ funding_transaction_generated(byte[] temporary_channel_id, byte[] counterparty_node_id, byte[] funding_transaction) { - long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(funding_transaction)); + public Result_NoneAPIErrorZ funding_transaction_generated(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, byte[] funding_transaction) { + long ret = bindings.ChannelManager_funding_transaction_generated(this.ptr, temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(funding_transaction)); GC.KeepAlive(this); GC.KeepAlive(temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(funding_transaction); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(temporary_channel_id); }; return ret_hu_conv; } @@ -699,8 +1361,8 @@ public class ChannelManager : CommonBase { * * If there is an error, all channels in the batch are to be considered closed. */ - public Result_NoneAPIErrorZ batch_funding_transaction_generated(TwoTuple_ThirtyTwoBytesPublicKeyZ[] temporary_channels, byte[] funding_transaction) { - long ret = bindings.ChannelManager_batch_funding_transaction_generated(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(temporary_channels, temporary_channels_conv_35 => temporary_channels_conv_35 != null ? temporary_channels_conv_35.ptr : 0)), InternalUtils.encodeUint8Array(funding_transaction)); + public Result_NoneAPIErrorZ batch_funding_transaction_generated(TwoTuple_ChannelIdPublicKeyZ[] temporary_channels, byte[] funding_transaction) { + long ret = bindings.ChannelManager_batch_funding_transaction_generated(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(temporary_channels, temporary_channels_conv_30 => temporary_channels_conv_30.ptr)), InternalUtils.encodeUint8Array(funding_transaction)); GC.KeepAlive(this); GC.KeepAlive(temporary_channels); GC.KeepAlive(funding_transaction); @@ -733,14 +1395,15 @@ public class ChannelManager : CommonBase { * [`ChannelUnavailable`]: APIError::ChannelUnavailable * [`APIMisuseError`]: APIError::APIMisuseError */ - public Result_NoneAPIErrorZ update_partial_channel_config(byte[] counterparty_node_id, byte[][] channel_ids, org.ldk.structs.ChannelConfigUpdate config_update) { - long ret = bindings.ChannelManager_update_partial_channel_config(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(channel_ids, channel_ids_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_ids_conv_8, 32)))), config_update == null ? 0 : config_update.ptr); + public Result_NoneAPIErrorZ update_partial_channel_config(byte[] counterparty_node_id, ChannelId[] channel_ids, org.ldk.structs.ChannelConfigUpdate config_update) { + long ret = bindings.ChannelManager_update_partial_channel_config(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(channel_ids, channel_ids_conv_11 => channel_ids_conv_11.ptr)), config_update.ptr); GC.KeepAlive(this); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(channel_ids); GC.KeepAlive(config_update); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + foreach (ChannelId channel_ids_conv_11 in channel_ids) { if (this != null) { this.ptrs_to.AddLast(channel_ids_conv_11); }; }; if (this != null) { this.ptrs_to.AddLast(config_update); }; return ret_hu_conv; } @@ -769,14 +1432,15 @@ public class ChannelManager : CommonBase { * [`ChannelUnavailable`]: APIError::ChannelUnavailable * [`APIMisuseError`]: APIError::APIMisuseError */ - public Result_NoneAPIErrorZ update_channel_config(byte[] counterparty_node_id, byte[][] channel_ids, org.ldk.structs.ChannelConfig config) { - long ret = bindings.ChannelManager_update_channel_config(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(channel_ids, channel_ids_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_ids_conv_8, 32)))), config == null ? 0 : config.ptr); + public Result_NoneAPIErrorZ update_channel_config(byte[] counterparty_node_id, ChannelId[] channel_ids, org.ldk.structs.ChannelConfig config) { + long ret = bindings.ChannelManager_update_channel_config(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(channel_ids, channel_ids_conv_11 => channel_ids_conv_11.ptr)), config.ptr); GC.KeepAlive(this); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(channel_ids); GC.KeepAlive(config); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + foreach (ChannelId channel_ids_conv_11 in channel_ids) { if (this != null) { this.ptrs_to.AddLast(channel_ids_conv_11); }; }; if (this != null) { this.ptrs_to.AddLast(config); }; return ret_hu_conv; } @@ -806,8 +1470,8 @@ public class ChannelManager : CommonBase { * [`HTLCIntercepted`]: events::Event::HTLCIntercepted * [`HTLCIntercepted::expected_outbound_amount_msat`]: events::Event::HTLCIntercepted::expected_outbound_amount_msat */ - public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, byte[] next_hop_channel_id, byte[] next_node_id, long amt_to_forward_msat) { - long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(intercept_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_hop_channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_node_id, 33)), amt_to_forward_msat); + public Result_NoneAPIErrorZ forward_intercepted_htlc(byte[] intercept_id, org.ldk.structs.ChannelId next_hop_channel_id, byte[] next_node_id, long amt_to_forward_msat) { + long ret = bindings.ChannelManager_forward_intercepted_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(intercept_id, 32)), next_hop_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_node_id, 33)), amt_to_forward_msat); GC.KeepAlive(this); GC.KeepAlive(intercept_id); GC.KeepAlive(next_hop_channel_id); @@ -815,6 +1479,7 @@ public class ChannelManager : CommonBase { GC.KeepAlive(amt_to_forward_msat); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(next_hop_channel_id); }; return ret_hu_conv; } @@ -988,14 +1653,15 @@ public class ChannelManager : CommonBase { * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id */ - public Result_NoneAPIErrorZ accept_inbound_channel(byte[] temporary_channel_id, byte[] counterparty_node_id, org.ldk.util.UInt128 user_channel_id) { - long ret = bindings.ChannelManager_accept_inbound_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes())); + public Result_NoneAPIErrorZ accept_inbound_channel(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, org.ldk.util.UInt128 user_channel_id) { + long ret = bindings.ChannelManager_accept_inbound_channel(this.ptr, temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes())); GC.KeepAlive(this); GC.KeepAlive(temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(user_channel_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(temporary_channel_id); }; return ret_hu_conv; } @@ -1019,14 +1685,113 @@ public class ChannelManager : CommonBase { * [`Event::OpenChannelRequest`]: events::Event::OpenChannelRequest * [`Event::ChannelClosed::user_channel_id`]: events::Event::ChannelClosed::user_channel_id */ - public Result_NoneAPIErrorZ accept_inbound_channel_from_trusted_peer_0conf(byte[] temporary_channel_id, byte[] counterparty_node_id, org.ldk.util.UInt128 user_channel_id) { - long ret = bindings.ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes())); + public Result_NoneAPIErrorZ accept_inbound_channel_from_trusted_peer_0conf(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, org.ldk.util.UInt128 user_channel_id) { + long ret = bindings.ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(this.ptr, temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes())); GC.KeepAlive(this); GC.KeepAlive(temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(user_channel_id); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneAPIErrorZ ret_hu_conv = Result_NoneAPIErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(temporary_channel_id); }; + return ret_hu_conv; + } + + /** + * Creates an [`OfferBuilder`] such that the [`Offer`] it builds is recognized by the + * [`ChannelManager`] when handling [`InvoiceRequest`] messages for the offer. The offer will + * not have an expiration unless otherwise set on the builder. + * + * # Privacy + * + * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the offer. + * However, if one is not found, uses a one-hop [`BlindedPath`] with + * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case, + * the node must be announced, otherwise, there is no way to find a path to the introduction in + * order to send the [`InvoiceRequest`]. + * + * Also, uses a derived signing pubkey in the offer for recipient privacy. + * + * # Limitations + * + * Requires a direct connection to the introduction node in the responding [`InvoiceRequest`]'s + * reply path. + * + * # Errors + * + * Errors if the parameterized [`Router`] is unable to create a blinded path for the offer. + * + * [`Offer`]: crate::offers::offer::Offer + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ create_offer_builder() { + long ret = bindings.ChannelManager_create_offer_builder(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a [`RefundBuilder`] such that the [`Refund`] it builds is recognized by the + * [`ChannelManager`] when handling [`Bolt12Invoice`] messages for the refund. + * + * # Payment + * + * The provided `payment_id` is used to ensure that only one invoice is paid for the refund. + * See [Avoiding Duplicate Payments] for other requirements once the payment has been sent. + * + * The builder will have the provided expiration set. Any changes to the expiration on the + * returned builder will not be honored by [`ChannelManager`]. For `no-std`, the highest seen + * block time minus two hours is used for the current time when determining if the refund has + * expired. + * + * To revoke the refund, use [`ChannelManager::abandon_payment`] prior to receiving the + * invoice. If abandoned, or an invoice isn't received before expiration, the payment will fail + * with an [`Event::InvoiceRequestFailed`]. + * + * If `max_total_routing_fee_msat` is not specified, The default from + * [`RouteParameters::from_payment_params_and_value`] is applied. + * + * # Privacy + * + * Uses [`MessageRouter::create_blinded_paths`] to construct a [`BlindedPath`] for the refund. + * However, if one is not found, uses a one-hop [`BlindedPath`] with + * [`ChannelManager::get_our_node_id`] as the introduction node instead. In the latter case, + * the node must be announced, otherwise, there is no way to find a path to the introduction in + * order to send the [`Bolt12Invoice`]. + * + * Also, uses a derived payer id in the refund for payer privacy. + * + * # Limitations + * + * Requires a direct connection to an introduction node in the responding + * [`Bolt12Invoice::payment_paths`]. + * + * # Errors + * + * Errors if: + * - a duplicate `payment_id` is provided given the caveats in the aforementioned link, + * - `amount_msats` is invalid, or + * - the parameterized [`Router`] is unable to create a blinded path for the refund. + * + * [`Refund`]: crate::offers::refund::Refund + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`Bolt12Invoice::payment_paths`]: crate::offers::invoice::Bolt12Invoice::payment_paths + * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments + */ + public Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ create_refund_builder(long amount_msats, long absolute_expiry, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat) { + long ret = bindings.ChannelManager_create_refund_builder(this.ptr, amount_msats, absolute_expiry, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), retry_strategy.ptr, max_total_routing_fee_msat.ptr); + GC.KeepAlive(this); + GC.KeepAlive(amount_msats); + GC.KeepAlive(absolute_expiry); + GC.KeepAlive(payment_id); + GC.KeepAlive(retry_strategy); + GC.KeepAlive(max_total_routing_fee_msat); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(retry_strategy); }; + if (this != null) { this.ptrs_to.AddLast(max_total_routing_fee_msat); }; return ret_hu_conv; } @@ -1074,6 +1839,7 @@ public class ChannelManager : CommonBase { * Errors if: * - a duplicate `payment_id` is provided given the caveats in the aforementioned link, * - the provided parameters are invalid for the offer, + * - the offer is for an unsupported chain, or * - the parameterized [`Router`] is unable to create a blinded reply path for the invoice * request. * @@ -1086,7 +1852,7 @@ public class ChannelManager : CommonBase { * [Avoiding Duplicate Payments]: #avoiding-duplicate-payments */ public Result_NoneBolt12SemanticErrorZ pay_for_offer(org.ldk.structs.Offer offer, org.ldk.structs.Option_u64Z quantity, org.ldk.structs.Option_u64Z amount_msats, org.ldk.structs.Option_StrZ payer_note, byte[] payment_id, org.ldk.structs.Retry retry_strategy, org.ldk.structs.Option_u64Z max_total_routing_fee_msat) { - long ret = bindings.ChannelManager_pay_for_offer(this.ptr, offer == null ? 0 : offer.ptr, quantity.ptr, amount_msats.ptr, payer_note.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), retry_strategy.ptr, max_total_routing_fee_msat.ptr); + long ret = bindings.ChannelManager_pay_for_offer(this.ptr, offer.ptr, quantity.ptr, amount_msats.ptr, payer_note.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), retry_strategy.ptr, max_total_routing_fee_msat.ptr); GC.KeepAlive(this); GC.KeepAlive(offer); GC.KeepAlive(quantity); @@ -1112,7 +1878,7 @@ public class ChannelManager : CommonBase { * * The resulting invoice uses a [`PaymentHash`] recognized by the [`ChannelManager`] and a * [`BlindedPath`] containing the [`PaymentSecret`] needed to reconstruct the corresponding - * [`PaymentPreimage`]. + * [`PaymentPreimage`]. It is returned purely for informational purposes. * * # Limitations * @@ -1123,17 +1889,19 @@ public class ChannelManager : CommonBase { * * # Errors * - * Errors if the parameterized [`Router`] is unable to create a blinded payment path or reply - * path for the invoice. + * Errors if: + * - the refund is for an unsupported chain, or + * - the parameterized [`Router`] is unable to create a blinded payment path or reply path for + * the invoice. * * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ - public Result_NoneBolt12SemanticErrorZ request_refund_payment(org.ldk.structs.Refund refund) { - long ret = bindings.ChannelManager_request_refund_payment(this.ptr, refund == null ? 0 : refund.ptr); + public Result_Bolt12InvoiceBolt12SemanticErrorZ request_refund_payment(org.ldk.structs.Refund refund) { + long ret = bindings.ChannelManager_request_refund_payment(this.ptr, refund.ptr); GC.KeepAlive(this); GC.KeepAlive(refund); if (ret >= 0 && ret <= 4096) { return null; } - Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + Result_Bolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_Bolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); if (this != null) { this.ptrs_to.AddLast(refund); }; return ret_hu_conv; } @@ -1145,10 +1913,9 @@ public class ChannelManager : CommonBase { * This differs from [`create_inbound_payment_for_hash`] only in that it generates the * [`PaymentHash`] and [`PaymentPreimage`] for you. * - * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`], which - * will have the [`PaymentClaimable::purpose`] be [`PaymentPurpose::InvoicePayment`] with - * its [`PaymentPurpose::InvoicePayment::payment_preimage`] field filled in. That should then be - * passed directly to [`claim_funds`]. + * The [`PaymentPreimage`] will ultimately be returned to you in the [`PaymentClaimable`] event, which + * will have the [`PaymentClaimable::purpose`] return `Some` for [`PaymentPurpose::preimage`]. That + * should then be passed directly to [`claim_funds`]. * * See [`create_inbound_payment_for_hash`] for detailed documentation on behavior and requirements. * @@ -1168,8 +1935,7 @@ public class ChannelManager : CommonBase { * [`claim_funds`]: Self::claim_funds * [`PaymentClaimable`]: events::Event::PaymentClaimable * [`PaymentClaimable::purpose`]: events::Event::PaymentClaimable::purpose - * [`PaymentPurpose::InvoicePayment`]: events::PaymentPurpose::InvoicePayment - * [`PaymentPurpose::InvoicePayment::payment_preimage`]: events::PaymentPurpose::InvoicePayment::payment_preimage + * [`PaymentPurpose::preimage`]: events::PaymentPurpose::preimage * [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash */ public Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create_inbound_payment(org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { @@ -1389,6 +2155,9 @@ public class ChannelManager : CommonBase { /** * Returns true if this [`ChannelManager`] needs to be persisted. + * + * See [`Self::get_event_or_persistence_needed_future`] for retrieving a [`Future`] that + * indicates this should be checked. */ public bool get_and_clear_needs_persistence() { bool ret = bindings.ChannelManager_get_and_clear_needs_persistence(this.ptr); @@ -1487,6 +2256,19 @@ public class ChannelManager : CommonBase { return ret_hu_conv; } + /** + * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is + */ + public NodeIdLookUp as_NodeIdLookUp() { + long ret = bindings.ChannelManager_as_NodeIdLookUp(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + NodeIdLookUp ret_hu_conv = new NodeIdLookUp(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Serialize the ChannelManager object into a byte array which can be read by ChannelManager_read */ diff --git a/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs b/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs index 624de695..9687cd3c 100644 --- a/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs +++ b/c_sharp/src/org/ldk/structs/ChannelManagerReadArgs.cs @@ -268,7 +268,7 @@ public class ChannelManagerReadArgs : CommonBase { * runtime settings which were stored when the ChannelManager was serialized. */ public void set_default_config(org.ldk.structs.UserConfig val) { - bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelManagerReadArgs_set_default_config(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -280,7 +280,7 @@ public class ChannelManagerReadArgs : CommonBase { * populate a HashMap directly from C. */ public static ChannelManagerReadArgs of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.SignerProvider signer_provider, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Watch chain_monitor, org.ldk.structs.BroadcasterInterface tx_broadcaster, org.ldk.structs.Router router, org.ldk.structs.Logger logger, org.ldk.structs.UserConfig default_config, ChannelMonitor[] channel_monitors) { - long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, default_config == null ? 0 : default_config.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(channel_monitors, channel_monitors_conv_16 => channel_monitors_conv_16 == null ? 0 : channel_monitors_conv_16.ptr))); + long ret = bindings.ChannelManagerReadArgs_new(entropy_source.ptr, node_signer.ptr, signer_provider.ptr, fee_estimator.ptr, chain_monitor.ptr, tx_broadcaster.ptr, router.ptr, logger.ptr, default_config.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(channel_monitors, channel_monitors_conv_16 => channel_monitors_conv_16.ptr))); GC.KeepAlive(entropy_source); GC.KeepAlive(node_signer); GC.KeepAlive(signer_provider); diff --git a/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs b/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs index dcd8c559..44ba3874 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMessageHandler.cs @@ -40,15 +40,6 @@ public interface ChannelMessageHandlerInterface { /**Handle an incoming `stfu` message from the given peer. */ void handle_stfu(byte[] their_node_id, Stfu msg); - /**Handle an incoming `splice` message from the given peer. - */ - void handle_splice(byte[] their_node_id, Splice msg); - /**Handle an incoming `splice_ack` message from the given peer. - */ - void handle_splice_ack(byte[] their_node_id, SpliceAck msg); - /**Handle an incoming `splice_locked` message from the given peer. - */ - void handle_splice_locked(byte[] their_node_id, SpliceLocked msg); /**Handle an incoming `tx_add_input message` from the given peer. */ void handle_tx_add_input(byte[] their_node_id, TxAddInput msg); @@ -219,24 +210,6 @@ public class ChannelMessageHandler : CommonBase { arg.handle_stfu(_their_node_id_conv, _msg_hu_conv); GC.KeepAlive(arg); } - public void handle_splice(long _their_node_id, long _msg) { - byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); - org.ldk.structs.Splice _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.Splice(null, _msg); } - arg.handle_splice(_their_node_id_conv, _msg_hu_conv); - GC.KeepAlive(arg); - } - public void handle_splice_ack(long _their_node_id, long _msg) { - byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); - org.ldk.structs.SpliceAck _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.SpliceAck(null, _msg); } - arg.handle_splice_ack(_their_node_id_conv, _msg_hu_conv); - GC.KeepAlive(arg); - } - public void handle_splice_locked(long _their_node_id, long _msg) { - byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); - org.ldk.structs.SpliceLocked _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.SpliceLocked(null, _msg); } - arg.handle_splice_locked(_their_node_id_conv, _msg_hu_conv); - GC.KeepAlive(arg); - } public void handle_tx_add_input(long _their_node_id, long _msg) { byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); org.ldk.structs.TxAddInput _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.TxAddInput(null, _msg); } @@ -349,7 +322,7 @@ public class ChannelMessageHandler : CommonBase { org.ldk.structs.Init _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.Init(null, _msg); } Result_NoneNoneZ ret = arg.peer_connected(_their_node_id_conv, _msg_hu_conv, _inbound); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public void handle_channel_reestablish(long _their_node_id, long _msg) { @@ -373,20 +346,20 @@ public class ChannelMessageHandler : CommonBase { public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long provided_init_features(long _their_node_id) { byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); InitFeatures ret = arg.provided_init_features(_their_node_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long get_chain_hashes() { Option_CVec_ThirtyTwoBytesZZ ret = arg.get_chain_hashes(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } @@ -410,7 +383,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `open_channel` message from the given peer. */ public void handle_open_channel(byte[] their_node_id, org.ldk.structs.OpenChannel msg) { - bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_open_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -421,7 +394,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `open_channel2` message from the given peer. */ public void handle_open_channel_v2(byte[] their_node_id, org.ldk.structs.OpenChannelV2 msg) { - bindings.ChannelMessageHandler_handle_open_channel_v2(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_open_channel_v2(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -432,7 +405,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `accept_channel` message from the given peer. */ public void handle_accept_channel(byte[] their_node_id, org.ldk.structs.AcceptChannel msg) { - bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_accept_channel(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -443,7 +416,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `accept_channel2` message from the given peer. */ public void handle_accept_channel_v2(byte[] their_node_id, org.ldk.structs.AcceptChannelV2 msg) { - bindings.ChannelMessageHandler_handle_accept_channel_v2(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_accept_channel_v2(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -454,7 +427,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `funding_created` message from the given peer. */ public void handle_funding_created(byte[] their_node_id, org.ldk.structs.FundingCreated msg) { - bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_funding_created(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -465,7 +438,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `funding_signed` message from the given peer. */ public void handle_funding_signed(byte[] their_node_id, org.ldk.structs.FundingSigned msg) { - bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_funding_signed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -476,7 +449,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `channel_ready` message from the given peer. */ public void handle_channel_ready(byte[] their_node_id, org.ldk.structs.ChannelReady msg) { - bindings.ChannelMessageHandler_handle_channel_ready(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_channel_ready(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -487,7 +460,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `shutdown` message from the given peer. */ public void handle_shutdown(byte[] their_node_id, org.ldk.structs.Shutdown msg) { - bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_shutdown(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -498,7 +471,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `closing_signed` message from the given peer. */ public void handle_closing_signed(byte[] their_node_id, org.ldk.structs.ClosingSigned msg) { - bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_closing_signed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -509,40 +482,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `stfu` message from the given peer. */ public void handle_stfu(byte[] their_node_id, org.ldk.structs.Stfu msg) { - bindings.ChannelMessageHandler_handle_stfu(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); - GC.KeepAlive(this); - GC.KeepAlive(their_node_id); - GC.KeepAlive(msg); - if (this != null) { this.ptrs_to.AddLast(msg); }; - } - - /** - * Handle an incoming `splice` message from the given peer. - */ - public void handle_splice(byte[] their_node_id, org.ldk.structs.Splice msg) { - bindings.ChannelMessageHandler_handle_splice(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); - GC.KeepAlive(this); - GC.KeepAlive(their_node_id); - GC.KeepAlive(msg); - if (this != null) { this.ptrs_to.AddLast(msg); }; - } - - /** - * Handle an incoming `splice_ack` message from the given peer. - */ - public void handle_splice_ack(byte[] their_node_id, org.ldk.structs.SpliceAck msg) { - bindings.ChannelMessageHandler_handle_splice_ack(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); - GC.KeepAlive(this); - GC.KeepAlive(their_node_id); - GC.KeepAlive(msg); - if (this != null) { this.ptrs_to.AddLast(msg); }; - } - - /** - * Handle an incoming `splice_locked` message from the given peer. - */ - public void handle_splice_locked(byte[] their_node_id, org.ldk.structs.SpliceLocked msg) { - bindings.ChannelMessageHandler_handle_splice_locked(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_stfu(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -553,7 +493,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_add_input message` from the given peer. */ public void handle_tx_add_input(byte[] their_node_id, org.ldk.structs.TxAddInput msg) { - bindings.ChannelMessageHandler_handle_tx_add_input(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_add_input(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -564,7 +504,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_add_output` message from the given peer. */ public void handle_tx_add_output(byte[] their_node_id, org.ldk.structs.TxAddOutput msg) { - bindings.ChannelMessageHandler_handle_tx_add_output(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_add_output(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -575,7 +515,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_remove_input` message from the given peer. */ public void handle_tx_remove_input(byte[] their_node_id, org.ldk.structs.TxRemoveInput msg) { - bindings.ChannelMessageHandler_handle_tx_remove_input(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_remove_input(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -586,7 +526,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_remove_output` message from the given peer. */ public void handle_tx_remove_output(byte[] their_node_id, org.ldk.structs.TxRemoveOutput msg) { - bindings.ChannelMessageHandler_handle_tx_remove_output(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_remove_output(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -597,7 +537,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_complete message` from the given peer. */ public void handle_tx_complete(byte[] their_node_id, org.ldk.structs.TxComplete msg) { - bindings.ChannelMessageHandler_handle_tx_complete(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_complete(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -608,7 +548,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_signatures` message from the given peer. */ public void handle_tx_signatures(byte[] their_node_id, org.ldk.structs.TxSignatures msg) { - bindings.ChannelMessageHandler_handle_tx_signatures(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_signatures(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -619,7 +559,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_init_rbf` message from the given peer. */ public void handle_tx_init_rbf(byte[] their_node_id, org.ldk.structs.TxInitRbf msg) { - bindings.ChannelMessageHandler_handle_tx_init_rbf(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_init_rbf(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -630,7 +570,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_ack_rbf` message from the given peer. */ public void handle_tx_ack_rbf(byte[] their_node_id, org.ldk.structs.TxAckRbf msg) { - bindings.ChannelMessageHandler_handle_tx_ack_rbf(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_ack_rbf(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -641,7 +581,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `tx_abort message` from the given peer. */ public void handle_tx_abort(byte[] their_node_id, org.ldk.structs.TxAbort msg) { - bindings.ChannelMessageHandler_handle_tx_abort(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_tx_abort(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -652,7 +592,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `update_add_htlc` message from the given peer. */ public void handle_update_add_htlc(byte[] their_node_id, org.ldk.structs.UpdateAddHTLC msg) { - bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_update_add_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -663,7 +603,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `update_fulfill_htlc` message from the given peer. */ public void handle_update_fulfill_htlc(byte[] their_node_id, org.ldk.structs.UpdateFulfillHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_update_fulfill_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -674,7 +614,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `update_fail_htlc` message from the given peer. */ public void handle_update_fail_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_update_fail_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -685,7 +625,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `update_fail_malformed_htlc` message from the given peer. */ public void handle_update_fail_malformed_htlc(byte[] their_node_id, org.ldk.structs.UpdateFailMalformedHTLC msg) { - bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_update_fail_malformed_htlc(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -696,7 +636,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `commitment_signed` message from the given peer. */ public void handle_commitment_signed(byte[] their_node_id, org.ldk.structs.CommitmentSigned msg) { - bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_commitment_signed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -707,7 +647,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `revoke_and_ack` message from the given peer. */ public void handle_revoke_and_ack(byte[] their_node_id, org.ldk.structs.RevokeAndACK msg) { - bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_revoke_and_ack(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -718,7 +658,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `update_fee` message from the given peer. */ public void handle_update_fee(byte[] their_node_id, org.ldk.structs.UpdateFee msg) { - bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_update_fee(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -729,7 +669,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `announcement_signatures` message from the given peer. */ public void handle_announcement_signatures(byte[] their_node_id, org.ldk.structs.AnnouncementSignatures msg) { - bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_announcement_signatures(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -753,7 +693,7 @@ public class ChannelMessageHandler : CommonBase { * message handlers may still wish to communicate with this peer. */ public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init msg, bool inbound) { - long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr, inbound); + long ret = bindings.ChannelMessageHandler_peer_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr, inbound); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -768,7 +708,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `channel_reestablish` message from the given peer. */ public void handle_channel_reestablish(byte[] their_node_id, org.ldk.structs.ChannelReestablish msg) { - bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_channel_reestablish(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -779,7 +719,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `channel_update` message from the given peer. */ public void handle_channel_update(byte[] their_node_id, org.ldk.structs.ChannelUpdate msg) { - bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_channel_update(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -790,7 +730,7 @@ public class ChannelMessageHandler : CommonBase { * Handle an incoming `error` message from the given peer. */ public void handle_error(byte[] their_node_id, org.ldk.structs.ErrorMessage msg) { - bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.ChannelMessageHandler_handle_error(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); diff --git a/c_sharp/src/org/ldk/structs/ChannelMonitor.cs b/c_sharp/src/org/ldk/structs/ChannelMonitor.cs index f16d4fd3..3476e527 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMonitor.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMonitor.cs @@ -61,7 +61,7 @@ public class ChannelMonitor : CommonBase { * panics if the given update is not the next update by update_id. */ public Result_NoneNoneZ update_monitor(org.ldk.structs.ChannelMonitorUpdate updates, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates == null ? 0 : updates.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr); + long ret = bindings.ChannelMonitor_update_monitor(this.ptr, updates.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(updates); GC.KeepAlive(broadcaster); @@ -98,6 +98,18 @@ public class ChannelMonitor : CommonBase { return ret_hu_conv; } + /** + * Gets the channel_id of the channel this ChannelMonitor is monitoring for. + */ + public ChannelId channel_id() { + long ret = bindings.ChannelMonitor_channel_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Gets a list of txids, with their output scripts (in the order they appear in the * transaction), which we must learn about spends of via block_connected(). @@ -222,7 +234,7 @@ public class ChannelMonitor : CommonBase { * [`Persist::update_persisted_channel`]: crate::chain::chainmonitor::Persist::update_persisted_channel */ public CommitmentTransaction[] counterparty_commitment_txs_from_update(org.ldk.structs.ChannelMonitorUpdate update) { - long ret = bindings.ChannelMonitor_counterparty_commitment_txs_from_update(this.ptr, update == null ? 0 : update.ptr); + long ret = bindings.ChannelMonitor_counterparty_commitment_txs_from_update(this.ptr, update.ptr); GC.KeepAlive(this); GC.KeepAlive(update); if (ret >= 0 && ret <= 4096) { return null; } @@ -287,36 +299,25 @@ public class ChannelMonitor : CommonBase { } /** - * Used by [`ChannelManager`] deserialization to broadcast the latest holder state if its copy - * of the channel state was out-of-date. - * - * You may also use this to broadcast the latest local commitment transaction, either because + * You may use this to broadcast the latest local commitment transaction, either because * a monitor update failed or because we've fallen behind (i.e. we've received proof that our * counterparty side knows a revocation secret we gave them that they shouldn't know). * - * Broadcasting these transactions in the second case is UNSAFE, as they allow counterparty + * Broadcasting these transactions in this manner is UNSAFE, as they allow counterparty * side to punish you. Nevertheless you may want to broadcast them if counterparty doesn't * close channel with their commitment transaction after a substantial amount of time. Best * may be to contact the other node operator out-of-band to coordinate other options available * to you. - * - * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ - public byte[][] get_latest_holder_commitment_txn(org.ldk.structs.Logger logger) { - long ret = bindings.ChannelMonitor_get_latest_holder_commitment_txn(this.ptr, logger.ptr); + public void broadcast_latest_holder_commitment_txn(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { + bindings.ChannelMonitor_broadcast_latest_holder_commitment_txn(this.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); + GC.KeepAlive(broadcaster); + GC.KeepAlive(fee_estimator); GC.KeepAlive(logger); - if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_8_len = InternalUtils.getArrayLength(ret); - byte[][] ret_conv_8_arr = new byte[ret_conv_8_len][]; - for (int i = 0; i < ret_conv_8_len; i++) { - long ret_conv_8 = InternalUtils.getU64ArrayElem(ret, i); - byte[] ret_conv_8_conv = InternalUtils.decodeUint8Array(ret_conv_8); - ret_conv_8_arr[i] = ret_conv_8_conv; - } - bindings.free_buffer(ret); + if (this != null) { this.ptrs_to.AddLast(broadcaster); }; + if (this != null) { this.ptrs_to.AddLast(fee_estimator); }; if (this != null) { this.ptrs_to.AddLast(logger); }; - return ret_conv_8_arr; } /** @@ -333,7 +334,7 @@ public class ChannelMonitor : CommonBase { * [`get_outputs_to_watch`]: #method.get_outputs_to_watch */ public TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ[] block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0)), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); + long ret = bindings.ChannelMonitor_block_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28.ptr)), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(txdata); @@ -384,7 +385,7 @@ public class ChannelMonitor : CommonBase { * [`block_connected`]: Self::block_connected */ public TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ[] transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { - long ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0)), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); + long ret = bindings.ChannelMonitor_transactions_confirmed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28.ptr)), height, broadcaster.ptr, fee_estimator.ptr, logger.ptr); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(txdata); @@ -511,6 +512,21 @@ public class ChannelMonitor : CommonBase { if (this != null) { this.ptrs_to.AddLast(logger); }; } + /** + * Triggers rebroadcasts of pending claims from a force-closed channel after a transaction + * signature generation failure. + */ + public void signer_unblocked(org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Logger logger) { + bindings.ChannelMonitor_signer_unblocked(this.ptr, broadcaster.ptr, fee_estimator.ptr, logger.ptr); + GC.KeepAlive(this); + GC.KeepAlive(broadcaster); + GC.KeepAlive(fee_estimator); + GC.KeepAlive(logger); + if (this != null) { this.ptrs_to.AddLast(broadcaster); }; + if (this != null) { this.ptrs_to.AddLast(fee_estimator); }; + if (this != null) { this.ptrs_to.AddLast(logger); }; + } + /** * Returns the descriptors for relevant outputs (i.e., those that we can spend) within the * transaction if they exist and the transaction has at least [`ANTI_REORG_DELAY`] @@ -549,6 +565,21 @@ public class ChannelMonitor : CommonBase { return ret_conv_27_arr; } + /** + * Checks if the monitor is fully resolved. Resolved monitor is one that has claimed all of + * its outputs and balances (i.e. [`Self::get_claimable_balances`] returns an empty set). + * + * This function returns true only if [`Self::get_claimable_balances`] has been empty for at least + * 4032 blocks as an additional protection against any bugs resulting in spuriously empty balance sets. + */ + public bool is_fully_resolved(org.ldk.structs.Logger logger) { + bool ret = bindings.ChannelMonitor_is_fully_resolved(this.ptr, logger.ptr); + GC.KeepAlive(this); + GC.KeepAlive(logger); + if (this != null) { this.ptrs_to.AddLast(logger); }; + return ret; + } + /** * Gets the balances in this channel which are either claimable by us if we were to * force-close the channel now or which are claimable on-chain (possibly awaiting diff --git a/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs index cc3bd5d1..265a3a72 100644 --- a/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelMonitorUpdate.cs @@ -67,6 +67,38 @@ public class ChannelMonitorUpdate : CommonBase { GC.KeepAlive(val); } + /** + * The channel ID associated with these updates. + * + * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and + * always `Some` otherwise. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelId get_channel_id() { + long ret = bindings.ChannelMonitorUpdate_get_channel_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel ID associated with these updates. + * + * Will be `None` for `ChannelMonitorUpdate`s constructed on LDK versions prior to 0.0.121 and + * always `Some` otherwise. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ChannelMonitorUpdate_set_channel_id(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + internal long clone_ptr() { long ret = bindings.ChannelMonitorUpdate_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -91,7 +123,7 @@ public class ChannelMonitorUpdate : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelMonitorUpdate b) { - bool ret = bindings.ChannelMonitorUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelMonitorUpdate_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs b/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs index 43b596e4..c5ca229e 100644 --- a/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs +++ b/c_sharp/src/org/ldk/structs/ChannelPublicKeys.cs @@ -59,7 +59,7 @@ public class ChannelPublicKeys : CommonBase { * states. */ public void set_revocation_basepoint(org.ldk.structs.RevocationBasepoint val) { - bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelPublicKeys_set_revocation_basepoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -109,7 +109,7 @@ public class ChannelPublicKeys : CommonBase { * after some delay (or can be claimed via the revocation path). */ public void set_delayed_payment_basepoint(org.ldk.structs.DelayedPaymentBasepoint val) { - bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelPublicKeys_set_delayed_payment_basepoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -133,7 +133,7 @@ public class ChannelPublicKeys : CommonBase { * which is used to encumber HTLC-in-flight outputs. */ public void set_htlc_basepoint(org.ldk.structs.HtlcBasepoint val) { - bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelPublicKeys_set_htlc_basepoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -143,7 +143,7 @@ public class ChannelPublicKeys : CommonBase { * Constructs a new ChannelPublicKeys given each field */ public static ChannelPublicKeys of(byte[] funding_pubkey_arg, org.ldk.structs.RevocationBasepoint revocation_basepoint_arg, byte[] payment_point_arg, org.ldk.structs.DelayedPaymentBasepoint delayed_payment_basepoint_arg, org.ldk.structs.HtlcBasepoint htlc_basepoint_arg) { - long ret = bindings.ChannelPublicKeys_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), revocation_basepoint_arg == null ? 0 : revocation_basepoint_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_point_arg, 33)), delayed_payment_basepoint_arg == null ? 0 : delayed_payment_basepoint_arg.ptr, htlc_basepoint_arg == null ? 0 : htlc_basepoint_arg.ptr); + long ret = bindings.ChannelPublicKeys_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), revocation_basepoint_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_point_arg, 33)), delayed_payment_basepoint_arg.ptr, htlc_basepoint_arg.ptr); GC.KeepAlive(funding_pubkey_arg); GC.KeepAlive(revocation_basepoint_arg); GC.KeepAlive(payment_point_arg); @@ -194,7 +194,7 @@ public class ChannelPublicKeys : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelPublicKeys b) { - bool ret = bindings.ChannelPublicKeys_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelPublicKeys_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelReady.cs b/c_sharp/src/org/ldk/structs/ChannelReady.cs index 358001a7..58f84613 100644 --- a/c_sharp/src/org/ldk/structs/ChannelReady.cs +++ b/c_sharp/src/org/ldk/structs/ChannelReady.cs @@ -20,21 +20,23 @@ public class ChannelReady : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.ChannelReady_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.ChannelReady_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ChannelReady_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -88,14 +90,15 @@ public class ChannelReady : CommonBase { /** * Constructs a new ChannelReady given each field */ - public static ChannelReady of(byte[] channel_id_arg, byte[] next_per_commitment_point_arg, org.ldk.structs.Option_u64Z short_channel_id_alias_arg) { - long ret = bindings.ChannelReady_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_per_commitment_point_arg, 33)), short_channel_id_alias_arg.ptr); + public static ChannelReady of(org.ldk.structs.ChannelId channel_id_arg, byte[] next_per_commitment_point_arg, org.ldk.structs.Option_u64Z short_channel_id_alias_arg) { + long ret = bindings.ChannelReady_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_per_commitment_point_arg, 33)), short_channel_id_alias_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(next_per_commitment_point_arg); GC.KeepAlive(short_channel_id_alias_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelReady ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReady(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(short_channel_id_alias_arg); }; return ret_hu_conv; } @@ -136,7 +139,7 @@ public class ChannelReady : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelReady b) { - bool ret = bindings.ChannelReady_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelReady_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelReestablish.cs b/c_sharp/src/org/ldk/structs/ChannelReestablish.cs index 5d3bd223..eafbfed2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelReestablish.cs +++ b/c_sharp/src/org/ldk/structs/ChannelReestablish.cs @@ -20,21 +20,23 @@ public class ChannelReestablish : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.ChannelReestablish_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.ChannelReestablish_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ChannelReestablish_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -140,8 +142,8 @@ public class ChannelReestablish : CommonBase { /** * Constructs a new ChannelReestablish given each field */ - public static ChannelReestablish of(byte[] channel_id_arg, long next_local_commitment_number_arg, long next_remote_commitment_number_arg, byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg, org.ldk.structs.Option_ThirtyTwoBytesZ next_funding_txid_arg) { - long ret = bindings.ChannelReestablish_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), next_local_commitment_number_arg, next_remote_commitment_number_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33)), next_funding_txid_arg.ptr); + public static ChannelReestablish of(org.ldk.structs.ChannelId channel_id_arg, long next_local_commitment_number_arg, long next_remote_commitment_number_arg, byte[] your_last_per_commitment_secret_arg, byte[] my_current_per_commitment_point_arg, org.ldk.structs.Option_ThirtyTwoBytesZ next_funding_txid_arg) { + long ret = bindings.ChannelReestablish_new(channel_id_arg.ptr, next_local_commitment_number_arg, next_remote_commitment_number_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(your_last_per_commitment_secret_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(my_current_per_commitment_point_arg, 33)), next_funding_txid_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(next_local_commitment_number_arg); GC.KeepAlive(next_remote_commitment_number_arg); @@ -151,6 +153,7 @@ public class ChannelReestablish : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ChannelReestablish ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelReestablish(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(next_funding_txid_arg); }; return ret_hu_conv; } @@ -191,7 +194,7 @@ public class ChannelReestablish : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelReestablish b) { - bool ret = bindings.ChannelReestablish_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelReestablish_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelSigner.cs b/c_sharp/src/org/ldk/structs/ChannelSigner.cs index 66e4cd68..1be5e84b 100644 --- a/c_sharp/src/org/ldk/structs/ChannelSigner.cs +++ b/c_sharp/src/org/ldk/structs/ChannelSigner.cs @@ -106,14 +106,14 @@ public class ChannelSigner : CommonBase { bindings.free_buffer(_outbound_htlc_preimages); Result_NoneNoneZ ret = arg.validate_holder_commitment(_holder_tx_hu_conv, _outbound_htlc_preimages_conv_8_arr); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long validate_counterparty_revocation(long _idx, long _secret) { byte[] _secret_conv = InternalUtils.decodeUint8Array(_secret); Result_NoneNoneZ ret = arg.validate_counterparty_revocation(_idx, _secret_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long channel_keys_id() { @@ -133,7 +133,7 @@ public class ChannelSigner : CommonBase { public static ChannelSigner new_impl(ChannelSignerInterface arg, ChannelPublicKeys pubkeys) { LDKChannelSignerHolder impl_holder = new LDKChannelSignerHolder(); LDKChannelSignerImpl impl = new LDKChannelSignerImpl(arg, impl_holder); - long[] ptr_idx = bindings.LDKChannelSigner_new(impl, pubkeys == null ? 0 : pubkeys.clone_ptr()); + long[] ptr_idx = bindings.LDKChannelSigner_new(impl, pubkeys.clone_ptr()); impl_holder.held = new ChannelSigner(null, ptr_idx[0]); impl_holder.held.instance_idx = ptr_idx[1]; @@ -190,7 +190,7 @@ public class ChannelSigner : CommonBase { * irrelevant or duplicate preimages. */ public Result_NoneNoneZ validate_holder_commitment(org.ldk.structs.HolderCommitmentTransaction holder_tx, byte[][] outbound_htlc_preimages) { - long ret = bindings.ChannelSigner_validate_holder_commitment(this.ptr, holder_tx == null ? 0 : holder_tx.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(outbound_htlc_preimages, outbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32))))); + long ret = bindings.ChannelSigner_validate_holder_commitment(this.ptr, holder_tx.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(outbound_htlc_preimages, outbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32))))); GC.KeepAlive(this); GC.KeepAlive(holder_tx); GC.KeepAlive(outbound_htlc_preimages); @@ -241,7 +241,7 @@ public class ChannelSigner : CommonBase { * channel_parameters.is_populated() MUST be true. */ public void provide_channel_parameters(org.ldk.structs.ChannelTransactionParameters channel_parameters) { - bindings.ChannelSigner_provide_channel_parameters(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr); + bindings.ChannelSigner_provide_channel_parameters(this.ptr, channel_parameters.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_parameters); if (this != null) { this.ptrs_to.AddLast(channel_parameters); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs index 974dfe6b..a411cec1 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTransactionParameters.cs @@ -35,7 +35,7 @@ public class ChannelTransactionParameters : CommonBase { * Holder public keys */ public void set_holder_pubkeys(org.ldk.structs.ChannelPublicKeys val) { - bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelTransactionParameters_set_holder_pubkeys(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -151,7 +151,7 @@ public class ChannelTransactionParameters : CommonBase { * wasn't serialized, it will default to static_remote_key at deserialization. */ public void set_channel_type_features(org.ldk.structs.ChannelTypeFeatures val) { - bindings.ChannelTransactionParameters_set_channel_type_features(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelTransactionParameters_set_channel_type_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -164,7 +164,7 @@ public class ChannelTransactionParameters : CommonBase { * Note that funding_outpoint_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static ChannelTransactionParameters of(org.ldk.structs.ChannelPublicKeys holder_pubkeys_arg, short holder_selected_contest_delay_arg, bool is_outbound_from_holder_arg, org.ldk.structs.CounterpartyChannelTransactionParameters counterparty_parameters_arg, org.ldk.structs.OutPoint funding_outpoint_arg, org.ldk.structs.ChannelTypeFeatures channel_type_features_arg) { - long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg == null ? 0 : holder_pubkeys_arg.ptr, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr, channel_type_features_arg == null ? 0 : channel_type_features_arg.ptr); + long ret = bindings.ChannelTransactionParameters_new(holder_pubkeys_arg.ptr, holder_selected_contest_delay_arg, is_outbound_from_holder_arg, counterparty_parameters_arg == null ? 0 : counterparty_parameters_arg.ptr, funding_outpoint_arg == null ? 0 : funding_outpoint_arg.ptr, channel_type_features_arg.ptr); GC.KeepAlive(holder_pubkeys_arg); GC.KeepAlive(holder_selected_contest_delay_arg); GC.KeepAlive(is_outbound_from_holder_arg); @@ -217,7 +217,7 @@ public class ChannelTransactionParameters : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelTransactionParameters b) { - bool ret = bindings.ChannelTransactionParameters_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelTransactionParameters_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs index 4bd502d5..908c3f16 100644 --- a/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/ChannelTypeFeatures.cs @@ -30,7 +30,7 @@ public class ChannelTypeFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelTypeFeatures b) { - bool ret = bindings.ChannelTypeFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelTypeFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -86,7 +86,7 @@ public class ChannelTypeFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.ChannelTypeFeatures other) { - bool ret = bindings.ChannelTypeFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.ChannelTypeFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelUpdate.cs b/c_sharp/src/org/ldk/structs/ChannelUpdate.cs index 8d47ee1c..4a47de09 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUpdate.cs @@ -53,7 +53,7 @@ public class ChannelUpdate : CommonBase { * The actual channel update */ public void set_contents(org.ldk.structs.UnsignedChannelUpdate val) { - bindings.ChannelUpdate_set_contents(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelUpdate_set_contents(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -63,7 +63,7 @@ public class ChannelUpdate : CommonBase { * Constructs a new ChannelUpdate given each field */ public static ChannelUpdate of(byte[] signature_arg, org.ldk.structs.UnsignedChannelUpdate contents_arg) { - long ret = bindings.ChannelUpdate_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), contents_arg == null ? 0 : contents_arg.ptr); + long ret = bindings.ChannelUpdate_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), contents_arg.ptr); GC.KeepAlive(signature_arg); GC.KeepAlive(contents_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -109,7 +109,7 @@ public class ChannelUpdate : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelUpdate b) { - bool ret = bindings.ChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelUpdate_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs b/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs index 164682b0..604865b2 100644 --- a/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs +++ b/c_sharp/src/org/ldk/structs/ChannelUpdateInfo.cs @@ -123,7 +123,7 @@ public class ChannelUpdateInfo : CommonBase { * Fees charged when the channel is used for routing */ public void set_fees(org.ldk.structs.RoutingFees val) { - bindings.ChannelUpdateInfo_set_fees(this.ptr, val == null ? 0 : val.ptr); + bindings.ChannelUpdateInfo_set_fees(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -167,7 +167,7 @@ public class ChannelUpdateInfo : CommonBase { * Note that last_update_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static ChannelUpdateInfo of(int last_update_arg, bool enabled_arg, short cltv_expiry_delta_arg, long htlc_minimum_msat_arg, long htlc_maximum_msat_arg, org.ldk.structs.RoutingFees fees_arg, org.ldk.structs.ChannelUpdate last_update_message_arg) { - long ret = bindings.ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg == null ? 0 : fees_arg.ptr, last_update_message_arg == null ? 0 : last_update_message_arg.ptr); + long ret = bindings.ChannelUpdateInfo_new(last_update_arg, enabled_arg, cltv_expiry_delta_arg, htlc_minimum_msat_arg, htlc_maximum_msat_arg, fees_arg.ptr, last_update_message_arg == null ? 0 : last_update_message_arg.ptr); GC.KeepAlive(last_update_arg); GC.KeepAlive(enabled_arg); GC.KeepAlive(cltv_expiry_delta_arg); @@ -207,7 +207,7 @@ public class ChannelUpdateInfo : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ChannelUpdateInfo b) { - bool ret = bindings.ChannelUpdateInfo_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ChannelUpdateInfo_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs b/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs index 0b64dad1..890d3e47 100644 --- a/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs +++ b/c_sharp/src/org/ldk/structs/ClaimedHTLC.cs @@ -18,21 +18,23 @@ public class ClaimedHTLC : CommonBase { /** * The `channel_id` of the channel over which the HTLC was received. */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.ClaimedHTLC_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The `channel_id` of the channel over which the HTLC was received. */ - public void set_channel_id(byte[] val) { - bindings.ClaimedHTLC_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ClaimedHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -142,8 +144,8 @@ public class ClaimedHTLC : CommonBase { /** * Constructs a new ClaimedHTLC given each field */ - public static ClaimedHTLC of(byte[] channel_id_arg, org.ldk.util.UInt128 user_channel_id_arg, int cltv_expiry_arg, long value_msat_arg, long counterparty_skimmed_fee_msat_arg) { - long ret = bindings.ClaimedHTLC_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(user_channel_id_arg.getLEBytes()), cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); + public static ClaimedHTLC of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.util.UInt128 user_channel_id_arg, int cltv_expiry_arg, long value_msat_arg, long counterparty_skimmed_fee_msat_arg) { + long ret = bindings.ClaimedHTLC_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(user_channel_id_arg.getLEBytes()), cltv_expiry_arg, value_msat_arg, counterparty_skimmed_fee_msat_arg); GC.KeepAlive(channel_id_arg); GC.KeepAlive(user_channel_id_arg); GC.KeepAlive(cltv_expiry_arg); @@ -152,6 +154,7 @@ public class ClaimedHTLC : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClaimedHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClaimedHTLC(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -179,7 +182,7 @@ public class ClaimedHTLC : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ClaimedHTLC b) { - bool ret = bindings.ClaimedHTLC_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ClaimedHTLC_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ClosingSigned.cs b/c_sharp/src/org/ldk/structs/ClosingSigned.cs index 08f6cac9..9f47f3db 100644 --- a/c_sharp/src/org/ldk/structs/ClosingSigned.cs +++ b/c_sharp/src/org/ldk/structs/ClosingSigned.cs @@ -20,21 +20,23 @@ public class ClosingSigned : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.ClosingSigned_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.ClosingSigned_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ClosingSigned_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -108,8 +110,8 @@ public class ClosingSigned : CommonBase { * * Note that fee_range_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static ClosingSigned of(byte[] channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, org.ldk.structs.ClosingSignedFeeRange fee_range_arg) { - long ret = bindings.ClosingSigned_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), fee_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), fee_range_arg == null ? 0 : fee_range_arg.ptr); + public static ClosingSigned of(org.ldk.structs.ChannelId channel_id_arg, long fee_satoshis_arg, byte[] signature_arg, org.ldk.structs.ClosingSignedFeeRange fee_range_arg) { + long ret = bindings.ClosingSigned_new(channel_id_arg.ptr, fee_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), fee_range_arg == null ? 0 : fee_range_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(fee_satoshis_arg); GC.KeepAlive(signature_arg); @@ -117,6 +119,7 @@ public class ClosingSigned : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ClosingSigned(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_range_arg); }; return ret_hu_conv; } @@ -157,7 +160,7 @@ public class ClosingSigned : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ClosingSigned b) { - bool ret = bindings.ClosingSigned_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ClosingSigned_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs b/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs index 72f5aee8..9d6098d9 100644 --- a/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs +++ b/c_sharp/src/org/ldk/structs/ClosingSignedFeeRange.cs @@ -107,7 +107,7 @@ public class ClosingSignedFeeRange : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ClosingSignedFeeRange b) { - bool ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ClosingSignedFeeRange_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs index c6f33357..c30ec343 100644 --- a/c_sharp/src/org/ldk/structs/ClosingTransaction.cs +++ b/c_sharp/src/org/ldk/structs/ClosingTransaction.cs @@ -55,7 +55,7 @@ public class ClosingTransaction : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ClosingTransaction b) { - bool ret = bindings.ClosingTransaction_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ClosingTransaction_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -70,7 +70,7 @@ public class ClosingTransaction : CommonBase { * Construct an object of the class */ public static ClosingTransaction of(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, org.ldk.structs.OutPoint funding_outpoint) { - long ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, InternalUtils.encodeUint8Array(to_holder_script), InternalUtils.encodeUint8Array(to_counterparty_script), funding_outpoint == null ? 0 : funding_outpoint.ptr); + long ret = bindings.ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, InternalUtils.encodeUint8Array(to_holder_script), InternalUtils.encodeUint8Array(to_counterparty_script), funding_outpoint.ptr); GC.KeepAlive(to_holder_value_sat); GC.KeepAlive(to_counterparty_value_sat); GC.KeepAlive(to_holder_script); @@ -109,7 +109,7 @@ public class ClosingTransaction : CommonBase { * or using the built transaction. */ public Result_TrustedClosingTransactionNoneZ verify(org.ldk.structs.OutPoint funding_outpoint) { - long ret = bindings.ClosingTransaction_verify(this.ptr, funding_outpoint == null ? 0 : funding_outpoint.ptr); + long ret = bindings.ClosingTransaction_verify(this.ptr, funding_outpoint.ptr); GC.KeepAlive(this); GC.KeepAlive(funding_outpoint); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/ClosureReason.cs b/c_sharp/src/org/ldk/structs/ClosureReason.cs index 87a3088f..6bf19ab1 100644 --- a/c_sharp/src/org/ldk/structs/ClosureReason.cs +++ b/c_sharp/src/org/ldk/structs/ClosureReason.cs @@ -19,14 +19,17 @@ public class ClosureReason : CommonBase { switch (raw_ty) { case 0: return new ClosureReason_CounterpartyForceClosed(ptr); case 1: return new ClosureReason_HolderForceClosed(ptr); - case 2: return new ClosureReason_CooperativeClosure(ptr); - case 3: return new ClosureReason_CommitmentTxConfirmed(ptr); - case 4: return new ClosureReason_FundingTimedOut(ptr); - case 5: return new ClosureReason_ProcessingError(ptr); - case 6: return new ClosureReason_DisconnectedPeer(ptr); - case 7: return new ClosureReason_OutdatedChannelManager(ptr); - case 8: return new ClosureReason_CounterpartyCoopClosedUnfundedChannel(ptr); - case 9: return new ClosureReason_FundingBatchClosure(ptr); + case 2: return new ClosureReason_LegacyCooperativeClosure(ptr); + case 3: return new ClosureReason_CounterpartyInitiatedCooperativeClosure(ptr); + case 4: return new ClosureReason_LocallyInitiatedCooperativeClosure(ptr); + case 5: return new ClosureReason_CommitmentTxConfirmed(ptr); + case 6: return new ClosureReason_FundingTimedOut(ptr); + case 7: return new ClosureReason_ProcessingError(ptr); + case 8: return new ClosureReason_DisconnectedPeer(ptr); + case 9: return new ClosureReason_OutdatedChannelManager(ptr); + case 10: return new ClosureReason_CounterpartyCoopClosedUnfundedChannel(ptr); + case 11: return new ClosureReason_FundingBatchClosure(ptr); + case 12: return new ClosureReason_HTLCsTimedOut(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -56,9 +59,19 @@ public class ClosureReason : CommonBase { internal ClosureReason_HolderForceClosed(long ptr) : base(null, ptr) { } } - /** A ClosureReason of type CooperativeClosure */ - public class ClosureReason_CooperativeClosure : ClosureReason { - internal ClosureReason_CooperativeClosure(long ptr) : base(null, ptr) { + /** A ClosureReason of type LegacyCooperativeClosure */ + public class ClosureReason_LegacyCooperativeClosure : ClosureReason { + internal ClosureReason_LegacyCooperativeClosure(long ptr) : base(null, ptr) { + } + } + /** A ClosureReason of type CounterpartyInitiatedCooperativeClosure */ + public class ClosureReason_CounterpartyInitiatedCooperativeClosure : ClosureReason { + internal ClosureReason_CounterpartyInitiatedCooperativeClosure(long ptr) : base(null, ptr) { + } + } + /** A ClosureReason of type LocallyInitiatedCooperativeClosure */ + public class ClosureReason_LocallyInitiatedCooperativeClosure : ClosureReason { + internal ClosureReason_LocallyInitiatedCooperativeClosure(long ptr) : base(null, ptr) { } } /** A ClosureReason of type CommitmentTxConfirmed */ @@ -103,6 +116,11 @@ public class ClosureReason : CommonBase { internal ClosureReason_FundingBatchClosure(long ptr) : base(null, ptr) { } } + /** A ClosureReason of type HTLCsTimedOut */ + public class ClosureReason_HTLCsTimedOut : ClosureReason { + internal ClosureReason_HTLCsTimedOut(long ptr) : base(null, ptr) { + } + } internal long clone_ptr() { long ret = bindings.ClosureReason_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -125,7 +143,7 @@ public class ClosureReason : CommonBase { * Utility method to constructs a new CounterpartyForceClosed-variant ClosureReason */ public static ClosureReason counterparty_force_closed(org.ldk.structs.UntrustedString peer_msg) { - long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg == null ? 0 : peer_msg.ptr); + long ret = bindings.ClosureReason_counterparty_force_closed(peer_msg.ptr); GC.KeepAlive(peer_msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); @@ -146,10 +164,32 @@ public class ClosureReason : CommonBase { } /** - * Utility method to constructs a new CooperativeClosure-variant ClosureReason + * Utility method to constructs a new LegacyCooperativeClosure-variant ClosureReason + */ + public static ClosureReason legacy_cooperative_closure() { + long ret = bindings.ClosureReason_legacy_cooperative_closure(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new CounterpartyInitiatedCooperativeClosure-variant ClosureReason + */ + public static ClosureReason counterparty_initiated_cooperative_closure() { + long ret = bindings.ClosureReason_counterparty_initiated_cooperative_closure(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new LocallyInitiatedCooperativeClosure-variant ClosureReason */ - public static ClosureReason cooperative_closure() { - long ret = bindings.ClosureReason_cooperative_closure(); + public static ClosureReason locally_initiated_cooperative_closure() { + long ret = bindings.ClosureReason_locally_initiated_cooperative_closure(); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; @@ -234,12 +274,23 @@ public class ClosureReason : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HTLCsTimedOut-variant ClosureReason + */ + public static ClosureReason htlcs_timed_out() { + long ret = bindings.ClosureReason_htlcs_timed_out(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ClosureReason ret_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Checks if two ClosureReasons contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.ClosureReason b) { - bool ret = bindings.ClosureReason_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ClosureReason_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/CoinSelection.cs b/c_sharp/src/org/ldk/structs/CoinSelection.cs index 2db0813c..d136e2e6 100644 --- a/c_sharp/src/org/ldk/structs/CoinSelection.cs +++ b/c_sharp/src/org/ldk/structs/CoinSelection.cs @@ -41,7 +41,7 @@ public class CoinSelection : CommonBase { * requiring additional fees. */ public void set_confirmed_utxos(Utxo[] val) { - bindings.CoinSelection_set_confirmed_utxos(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_6 => val_conv_6 == null ? 0 : val_conv_6.ptr))); + bindings.CoinSelection_set_confirmed_utxos(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_6 => val_conv_6.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (Utxo val_conv_6 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_6); }; }; @@ -79,7 +79,7 @@ public class CoinSelection : CommonBase { * Constructs a new CoinSelection given each field */ public static CoinSelection of(Utxo[] confirmed_utxos_arg, org.ldk.structs.Option_TxOutZ change_output_arg) { - long ret = bindings.CoinSelection_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(confirmed_utxos_arg, confirmed_utxos_arg_conv_6 => confirmed_utxos_arg_conv_6 == null ? 0 : confirmed_utxos_arg_conv_6.ptr)), change_output_arg.ptr); + long ret = bindings.CoinSelection_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(confirmed_utxos_arg, confirmed_utxos_arg_conv_6 => confirmed_utxos_arg_conv_6.ptr)), change_output_arg.ptr); GC.KeepAlive(confirmed_utxos_arg); GC.KeepAlive(change_output_arg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs b/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs index 0e7a74b0..4ac1715b 100644 --- a/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs +++ b/c_sharp/src/org/ldk/structs/CoinSelectionSource.cs @@ -88,14 +88,14 @@ public class CoinSelectionSource : CommonBase { bindings.free_buffer(_must_pay_to); Result_CoinSelectionNoneZ ret = arg.select_confirmed_utxos(_claim_id_conv, _must_spend_conv_7_arr, _must_pay_to_conv_7_arr, _target_feerate_sat_per_1000_weight); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_psbt(long _psbt) { byte[] _psbt_conv = InternalUtils.decodeUint8Array(_psbt); Result_TransactionNoneZ ret = arg.sign_psbt(_psbt_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -141,7 +141,7 @@ public class CoinSelectionSource : CommonBase { * set of other claims being double spent to a minimum. */ public Result_CoinSelectionNoneZ select_confirmed_utxos(byte[] claim_id, Input[] must_spend, TxOut[] must_pay_to, int target_feerate_sat_per_1000_weight) { - long ret = bindings.CoinSelectionSource_select_confirmed_utxos(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(claim_id, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(must_spend, must_spend_conv_7 => must_spend_conv_7 == null ? 0 : must_spend_conv_7.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(must_pay_to, must_pay_to_conv_7 => must_pay_to_conv_7.ptr)), target_feerate_sat_per_1000_weight); + long ret = bindings.CoinSelectionSource_select_confirmed_utxos(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(claim_id, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(must_spend, must_spend_conv_7 => must_spend_conv_7.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(must_pay_to, must_pay_to_conv_7 => must_pay_to_conv_7.ptr)), target_feerate_sat_per_1000_weight); GC.KeepAlive(this); GC.KeepAlive(claim_id); GC.KeepAlive(must_spend); diff --git a/c_sharp/src/org/ldk/structs/CommitmentSigned.cs b/c_sharp/src/org/ldk/structs/CommitmentSigned.cs index 6b21710a..34124aad 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentSigned.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentSigned.cs @@ -20,21 +20,23 @@ public class CommitmentSigned : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.CommitmentSigned_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.CommitmentSigned_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.CommitmentSigned_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -89,14 +91,15 @@ public class CommitmentSigned : CommonBase { /** * Constructs a new CommitmentSigned given each field */ - public static CommitmentSigned of(byte[] channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { - long ret = bindings.CommitmentSigned_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlc_signatures_arg, htlc_signatures_arg_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64))))); + public static CommitmentSigned of(org.ldk.structs.ChannelId channel_id_arg, byte[] signature_arg, byte[][] htlc_signatures_arg) { + long ret = bindings.CommitmentSigned_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlc_signatures_arg, htlc_signatures_arg_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_signatures_arg_conv_8, 64))))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(signature_arg); GC.KeepAlive(htlc_signatures_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.CommitmentSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommitmentSigned(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -136,7 +139,7 @@ public class CommitmentSigned : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.CommitmentSigned b) { - bool ret = bindings.CommitmentSigned_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.CommitmentSigned_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs index b3bcf613..c9f71e22 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentTransaction.cs @@ -133,7 +133,7 @@ public class CommitmentTransaction : CommonBase { * or using the built transaction. */ public Result_TrustedCommitmentTransactionNoneZ verify(org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.ChannelPublicKeys broadcaster_keys, org.ldk.structs.ChannelPublicKeys countersignatory_keys) { - long ret = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters == null ? 0 : channel_parameters.ptr, broadcaster_keys == null ? 0 : broadcaster_keys.ptr, countersignatory_keys == null ? 0 : countersignatory_keys.ptr); + long ret = bindings.CommitmentTransaction_verify(this.ptr, channel_parameters.ptr, broadcaster_keys.ptr, countersignatory_keys.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_parameters); GC.KeepAlive(broadcaster_keys); diff --git a/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs b/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs index d14ed22a..4eed1ff6 100644 --- a/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs +++ b/c_sharp/src/org/ldk/structs/CommitmentUpdate.cs @@ -39,7 +39,7 @@ public class CommitmentUpdate : CommonBase { * `update_add_htlc` messages which should be sent */ public void set_update_add_htlcs(UpdateAddHTLC[] val) { - bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_15 => val_conv_15 == null ? 0 : val_conv_15.ptr))); + bindings.CommitmentUpdate_set_update_add_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_15 => val_conv_15.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (UpdateAddHTLC val_conv_15 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_15); }; }; @@ -68,7 +68,7 @@ public class CommitmentUpdate : CommonBase { * `update_fulfill_htlc` messages which should be sent */ public void set_update_fulfill_htlcs(UpdateFulfillHTLC[] val) { - bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_19 => val_conv_19 == null ? 0 : val_conv_19.ptr))); + bindings.CommitmentUpdate_set_update_fulfill_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_19 => val_conv_19.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (UpdateFulfillHTLC val_conv_19 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_19); }; }; @@ -97,7 +97,7 @@ public class CommitmentUpdate : CommonBase { * `update_fail_htlc` messages which should be sent */ public void set_update_fail_htlcs(UpdateFailHTLC[] val) { - bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_16 => val_conv_16 == null ? 0 : val_conv_16.ptr))); + bindings.CommitmentUpdate_set_update_fail_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_16 => val_conv_16.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (UpdateFailHTLC val_conv_16 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_16); }; }; @@ -126,7 +126,7 @@ public class CommitmentUpdate : CommonBase { * `update_fail_malformed_htlc` messages which should be sent */ public void set_update_fail_malformed_htlcs(UpdateFailMalformedHTLC[] val) { - bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_25 => val_conv_25 == null ? 0 : val_conv_25.ptr))); + bindings.CommitmentUpdate_set_update_fail_malformed_htlcs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_25 => val_conv_25.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (UpdateFailMalformedHTLC val_conv_25 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_25); }; }; @@ -174,7 +174,7 @@ public class CommitmentUpdate : CommonBase { * A `commitment_signed` message which should be sent */ public void set_commitment_signed(org.ldk.structs.CommitmentSigned val) { - bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val == null ? 0 : val.ptr); + bindings.CommitmentUpdate_set_commitment_signed(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -186,7 +186,7 @@ public class CommitmentUpdate : CommonBase { * Note that update_fee_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static CommitmentUpdate of(UpdateAddHTLC[] update_add_htlcs_arg, UpdateFulfillHTLC[] update_fulfill_htlcs_arg, UpdateFailHTLC[] update_fail_htlcs_arg, UpdateFailMalformedHTLC[] update_fail_malformed_htlcs_arg, org.ldk.structs.UpdateFee update_fee_arg, org.ldk.structs.CommitmentSigned commitment_signed_arg) { - long ret = bindings.CommitmentUpdate_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_add_htlcs_arg, update_add_htlcs_arg_conv_15 => update_add_htlcs_arg_conv_15 == null ? 0 : update_add_htlcs_arg_conv_15.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_conv_19 => update_fulfill_htlcs_arg_conv_19 == null ? 0 : update_fulfill_htlcs_arg_conv_19.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_fail_htlcs_arg, update_fail_htlcs_arg_conv_16 => update_fail_htlcs_arg_conv_16 == null ? 0 : update_fail_htlcs_arg_conv_16.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_conv_25 => update_fail_malformed_htlcs_arg_conv_25 == null ? 0 : update_fail_malformed_htlcs_arg_conv_25.ptr)), update_fee_arg == null ? 0 : update_fee_arg.ptr, commitment_signed_arg == null ? 0 : commitment_signed_arg.ptr); + long ret = bindings.CommitmentUpdate_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_add_htlcs_arg, update_add_htlcs_arg_conv_15 => update_add_htlcs_arg_conv_15.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_fulfill_htlcs_arg, update_fulfill_htlcs_arg_conv_19 => update_fulfill_htlcs_arg_conv_19.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_fail_htlcs_arg, update_fail_htlcs_arg_conv_16 => update_fail_htlcs_arg_conv_16.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(update_fail_malformed_htlcs_arg, update_fail_malformed_htlcs_arg_conv_25 => update_fail_malformed_htlcs_arg_conv_25.ptr)), update_fee_arg == null ? 0 : update_fee_arg.ptr, commitment_signed_arg.ptr); GC.KeepAlive(update_add_htlcs_arg); GC.KeepAlive(update_fulfill_htlcs_arg); GC.KeepAlive(update_fail_htlcs_arg); @@ -241,7 +241,7 @@ public class CommitmentUpdate : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.CommitmentUpdate b) { - bool ret = bindings.CommitmentUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.CommitmentUpdate_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs b/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs new file mode 100644 index 00000000..5c0a34d9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/CommonAcceptChannelFields.cs @@ -0,0 +1,415 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Contains fields that are both common to [`accept_channel`] and `accept_channel2` messages. + * + * [`accept_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-accept_channel-message + */ +public class CommonAcceptChannelFields : CommonBase { + internal CommonAcceptChannelFields(object _dummy, long ptr) : base(ptr) { } + ~CommonAcceptChannelFields() { + if (ptr != 0) { bindings.CommonAcceptChannelFields_free(ptr); } + } + + /** + * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message. + */ + public ChannelId get_temporary_channel_id() { + long ret = bindings.CommonAcceptChannelFields_get_temporary_channel_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The same `temporary_channel_id` received from the initiator's `open_channel2` or `open_channel` message. + */ + public void set_temporary_channel_id(org.ldk.structs.ChannelId val) { + bindings.CommonAcceptChannelFields_set_temporary_channel_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The threshold below which outputs on transactions broadcast by the channel acceptor will be + * omitted + */ + public long get_dust_limit_satoshis() { + long ret = bindings.CommonAcceptChannelFields_get_dust_limit_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The threshold below which outputs on transactions broadcast by the channel acceptor will be + * omitted + */ + public void set_dust_limit_satoshis(long val) { + bindings.CommonAcceptChannelFields_set_dust_limit_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ + public long get_max_htlc_value_in_flight_msat() { + long ret = bindings.CommonAcceptChannelFields_get_max_htlc_value_in_flight_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum inbound HTLC value in flight towards sender, in milli-satoshi + */ + public void set_max_htlc_value_in_flight_msat(long val) { + bindings.CommonAcceptChannelFields_set_max_htlc_value_in_flight_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The minimum HTLC size incoming to channel acceptor, in milli-satoshi + */ + public long get_htlc_minimum_msat() { + long ret = bindings.CommonAcceptChannelFields_get_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum HTLC size incoming to channel acceptor, in milli-satoshi + */ + public void set_htlc_minimum_msat(long val) { + bindings.CommonAcceptChannelFields_set_htlc_minimum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Minimum depth of the funding transaction before the channel is considered open + */ + public int get_minimum_depth() { + int ret = bindings.CommonAcceptChannelFields_get_minimum_depth(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Minimum depth of the funding transaction before the channel is considered open + */ + public void set_minimum_depth(int val) { + bindings.CommonAcceptChannelFields_set_minimum_depth(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public short get_to_self_delay() { + short ret = bindings.CommonAcceptChannelFields_get_to_self_delay(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public void set_to_self_delay(short val) { + bindings.CommonAcceptChannelFields_set_to_self_delay(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum number of inbound HTLCs towards channel acceptor + */ + public short get_max_accepted_htlcs() { + short ret = bindings.CommonAcceptChannelFields_get_max_accepted_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of inbound HTLCs towards channel acceptor + */ + public void set_max_accepted_htlcs(short val) { + bindings.CommonAcceptChannelFields_set_max_accepted_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The channel acceptor's key controlling the funding transaction + */ + public byte[] get_funding_pubkey() { + long ret = bindings.CommonAcceptChannelFields_get_funding_pubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The channel acceptor's key controlling the funding transaction + */ + public void set_funding_pubkey(byte[] val) { + bindings.CommonAcceptChannelFields_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public byte[] get_revocation_basepoint() { + long ret = bindings.CommonAcceptChannelFields_get_revocation_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public void set_revocation_basepoint(byte[] val) { + bindings.CommonAcceptChannelFields_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A payment key to channel acceptor for transactions broadcast by counterparty + */ + public byte[] get_payment_basepoint() { + long ret = bindings.CommonAcceptChannelFields_get_payment_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * A payment key to channel acceptor for transactions broadcast by counterparty + */ + public void set_payment_basepoint(byte[] val) { + bindings.CommonAcceptChannelFields_set_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a payment key to channel acceptor for transactions broadcast by channel + * acceptor + */ + public byte[] get_delayed_payment_basepoint() { + long ret = bindings.CommonAcceptChannelFields_get_delayed_payment_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to derive a payment key to channel acceptor for transactions broadcast by channel + * acceptor + */ + public void set_delayed_payment_basepoint(byte[] val) { + bindings.CommonAcceptChannelFields_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty + */ + public byte[] get_htlc_basepoint() { + long ret = bindings.CommonAcceptChannelFields_get_htlc_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to derive an HTLC payment key to channel acceptor for transactions broadcast by counterparty + */ + public void set_htlc_basepoint(byte[] val) { + bindings.CommonAcceptChannelFields_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point + */ + public byte[] get_first_per_commitment_point() { + long ret = bindings.CommonAcceptChannelFields_get_first_per_commitment_point(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The first to-be-broadcast-by-channel-acceptor transaction's per commitment point + */ + public void set_first_per_commitment_point(byte[] val) { + bindings.CommonAcceptChannelFields_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we + * collaboratively close + */ + public Option_CVec_u8ZZ get_shutdown_scriptpubkey() { + long ret = bindings.CommonAcceptChannelFields_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Optionally, a request to pre-set the to-channel-acceptor output's scriptPubkey for when we + * collaboratively close + */ + public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) { + bindings.CommonAcceptChannelFields_set_shutdown_scriptpubkey(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s + * [`CommonOpenChannelFields::channel_type`]. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelTypeFeatures get_channel_type() { + long ret = bindings.CommonAcceptChannelFields_get_channel_type(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel type that this channel will represent. If none is set, we derive the channel + * type from the intersection of our feature bits with our counterparty's feature bits from + * the Init message. + * + * This is required to match the equivalent field in [`OpenChannel`] or [`OpenChannelV2`]'s + * [`CommonOpenChannelFields::channel_type`]. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { + bindings.CommonAcceptChannelFields_set_channel_type(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new CommonAcceptChannelFields given each field + * + * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static CommonAcceptChannelFields of(org.ldk.structs.ChannelId temporary_channel_id_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, int minimum_depth_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg) { + long ret = bindings.CommonAcceptChannelFields_new(temporary_channel_id_arg.ptr, 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, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr); + GC.KeepAlive(temporary_channel_id_arg); + GC.KeepAlive(dust_limit_satoshis_arg); + GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(minimum_depth_arg); + GC.KeepAlive(to_self_delay_arg); + GC.KeepAlive(max_accepted_htlcs_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(revocation_basepoint_arg); + GC.KeepAlive(payment_basepoint_arg); + GC.KeepAlive(delayed_payment_basepoint_arg); + GC.KeepAlive(htlc_basepoint_arg); + GC.KeepAlive(first_per_commitment_point_arg); + GC.KeepAlive(shutdown_scriptpubkey_arg); + GC.KeepAlive(channel_type_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommonAcceptChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonAcceptChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.CommonAcceptChannelFields_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the CommonAcceptChannelFields + */ + public CommonAcceptChannelFields clone() { + long ret = bindings.CommonAcceptChannelFields_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommonAcceptChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonAcceptChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the CommonAcceptChannelFields. + */ + public long hash() { + long ret = bindings.CommonAcceptChannelFields_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two CommonAcceptChannelFieldss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.CommonAcceptChannelFields b) { + bool ret = bindings.CommonAcceptChannelFields_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is CommonAcceptChannelFields)) return false; + return this.eq((CommonAcceptChannelFields)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs b/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs new file mode 100644 index 00000000..11626a7d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/CommonOpenChannelFields.cs @@ -0,0 +1,478 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Contains fields that are both common to [`open_channel`] and `open_channel2` messages. + * + * [`open_channel`]: https://github.com/lightning/bolts/blob/master/02-peer-protocol.md#the-open_channel-message + */ +public class CommonOpenChannelFields : CommonBase { + internal CommonOpenChannelFields(object _dummy, long ptr) : base(ptr) { } + ~CommonOpenChannelFields() { + if (ptr != 0) { bindings.CommonOpenChannelFields_free(ptr); } + } + + /** + * The genesis hash of the blockchain where the channel is to be opened + */ + public byte[] get_chain_hash() { + long ret = bindings.CommonOpenChannelFields_get_chain_hash(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The genesis hash of the blockchain where the channel is to be opened + */ + public void set_chain_hash(byte[] val) { + bindings.CommonOpenChannelFields_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A temporary channel ID + * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint + * For V1 channels: a temporary channel ID, until the funding outpoint is announced + */ + public ChannelId get_temporary_channel_id() { + long ret = bindings.CommonOpenChannelFields_get_temporary_channel_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A temporary channel ID + * For V2 channels: derived using a zeroed out value for the channel acceptor's revocation basepoint + * For V1 channels: a temporary channel ID, until the funding outpoint is announced + */ + public void set_temporary_channel_id(org.ldk.structs.ChannelId val) { + bindings.CommonOpenChannelFields_set_temporary_channel_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * For V1 channels: The channel value + * For V2 channels: Part of the channel value contributed by the channel initiator + */ + public long get_funding_satoshis() { + long ret = bindings.CommonOpenChannelFields_get_funding_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * For V1 channels: The channel value + * For V2 channels: Part of the channel value contributed by the channel initiator + */ + public void set_funding_satoshis(long val) { + bindings.CommonOpenChannelFields_set_funding_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted + */ + public long get_dust_limit_satoshis() { + long ret = bindings.CommonOpenChannelFields_get_dust_limit_satoshis(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The threshold below which outputs on transactions broadcast by the channel initiator will be + * omitted + */ + public void set_dust_limit_satoshis(long val) { + bindings.CommonOpenChannelFields_set_dust_limit_satoshis(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi + */ + public long get_max_htlc_value_in_flight_msat() { + long ret = bindings.CommonOpenChannelFields_get_max_htlc_value_in_flight_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi + */ + public void set_max_htlc_value_in_flight_msat(long val) { + bindings.CommonOpenChannelFields_set_max_htlc_value_in_flight_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The minimum HTLC size incoming to channel initiator, in milli-satoshi + */ + public long get_htlc_minimum_msat() { + long ret = bindings.CommonOpenChannelFields_get_htlc_minimum_msat(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The minimum HTLC size incoming to channel initiator, in milli-satoshi + */ + public void set_htlc_minimum_msat(long val) { + bindings.CommonOpenChannelFields_set_htlc_minimum_msat(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The feerate for the commitment transaction set by the channel initiator until updated by + * [`UpdateFee`] + */ + public int get_commitment_feerate_sat_per_1000_weight() { + int ret = bindings.CommonOpenChannelFields_get_commitment_feerate_sat_per_1000_weight(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The feerate for the commitment transaction set by the channel initiator until updated by + * [`UpdateFee`] + */ + public void set_commitment_feerate_sat_per_1000_weight(int val) { + bindings.CommonOpenChannelFields_set_commitment_feerate_sat_per_1000_weight(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public short get_to_self_delay() { + short ret = bindings.CommonOpenChannelFields_get_to_self_delay(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The number of blocks which the counterparty will have to wait to claim on-chain funds if they + * broadcast a commitment transaction + */ + public void set_to_self_delay(short val) { + bindings.CommonOpenChannelFields_set_to_self_delay(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The maximum number of inbound HTLCs towards channel initiator + */ + public short get_max_accepted_htlcs() { + short ret = bindings.CommonOpenChannelFields_get_max_accepted_htlcs(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The maximum number of inbound HTLCs towards channel initiator + */ + public void set_max_accepted_htlcs(short val) { + bindings.CommonOpenChannelFields_set_max_accepted_htlcs(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The channel initiator's key controlling the funding transaction + */ + public byte[] get_funding_pubkey() { + long ret = bindings.CommonOpenChannelFields_get_funding_pubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The channel initiator's key controlling the funding transaction + */ + public void set_funding_pubkey(byte[] val) { + bindings.CommonOpenChannelFields_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public byte[] get_revocation_basepoint() { + long ret = bindings.CommonOpenChannelFields_get_revocation_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to derive a revocation key for transactions broadcast by counterparty + */ + public void set_revocation_basepoint(byte[] val) { + bindings.CommonOpenChannelFields_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A payment key to channel initiator for transactions broadcast by counterparty + */ + public byte[] get_payment_basepoint() { + long ret = bindings.CommonOpenChannelFields_get_payment_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * A payment key to channel initiator for transactions broadcast by counterparty + */ + public void set_payment_basepoint(byte[] val) { + bindings.CommonOpenChannelFields_set_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive a payment key to channel initiator for transactions broadcast by channel + * initiator + */ + public byte[] get_delayed_payment_basepoint() { + long ret = bindings.CommonOpenChannelFields_get_delayed_payment_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to derive a payment key to channel initiator for transactions broadcast by channel + * initiator + */ + public void set_delayed_payment_basepoint(byte[] val) { + bindings.CommonOpenChannelFields_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Used to derive an HTLC payment key to channel initiator + */ + public byte[] get_htlc_basepoint() { + long ret = bindings.CommonOpenChannelFields_get_htlc_basepoint(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Used to derive an HTLC payment key to channel initiator + */ + public void set_htlc_basepoint(byte[] val) { + bindings.CommonOpenChannelFields_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The first to-be-broadcast-by-channel-initiator transaction's per commitment point + */ + public byte[] get_first_per_commitment_point() { + long ret = bindings.CommonOpenChannelFields_get_first_per_commitment_point(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The first to-be-broadcast-by-channel-initiator transaction's per commitment point + */ + public void set_first_per_commitment_point(byte[] val) { + bindings.CommonOpenChannelFields_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The channel flags to be used + */ + public byte get_channel_flags() { + byte ret = bindings.CommonOpenChannelFields_get_channel_flags(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * The channel flags to be used + */ + public void set_channel_flags(byte val) { + bindings.CommonOpenChannelFields_set_channel_flags(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we + * collaboratively close + */ + public Option_CVec_u8ZZ get_shutdown_scriptpubkey() { + long ret = bindings.CommonOpenChannelFields_get_shutdown_scriptpubkey(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we + * collaboratively close + */ + public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) { + bindings.CommonOpenChannelFields_set_shutdown_scriptpubkey(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel type that this channel will represent + * + * If this is `None`, we derive the channel type from the intersection of our + * feature bits with our counterparty's feature bits from the [`Init`] message. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelTypeFeatures get_channel_type() { + long ret = bindings.CommonOpenChannelFields_get_channel_type(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel type that this channel will represent + * + * If this is `None`, we derive the channel type from the intersection of our + * feature bits with our counterparty's feature bits from the [`Init`] message. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { + bindings.CommonOpenChannelFields_set_channel_type(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new CommonOpenChannelFields given each field + * + * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static CommonOpenChannelFields of(byte[] chain_hash_arg, org.ldk.structs.ChannelId temporary_channel_id_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, int commitment_feerate_sat_per_1000_weight_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte channel_flags_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg) { + long ret = bindings.CommonOpenChannelFields_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), temporary_channel_id_arg.ptr, 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, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), channel_flags_arg, shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr); + GC.KeepAlive(chain_hash_arg); + GC.KeepAlive(temporary_channel_id_arg); + GC.KeepAlive(funding_satoshis_arg); + GC.KeepAlive(dust_limit_satoshis_arg); + GC.KeepAlive(max_htlc_value_in_flight_msat_arg); + GC.KeepAlive(htlc_minimum_msat_arg); + GC.KeepAlive(commitment_feerate_sat_per_1000_weight_arg); + GC.KeepAlive(to_self_delay_arg); + GC.KeepAlive(max_accepted_htlcs_arg); + GC.KeepAlive(funding_pubkey_arg); + GC.KeepAlive(revocation_basepoint_arg); + GC.KeepAlive(payment_basepoint_arg); + GC.KeepAlive(delayed_payment_basepoint_arg); + GC.KeepAlive(htlc_basepoint_arg); + GC.KeepAlive(first_per_commitment_point_arg); + GC.KeepAlive(channel_flags_arg); + GC.KeepAlive(shutdown_scriptpubkey_arg); + GC.KeepAlive(channel_type_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommonOpenChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonOpenChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.CommonOpenChannelFields_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the CommonOpenChannelFields + */ + public CommonOpenChannelFields clone() { + long ret = bindings.CommonOpenChannelFields_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.CommonOpenChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonOpenChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the CommonOpenChannelFields. + */ + public long hash() { + long ret = bindings.CommonOpenChannelFields_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two CommonOpenChannelFieldss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.CommonOpenChannelFields b) { + bool ret = bindings.CommonOpenChannelFields_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is CommonOpenChannelFields)) return false; + return this.eq((CommonOpenChannelFields)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Confirm.cs b/c_sharp/src/org/ldk/structs/Confirm.cs index 5d36fda7..a561d3ce 100644 --- a/c_sharp/src/org/ldk/structs/Confirm.cs +++ b/c_sharp/src/org/ldk/structs/Confirm.cs @@ -146,7 +146,7 @@ public class Confirm : CommonBase { public long get_relevant_txids() { ThreeTuple_ThirtyTwoBytesu32COption_ThirtyTwoBytesZZ[] ret = arg.get_relevant_txids(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_54 => ret_conv_54 == null ? 0 : ret_conv_54.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_54 => ret_conv_54.clone_ptr())); return result; } } @@ -179,7 +179,7 @@ public class Confirm : CommonBase { * [`best_block_updated`]: Self::best_block_updated */ public void transactions_confirmed(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) { - bindings.Confirm_transactions_confirmed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0)), height); + bindings.Confirm_transactions_confirmed(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28.ptr)), height); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(txdata); diff --git a/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs b/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs index 85da52f9..bd949cce 100644 --- a/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs +++ b/c_sharp/src/org/ldk/structs/CounterpartyChannelTransactionParameters.cs @@ -31,7 +31,7 @@ public class CounterpartyChannelTransactionParameters : CommonBase { * Counter-party public keys */ public void set_pubkeys(org.ldk.structs.ChannelPublicKeys val) { - bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val == null ? 0 : val.ptr); + bindings.CounterpartyChannelTransactionParameters_set_pubkeys(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -59,7 +59,7 @@ public class CounterpartyChannelTransactionParameters : CommonBase { * Constructs a new CounterpartyChannelTransactionParameters given each field */ public static CounterpartyChannelTransactionParameters of(org.ldk.structs.ChannelPublicKeys pubkeys_arg, short selected_contest_delay_arg) { - long ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg == null ? 0 : pubkeys_arg.ptr, selected_contest_delay_arg); + long ret = bindings.CounterpartyChannelTransactionParameters_new(pubkeys_arg.ptr, selected_contest_delay_arg); GC.KeepAlive(pubkeys_arg); GC.KeepAlive(selected_contest_delay_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -105,7 +105,7 @@ public class CounterpartyChannelTransactionParameters : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.CounterpartyChannelTransactionParameters b) { - bool ret = bindings.CounterpartyChannelTransactionParameters_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.CounterpartyChannelTransactionParameters_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs b/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs index fdec99ad..9184b690 100644 --- a/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/CustomMessageHandler.cs @@ -66,26 +66,26 @@ public class CustomMessageHandler : CommonBase { byte[] _sender_node_id_conv = InternalUtils.decodeUint8Array(_sender_node_id); Result_NoneLightningErrorZ ret = arg.handle_custom_message(ret_hu_conv, _sender_node_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long get_and_clear_pending_msg() { TwoTuple_PublicKeyTypeZ[] ret = arg.get_and_clear_pending_msg(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_25 => ret_conv_25 == null ? 0 : ret_conv_25.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_25 => ret_conv_25.clone_ptr())); return result; } public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long provided_init_features(long _their_node_id) { byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); InitFeatures ret = arg.provided_init_features(_their_node_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } diff --git a/c_sharp/src/org/ldk/structs/CustomMessageReader.cs b/c_sharp/src/org/ldk/structs/CustomMessageReader.cs index fad16dbe..466cd36f 100644 --- a/c_sharp/src/org/ldk/structs/CustomMessageReader.cs +++ b/c_sharp/src/org/ldk/structs/CustomMessageReader.cs @@ -40,7 +40,7 @@ public class CustomMessageReader : CommonBase { byte[] _buffer_conv = InternalUtils.decodeUint8Array(_buffer); Result_COption_TypeZDecodeErrorZ ret = arg.read(_message_type, _buffer_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } diff --git a/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs b/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs index 0a254aa3..95565d2b 100644 --- a/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/CustomOnionMessageHandler.cs @@ -58,7 +58,7 @@ public class CustomOnionMessageHandler : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; Option_OnionMessageContentsZ ret = arg.handle_custom_message(ret_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } @@ -66,13 +66,13 @@ public class CustomOnionMessageHandler : CommonBase { byte[] _buffer_conv = InternalUtils.decodeUint8Array(_buffer); Result_COption_OnionMessageContentsZDecodeErrorZ ret = arg.read_custom_message(_message_type, _buffer_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long release_pending_custom_messages() { ThreeTuple_OnionMessageContentsDestinationBlindedPathZ[] ret = arg.release_pending_custom_messages(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_56 => ret_conv_56 == null ? 0 : ret_conv_56.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_56 => ret_conv_56.clone_ptr())); return result; } } diff --git a/c_sharp/src/org/ldk/structs/DecodeError.cs b/c_sharp/src/org/ldk/structs/DecodeError.cs index e1033e6a..574b6b7f 100644 --- a/c_sharp/src/org/ldk/structs/DecodeError.cs +++ b/c_sharp/src/org/ldk/structs/DecodeError.cs @@ -24,6 +24,7 @@ public class DecodeError : CommonBase { case 4: return new DecodeError_BadLengthDescriptor(ptr); case 5: return new DecodeError_Io(ptr); case 6: return new DecodeError_UnsupportedCompression(ptr); + case 7: return new DecodeError_DangerousValue(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -66,6 +67,11 @@ public class DecodeError : CommonBase { internal DecodeError_UnsupportedCompression(long ptr) : base(null, ptr) { } } + /** A DecodeError of type DangerousValue */ + public class DecodeError_DangerousValue : DecodeError { + internal DecodeError_DangerousValue(long ptr) : base(null, ptr) { + } + } internal long clone_ptr() { long ret = bindings.DecodeError_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -162,6 +168,17 @@ public class DecodeError : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new DangerousValue-variant DecodeError + */ + public static DecodeError dangerous_value() { + long ret = bindings.DecodeError_dangerous_value(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.DecodeError ret_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Generates a non-cryptographic 64-bit hash of the DecodeError. */ @@ -179,7 +196,7 @@ public class DecodeError : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.DecodeError b) { - bool ret = bindings.DecodeError_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.DecodeError_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs b/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs index 6d03f2c9..170bdb2e 100644 --- a/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs +++ b/c_sharp/src/org/ldk/structs/DefaultMessageRouter.cs @@ -19,7 +19,7 @@ public class DefaultMessageRouter : CommonBase { * Creates a [`DefaultMessageRouter`] using the given [`NetworkGraph`]. */ public static DefaultMessageRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.DefaultMessageRouter_new(network_graph == null ? 0 : network_graph.ptr, entropy_source.ptr); + long ret = bindings.DefaultMessageRouter_new(network_graph.ptr, entropy_source.ptr); GC.KeepAlive(network_graph); GC.KeepAlive(entropy_source); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/DefaultRouter.cs b/c_sharp/src/org/ldk/structs/DefaultRouter.cs index a3f9e556..8d721253 100644 --- a/c_sharp/src/org/ldk/structs/DefaultRouter.cs +++ b/c_sharp/src/org/ldk/structs/DefaultRouter.cs @@ -19,7 +19,7 @@ public class DefaultRouter : CommonBase { * Creates a new router. */ public static DefaultRouter of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.LockableScore scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) { - long ret = bindings.DefaultRouter_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr, entropy_source.ptr, scorer.ptr, score_params == null ? 0 : score_params.ptr); + long ret = bindings.DefaultRouter_new(network_graph.ptr, logger.ptr, entropy_source.ptr, scorer.ptr, score_params.ptr); GC.KeepAlive(network_graph); GC.KeepAlive(logger); GC.KeepAlive(entropy_source); diff --git a/c_sharp/src/org/ldk/structs/DelayedPaymentBasepoint.cs b/c_sharp/src/org/ldk/structs/DelayedPaymentBasepoint.cs index 20166c7a..fdb11606 100644 --- a/c_sharp/src/org/ldk/structs/DelayedPaymentBasepoint.cs +++ b/c_sharp/src/org/ldk/structs/DelayedPaymentBasepoint.cs @@ -51,7 +51,7 @@ public class DelayedPaymentBasepoint : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.DelayedPaymentBasepoint b) { - bool ret = bindings.DelayedPaymentBasepoint_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.DelayedPaymentBasepoint_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -103,6 +103,18 @@ public class DelayedPaymentBasepoint : CommonBase { return ret_conv; } + /** + * Derives the \"tweak\" used in calculate [`DelayedPaymentKey::from_basepoint`].\n\n[`DelayedPaymentKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party. + */ + public byte[] derive_add_tweak(byte[] per_commitment_point) { + long ret = bindings.DelayedPaymentBasepoint_derive_add_tweak(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); + GC.KeepAlive(this); + GC.KeepAlive(per_commitment_point); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Serialize the DelayedPaymentBasepoint object into a byte array which can be read by DelayedPaymentBasepoint_read */ diff --git a/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs b/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs index 03408940..35cf8924 100644 --- a/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs +++ b/c_sharp/src/org/ldk/structs/DelayedPaymentKey.cs @@ -55,7 +55,7 @@ public class DelayedPaymentKey : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.DelayedPaymentKey b) { - bool ret = bindings.DelayedPaymentKey_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.DelayedPaymentKey_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -88,7 +88,7 @@ public class DelayedPaymentKey : CommonBase { * Derive a public delayedpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint` */ public static DelayedPaymentKey from_basepoint(org.ldk.structs.DelayedPaymentBasepoint countersignatory_basepoint, byte[] per_commitment_point) { - long ret = bindings.DelayedPaymentKey_from_basepoint(countersignatory_basepoint == null ? 0 : countersignatory_basepoint.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); + long ret = bindings.DelayedPaymentKey_from_basepoint(countersignatory_basepoint.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); GC.KeepAlive(countersignatory_basepoint); GC.KeepAlive(per_commitment_point); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs index b5536ec4..3dd136d3 100644 --- a/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/DelayedPaymentOutputDescriptor.cs @@ -33,7 +33,7 @@ public class DelayedPaymentOutputDescriptor : CommonBase { * The outpoint which is spendable. */ public void set_outpoint(org.ldk.structs.OutPoint val) { - bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + bindings.DelayedPaymentOutputDescriptor_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -117,7 +117,7 @@ public class DelayedPaymentOutputDescriptor : CommonBase { * derive the witnessScript for this output. */ public void set_revocation_pubkey(org.ldk.structs.RevocationKey val) { - bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val == null ? 0 : val.ptr); + bindings.DelayedPaymentOutputDescriptor_set_revocation_pubkey(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -163,11 +163,45 @@ public class DelayedPaymentOutputDescriptor : CommonBase { GC.KeepAlive(val); } + /** + * The channel public keys and other parameters needed to generate a spending transaction or + * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`]. + * + * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelTransactionParameters get_channel_transaction_parameters() { + long ret = bindings.DelayedPaymentOutputDescriptor_get_channel_transaction_parameters(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelTransactionParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTransactionParameters(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel public keys and other parameters needed to generate a spending transaction or + * to provide to a re-derived signer through [`ChannelSigner::provide_channel_parameters`]. + * + * Added as optional, but always `Some` if the descriptor was produced in v0.0.123 or later. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_transaction_parameters(org.ldk.structs.ChannelTransactionParameters val) { + bindings.DelayedPaymentOutputDescriptor_set_channel_transaction_parameters(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + /** * Constructs a new DelayedPaymentOutputDescriptor given each field + * + * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static DelayedPaymentOutputDescriptor of(org.ldk.structs.OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, org.ldk.structs.TxOut output_arg, org.ldk.structs.RevocationKey revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg) { - long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point_arg, 33)), to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg == null ? 0 : revocation_pubkey_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg); + public static DelayedPaymentOutputDescriptor of(org.ldk.structs.OutPoint outpoint_arg, byte[] per_commitment_point_arg, short to_self_delay_arg, org.ldk.structs.TxOut output_arg, org.ldk.structs.RevocationKey revocation_pubkey_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg, org.ldk.structs.ChannelTransactionParameters channel_transaction_parameters_arg) { + long ret = bindings.DelayedPaymentOutputDescriptor_new(outpoint_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point_arg, 33)), to_self_delay_arg, output_arg.ptr, revocation_pubkey_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg, channel_transaction_parameters_arg == null ? 0 : channel_transaction_parameters_arg.ptr); GC.KeepAlive(outpoint_arg); GC.KeepAlive(per_commitment_point_arg); GC.KeepAlive(to_self_delay_arg); @@ -175,11 +209,13 @@ public class DelayedPaymentOutputDescriptor : CommonBase { GC.KeepAlive(revocation_pubkey_arg); GC.KeepAlive(channel_keys_id_arg); GC.KeepAlive(channel_value_satoshis_arg); + GC.KeepAlive(channel_transaction_parameters_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.DelayedPaymentOutputDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.DelayedPaymentOutputDescriptor(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(revocation_pubkey_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_transaction_parameters_arg); }; return ret_hu_conv; } @@ -219,7 +255,7 @@ public class DelayedPaymentOutputDescriptor : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.DelayedPaymentOutputDescriptor b) { - bool ret = bindings.DelayedPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.DelayedPaymentOutputDescriptor_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Description.cs b/c_sharp/src/org/ldk/structs/Description.cs index 83657827..271abfc3 100644 --- a/c_sharp/src/org/ldk/structs/Description.cs +++ b/c_sharp/src/org/ldk/structs/Description.cs @@ -54,7 +54,7 @@ public class Description : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Description b) { - bool ret = bindings.Description_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Description_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Destination.cs b/c_sharp/src/org/ldk/structs/Destination.cs index 3d009773..74cf38c8 100644 --- a/c_sharp/src/org/ldk/structs/Destination.cs +++ b/c_sharp/src/org/ldk/structs/Destination.cs @@ -77,7 +77,7 @@ public class Destination : CommonBase { * Utility method to constructs a new BlindedPath-variant Destination */ public static Destination blinded_path(org.ldk.structs.BlindedPath a) { - long ret = bindings.Destination_blinded_path(a == null ? 0 : a.ptr); + long ret = bindings.Destination_blinded_path(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Destination ret_hu_conv = org.ldk.structs.Destination.constr_from_ptr(ret); @@ -86,5 +86,44 @@ public class Destination : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the Destination. + */ + public long hash() { + long ret = bindings.Destination_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two Destinations contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.Destination b) { + bool ret = bindings.Destination_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is Destination)) return false; + return this.eq((Destination)o); + } + /** + * Attempts to resolve the [`IntroductionNode::DirectedShortChannelId`] of a + * [`Destination::BlindedPath`] to a [`IntroductionNode::NodeId`], if applicable, using the + * provided [`ReadOnlyNetworkGraph`]. + */ + public void resolve(org.ldk.structs.ReadOnlyNetworkGraph network_graph) { + bindings.Destination_resolve(this.ptr, network_graph.ptr); + GC.KeepAlive(this); + GC.KeepAlive(network_graph); + if (this != null) { this.ptrs_to.AddLast(network_graph); }; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/DirectedChannelInfo.cs b/c_sharp/src/org/ldk/structs/DirectedChannelInfo.cs index fea5e7fb..07be5945 100644 --- a/c_sharp/src/org/ldk/structs/DirectedChannelInfo.cs +++ b/c_sharp/src/org/ldk/structs/DirectedChannelInfo.cs @@ -62,5 +62,33 @@ public class DirectedChannelInfo : CommonBase { return ret_hu_conv; } + /** + * Returns the `node_id` of the source hop. + * + * Refers to the `node_id` forwarding the payment to the next hop. + */ + public NodeId source() { + long ret = bindings.DirectedChannelInfo_source(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Returns the `node_id` of the target hop. + * + * Refers to the `node_id` receiving the payment from the previous hop. + */ + public NodeId target() { + long ret = bindings.DirectedChannelInfo_target(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NodeId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.NodeId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs b/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs index c831afa8..92f2a1ed 100644 --- a/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs +++ b/c_sharp/src/org/ldk/structs/EcdsaChannelSigner.cs @@ -35,6 +35,13 @@ public interface EcdsaChannelSignerInterface { * This may be called multiple times for the same transaction. * * An external signer implementation should check that the commitment has not been revoked. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_holder_commitment(HolderCommitmentTransaction commitment_tx); /**Create a signature for the given input in a transaction spending an HTLC transaction output @@ -51,6 +58,13 @@ public interface EcdsaChannelSignerInterface { * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do * so). + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key); /**Create a signature for the given input in a transaction spending a commitment transaction @@ -71,6 +85,13 @@ public interface EcdsaChannelSignerInterface { * * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script * (which is committed to in the BIP 143 signatures). + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, HTLCOutputInCommitment htlc); /**Computes the signature for a commitment transaction's HTLC output used as an input within @@ -81,8 +102,14 @@ public interface EcdsaChannelSignerInterface { * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) * broadcasts it before receiving the update for the latest commitment transaction. * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, HTLCDescriptor htlc_descriptor); /**Create a signature for a claiming transaction for a HTLC output on a counterparty's commitment @@ -102,6 +129,13 @@ public interface EcdsaChannelSignerInterface { * detected onchain. It has been generated by our counterparty and is used to derive * channel state keys, which are then included in the witness script and committed to in the * BIP 143 signature. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, HTLCOutputInCommitment htlc); /**Create a signature for a (proposed) closing transaction. @@ -112,6 +146,13 @@ public interface EcdsaChannelSignerInterface { Result_ECDSASignatureNoneZ sign_closing_transaction(ClosingTransaction closing_tx); /**Computes the signature for a commitment transaction's anchor output used as an * input within `anchor_tx`, which spends the commitment transaction, at index `input`. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input); /**Signs a channel announcement message with our funding key proving it comes from one of the @@ -172,14 +213,14 @@ public class EcdsaChannelSigner : CommonBase { bindings.free_buffer(_outbound_htlc_preimages); Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret = arg.sign_counterparty_commitment(_commitment_tx_hu_conv, _inbound_htlc_preimages_conv_8_arr, _outbound_htlc_preimages_conv_8_arr); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_holder_commitment(long _commitment_tx) { org.ldk.structs.HolderCommitmentTransaction _commitment_tx_hu_conv = null; if (_commitment_tx < 0 || _commitment_tx > 4096) { _commitment_tx_hu_conv = new org.ldk.structs.HolderCommitmentTransaction(null, _commitment_tx); } Result_ECDSASignatureNoneZ ret = arg.sign_holder_commitment(_commitment_tx_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_justice_revoked_output(long _justice_tx, long _input, long _amount, long _per_commitment_key) { @@ -187,7 +228,7 @@ public class EcdsaChannelSigner : CommonBase { byte[] _per_commitment_key_conv = InternalUtils.decodeUint8Array(_per_commitment_key); Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_output(_justice_tx_conv, _input, _amount, _per_commitment_key_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_justice_revoked_htlc(long _justice_tx, long _input, long _amount, long _per_commitment_key, long _htlc) { @@ -196,7 +237,7 @@ public class EcdsaChannelSigner : CommonBase { org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); } Result_ECDSASignatureNoneZ ret = arg.sign_justice_revoked_htlc(_justice_tx_conv, _input, _amount, _per_commitment_key_conv, _htlc_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_holder_htlc_transaction(long _htlc_tx, long _input, long _htlc_descriptor) { @@ -204,7 +245,7 @@ public class EcdsaChannelSigner : CommonBase { org.ldk.structs.HTLCDescriptor _htlc_descriptor_hu_conv = null; if (_htlc_descriptor < 0 || _htlc_descriptor > 4096) { _htlc_descriptor_hu_conv = new org.ldk.structs.HTLCDescriptor(null, _htlc_descriptor); } Result_ECDSASignatureNoneZ ret = arg.sign_holder_htlc_transaction(_htlc_tx_conv, _input, _htlc_descriptor_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_counterparty_htlc_transaction(long _htlc_tx, long _input, long _amount, long _per_commitment_point, long _htlc) { @@ -213,28 +254,28 @@ public class EcdsaChannelSigner : CommonBase { org.ldk.structs.HTLCOutputInCommitment _htlc_hu_conv = null; if (_htlc < 0 || _htlc > 4096) { _htlc_hu_conv = new org.ldk.structs.HTLCOutputInCommitment(null, _htlc); } Result_ECDSASignatureNoneZ ret = arg.sign_counterparty_htlc_transaction(_htlc_tx_conv, _input, _amount, _per_commitment_point_conv, _htlc_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_closing_transaction(long _closing_tx) { org.ldk.structs.ClosingTransaction _closing_tx_hu_conv = null; if (_closing_tx < 0 || _closing_tx > 4096) { _closing_tx_hu_conv = new org.ldk.structs.ClosingTransaction(null, _closing_tx); } Result_ECDSASignatureNoneZ ret = arg.sign_closing_transaction(_closing_tx_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_holder_anchor_input(long _anchor_tx, long _input) { byte[] _anchor_tx_conv = InternalUtils.decodeUint8Array(_anchor_tx); Result_ECDSASignatureNoneZ ret = arg.sign_holder_anchor_input(_anchor_tx_conv, _input); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_channel_announcement_with_funding_key(long _msg) { org.ldk.structs.UnsignedChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.UnsignedChannelAnnouncement(null, _msg); } Result_ECDSASignatureNoneZ ret = arg.sign_channel_announcement_with_funding_key(_msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -244,7 +285,7 @@ public class EcdsaChannelSigner : CommonBase { LDKEcdsaChannelSignerHolder impl_holder = new LDKEcdsaChannelSignerHolder(); LDKEcdsaChannelSignerImpl impl = new LDKEcdsaChannelSignerImpl(arg, impl_holder); ChannelSigner channelSigner = ChannelSigner.new_impl(channelSigner_impl, pubkeys); - long[] ptr_idx = bindings.LDKEcdsaChannelSigner_new(impl, channelSigner.instance_idx, pubkeys == null ? 0 : pubkeys.clone_ptr()); + long[] ptr_idx = bindings.LDKEcdsaChannelSigner_new(impl, channelSigner.instance_idx, pubkeys.clone_ptr()); impl_holder.held = new EcdsaChannelSigner(null, ptr_idx[0]); impl_holder.held.instance_idx = ptr_idx[1]; @@ -270,7 +311,7 @@ public class EcdsaChannelSigner : CommonBase { * irrelevant or duplicate preimages. */ public Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ sign_counterparty_commitment(org.ldk.structs.CommitmentTransaction commitment_tx, byte[][] inbound_htlc_preimages, byte[][] outbound_htlc_preimages) { - long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(inbound_htlc_preimages, inbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)))), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outbound_htlc_preimages, outbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32))))); + long ret = bindings.EcdsaChannelSigner_sign_counterparty_commitment(this.ptr, commitment_tx.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(inbound_htlc_preimages, inbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(inbound_htlc_preimages_conv_8, 32)))), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outbound_htlc_preimages, outbound_htlc_preimages_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(outbound_htlc_preimages_conv_8, 32))))); GC.KeepAlive(this); GC.KeepAlive(commitment_tx); GC.KeepAlive(inbound_htlc_preimages); @@ -291,9 +332,16 @@ public class EcdsaChannelSigner : CommonBase { * This may be called multiple times for the same transaction. * * An external signer implementation should check that the commitment has not been revoked. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_holder_commitment(org.ldk.structs.HolderCommitmentTransaction commitment_tx) { - long ret = bindings.EcdsaChannelSigner_sign_holder_commitment(this.ptr, commitment_tx == null ? 0 : commitment_tx.ptr); + long ret = bindings.EcdsaChannelSigner_sign_holder_commitment(this.ptr, commitment_tx.ptr); GC.KeepAlive(this); GC.KeepAlive(commitment_tx); if (ret >= 0 && ret <= 4096) { return null; } @@ -317,6 +365,13 @@ public class EcdsaChannelSigner : CommonBase { * revoked the state which they eventually broadcast. It's not a _holder_ secret key and does * not allow the spending of any funds by itself (you need our holder `revocation_secret` to do * so). + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_justice_revoked_output(byte[] justice_tx, long input, long amount, byte[] per_commitment_key) { long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_output(this.ptr, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32))); @@ -349,9 +404,16 @@ public class EcdsaChannelSigner : CommonBase { * * `htlc` holds HTLC elements (hash, timelock), thus changing the format of the witness script * (which is committed to in the BIP 143 signatures). + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_justice_revoked_htlc(byte[] justice_tx, long input, long amount, byte[] per_commitment_key, org.ldk.structs.HTLCOutputInCommitment htlc) { - long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)), htlc == null ? 0 : htlc.ptr); + long ret = bindings.EcdsaChannelSigner_sign_justice_revoked_htlc(this.ptr, InternalUtils.encodeUint8Array(justice_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_key, 32)), htlc.ptr); GC.KeepAlive(this); GC.KeepAlive(justice_tx); GC.KeepAlive(input); @@ -373,11 +435,17 @@ public class EcdsaChannelSigner : CommonBase { * [`ChannelMonitor`] [replica](https://github.com/lightningdevkit/rust-lightning/blob/main/GLOSSARY.md#monitor-replicas) * broadcasts it before receiving the update for the latest commitment transaction. * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * * [`EcdsaSighashType::All`]: bitcoin::sighash::EcdsaSighashType::All * [`ChannelMonitor`]: crate::chain::channelmonitor::ChannelMonitor + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_holder_htlc_transaction(byte[] htlc_tx, long input, org.ldk.structs.HTLCDescriptor htlc_descriptor) { - long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, htlc_descriptor == null ? 0 : htlc_descriptor.ptr); + long ret = bindings.EcdsaChannelSigner_sign_holder_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, htlc_descriptor.ptr); GC.KeepAlive(this); GC.KeepAlive(htlc_tx); GC.KeepAlive(input); @@ -406,9 +474,16 @@ public class EcdsaChannelSigner : CommonBase { * detected onchain. It has been generated by our counterparty and is used to derive * channel state keys, which are then included in the witness script and committed to in the * BIP 143 signature. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_counterparty_htlc_transaction(byte[] htlc_tx, long input, long amount, byte[] per_commitment_point, org.ldk.structs.HTLCOutputInCommitment htlc) { - long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), htlc == null ? 0 : htlc.ptr); + long ret = bindings.EcdsaChannelSigner_sign_counterparty_htlc_transaction(this.ptr, InternalUtils.encodeUint8Array(htlc_tx), input, amount, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), htlc.ptr); GC.KeepAlive(this); GC.KeepAlive(htlc_tx); GC.KeepAlive(input); @@ -428,7 +503,7 @@ public class EcdsaChannelSigner : CommonBase { * chosen to forgo their output as dust. */ public Result_ECDSASignatureNoneZ sign_closing_transaction(org.ldk.structs.ClosingTransaction closing_tx) { - long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx == null ? 0 : closing_tx.ptr); + long ret = bindings.EcdsaChannelSigner_sign_closing_transaction(this.ptr, closing_tx.ptr); GC.KeepAlive(this); GC.KeepAlive(closing_tx); if (ret >= 0 && ret <= 4096) { return null; } @@ -440,6 +515,13 @@ public class EcdsaChannelSigner : CommonBase { /** * Computes the signature for a commitment transaction's anchor output used as an * input within `anchor_tx`, which spends the commitment transaction, at index `input`. + * + * An `Err` can be returned to signal that the signer is unavailable/cannot produce a valid + * signature and should be retried later. Once the signer is ready to provide a signature after + * previously returning an `Err`, [`ChannelMonitor::signer_unblocked`] must be called on its + * monitor. + * + * [`ChannelMonitor::signer_unblocked`]: crate::chain::channelmonitor::ChannelMonitor::signer_unblocked */ public Result_ECDSASignatureNoneZ sign_holder_anchor_input(byte[] anchor_tx, long input) { long ret = bindings.EcdsaChannelSigner_sign_holder_anchor_input(this.ptr, InternalUtils.encodeUint8Array(anchor_tx), input); @@ -465,7 +547,7 @@ public class EcdsaChannelSigner : CommonBase { * [`NodeSigner::sign_gossip_message`]: crate::sign::NodeSigner::sign_gossip_message */ public Result_ECDSASignatureNoneZ sign_channel_announcement_with_funding_key(org.ldk.structs.UnsignedChannelAnnouncement msg) { - long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.EcdsaChannelSigner_sign_channel_announcement_with_funding_key(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/EmptyNodeIdLookUp.cs b/c_sharp/src/org/ldk/structs/EmptyNodeIdLookUp.cs new file mode 100644 index 00000000..3dfe3b68 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/EmptyNodeIdLookUp.cs @@ -0,0 +1,43 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A [`NodeIdLookUp`] that always returns `None`. + */ +public class EmptyNodeIdLookUp : CommonBase { + internal EmptyNodeIdLookUp(object _dummy, long ptr) : base(ptr) { } + ~EmptyNodeIdLookUp() { + if (ptr != 0) { bindings.EmptyNodeIdLookUp_free(ptr); } + } + + /** + * Constructs a new EmptyNodeIdLookUp given each field + */ + public static EmptyNodeIdLookUp of() { + long ret = bindings.EmptyNodeIdLookUp_new(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.EmptyNodeIdLookUp ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.EmptyNodeIdLookUp(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new NodeIdLookUp which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned NodeIdLookUp must be freed before this_arg is + */ + public NodeIdLookUp as_NodeIdLookUp() { + long ret = bindings.EmptyNodeIdLookUp_as_NodeIdLookUp(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + NodeIdLookUp ret_hu_conv = new NodeIdLookUp(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ErrorAction.cs b/c_sharp/src/org/ldk/structs/ErrorAction.cs index 9e0fc990..c137b857 100644 --- a/c_sharp/src/org/ldk/structs/ErrorAction.cs +++ b/c_sharp/src/org/ldk/structs/ErrorAction.cs @@ -129,7 +129,7 @@ public class ErrorAction : CommonBase { * Utility method to constructs a new DisconnectPeer-variant ErrorAction */ public static ErrorAction disconnect_peer(org.ldk.structs.ErrorMessage msg) { - long ret = bindings.ErrorAction_disconnect_peer(msg == null ? 0 : msg.ptr); + long ret = bindings.ErrorAction_disconnect_peer(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); @@ -142,7 +142,7 @@ public class ErrorAction : CommonBase { * Utility method to constructs a new DisconnectPeerWithWarning-variant ErrorAction */ public static ErrorAction disconnect_peer_with_warning(org.ldk.structs.WarningMessage msg) { - long ret = bindings.ErrorAction_disconnect_peer_with_warning(msg == null ? 0 : msg.ptr); + long ret = bindings.ErrorAction_disconnect_peer_with_warning(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); @@ -189,7 +189,7 @@ public class ErrorAction : CommonBase { * Utility method to constructs a new SendErrorMessage-variant ErrorAction */ public static ErrorAction send_error_message(org.ldk.structs.ErrorMessage msg) { - long ret = bindings.ErrorAction_send_error_message(msg == null ? 0 : msg.ptr); + long ret = bindings.ErrorAction_send_error_message(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorAction ret_hu_conv = org.ldk.structs.ErrorAction.constr_from_ptr(ret); @@ -202,7 +202,7 @@ public class ErrorAction : CommonBase { * Utility method to constructs a new SendWarningMessage-variant ErrorAction */ public static ErrorAction send_warning_message(org.ldk.structs.WarningMessage msg, Level log_level) { - long ret = bindings.ErrorAction_send_warning_message(msg == null ? 0 : msg.ptr, log_level); + long ret = bindings.ErrorAction_send_warning_message(msg.ptr, log_level); GC.KeepAlive(msg); GC.KeepAlive(log_level); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/ErrorMessage.cs b/c_sharp/src/org/ldk/structs/ErrorMessage.cs index fe33ec19..c2f4971f 100644 --- a/c_sharp/src/org/ldk/structs/ErrorMessage.cs +++ b/c_sharp/src/org/ldk/structs/ErrorMessage.cs @@ -23,12 +23,13 @@ public class ErrorMessage : CommonBase { * All-0s indicates a general error unrelated to a specific channel, after which all channels * with the sending peer should be closed. */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.ErrorMessage_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** @@ -37,10 +38,11 @@ public class ErrorMessage : CommonBase { * All-0s indicates a general error unrelated to a specific channel, after which all channels * with the sending peer should be closed. */ - public void set_channel_id(byte[] val) { - bindings.ErrorMessage_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.ErrorMessage_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -74,13 +76,14 @@ public class ErrorMessage : CommonBase { /** * Constructs a new ErrorMessage given each field */ - public static ErrorMessage of(byte[] channel_id_arg, string data_arg) { - long ret = bindings.ErrorMessage_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeString(data_arg)); + public static ErrorMessage of(org.ldk.structs.ChannelId channel_id_arg, string data_arg) { + long ret = bindings.ErrorMessage_new(channel_id_arg.ptr, InternalUtils.encodeString(data_arg)); GC.KeepAlive(channel_id_arg); GC.KeepAlive(data_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ErrorMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ErrorMessage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -120,7 +123,7 @@ public class ErrorMessage : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ErrorMessage b) { - bool ret = bindings.ErrorMessage_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ErrorMessage_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Event.cs b/c_sharp/src/org/ldk/structs/Event.cs index ccc37c52..342adec3 100644 --- a/c_sharp/src/org/ldk/structs/Event.cs +++ b/c_sharp/src/org/ldk/structs/Event.cs @@ -56,7 +56,7 @@ public class Event : CommonBase { * * [`ChannelManager::funding_transaction_generated`]: crate::ln::channelmanager::ChannelManager::funding_transaction_generated */ - public byte[] temporary_channel_id; + public ChannelId temporary_channel_id; /** * The counterparty's node_id, which you'll need to pass back into * [`ChannelManager::funding_transaction_generated`]. @@ -86,8 +86,9 @@ public class Event : CommonBase { public UInt128 user_channel_id; internal Event_FundingGenerationReady(long ptr) : base(null, ptr) { long temporary_channel_id = bindings.LDKEvent_FundingGenerationReady_get_temporary_channel_id(ptr); - byte[] temporary_channel_id_conv = InternalUtils.decodeUint8Array(temporary_channel_id); - this.temporary_channel_id = temporary_channel_id_conv; + org.ldk.structs.ChannelId temporary_channel_id_hu_conv = null; if (temporary_channel_id < 0 || temporary_channel_id > 4096) { temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, temporary_channel_id); } + if (temporary_channel_id_hu_conv != null) { temporary_channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.temporary_channel_id = temporary_channel_id_hu_conv; long counterparty_node_id = bindings.LDKEvent_FundingGenerationReady_get_counterparty_node_id(ptr); byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id); this.counterparty_node_id = counterparty_node_id_conv; @@ -157,8 +158,10 @@ public class Event : CommonBase { public PaymentPurpose purpose; /** * The `channel_id` indicating over which channel we received the payment. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_ThirtyTwoBytesZ via_channel_id; + public ChannelId via_channel_id; /** * The `user_channel_id` indicating over which channel we received the payment. */ @@ -191,7 +194,7 @@ public class Event : CommonBase { if (purpose_hu_conv != null) { purpose_hu_conv.ptrs_to.AddLast(this); }; this.purpose = purpose_hu_conv; long via_channel_id = bindings.LDKEvent_PaymentClaimable_get_via_channel_id(ptr); - org.ldk.structs.Option_ThirtyTwoBytesZ via_channel_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(via_channel_id); + org.ldk.structs.ChannelId via_channel_id_hu_conv = null; if (via_channel_id < 0 || via_channel_id > 4096) { via_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, via_channel_id); } if (via_channel_id_hu_conv != null) { via_channel_id_hu_conv.ptrs_to.AddLast(this); }; this.via_channel_id = via_channel_id_hu_conv; long via_user_channel_id = bindings.LDKEvent_PaymentClaimable_get_via_user_channel_id(ptr); @@ -635,8 +638,10 @@ public class Event : CommonBase { * The `channel_id` indicating which channel the spendable outputs belong to. * * This will always be `Some` for events generated by LDK versions 0.0.117 and above. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_ThirtyTwoBytesZ channel_id; + public ChannelId channel_id; internal Event_SpendableOutputs(long ptr) : base(null, ptr) { long outputs = bindings.LDKEvent_SpendableOutputs_get_outputs(ptr); int outputs_conv_27_len = InternalUtils.getArrayLength(outputs); @@ -650,7 +655,7 @@ public class Event : CommonBase { bindings.free_buffer(outputs); this.outputs = outputs_conv_27_arr; long channel_id = bindings.LDKEvent_SpendableOutputs_get_channel_id(ptr); - org.ldk.structs.Option_ThirtyTwoBytesZ channel_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(channel_id); + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; this.channel_id = channel_id_hu_conv; } @@ -658,17 +663,37 @@ public class Event : CommonBase { /** A Event of type PaymentForwarded */ public class Event_PaymentForwarded : Event { /** - * The incoming channel between the previous node and us. This is only `None` for events - * generated or serialized by versions prior to 0.0.107. + * The channel id of the incoming channel between the previous node and us. + * + * This is only `None` for events generated or serialized by versions prior to 0.0.107. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelId prev_channel_id; + /** + * The channel id of the outgoing channel between the next node and us. + * + * This is only `None` for events generated or serialized by versions prior to 0.0.107. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelId next_channel_id; + /** + * The `user_channel_id` of the incoming channel between the previous node and us. + * + * This is only `None` for events generated or serialized by versions prior to 0.0.122. */ - public Option_ThirtyTwoBytesZ prev_channel_id; + public Option_U128Z prev_user_channel_id; /** - * The outgoing channel between the next node and us. This is only `None` for events - * generated or serialized by versions prior to 0.0.107. + * The `user_channel_id` of the outgoing channel between the next node and us. + * + * This will be `None` if the payment was settled via an on-chain transaction. See the + * caveat described for the `total_fee_earned_msat` field. Moreover it will be `None` for + * events generated or serialized by versions prior to 0.0.122. */ - public Option_ThirtyTwoBytesZ next_channel_id; + public Option_U128Z next_user_channel_id; /** - * The fee, in milli-satoshis, which was earned as a result of the payment. + * The total fee, in milli-satoshis, which was earned as a result of the payment. * * Note that if we force-closed the channel over which we forwarded an HTLC while the HTLC * was pending, the amount the next hop claimed will have been rounded down to the nearest @@ -679,10 +704,26 @@ public class Event : CommonBase { * If the channel which sent us the payment has been force-closed, we will claim the funds * via an on-chain transaction. In that case we do not yet know the on-chain transaction * fees which we will spend and will instead set this to `None`. It is possible duplicate - * `PaymentForwarded` events are generated for the same payment iff `fee_earned_msat` is + * `PaymentForwarded` events are generated for the same payment iff `total_fee_earned_msat` is * `None`. */ - public Option_u64Z fee_earned_msat; + public Option_u64Z total_fee_earned_msat; + /** + * The share of the total fee, in milli-satoshis, which was withheld in addition to the + * forwarding fee. + * + * This will only be `Some` if we forwarded an intercepted HTLC with less than the + * expected amount. This means our counterparty accepted to receive less than the invoice + * amount, e.g., by claiming the payment featuring a corresponding + * [`PaymentClaimable::counterparty_skimmed_fee_msat`]. + * + * Will also always be `None` for events serialized with LDK prior to version 0.0.122. + * + * The caveat described above the `total_fee_earned_msat` field applies here as well. + * + * [`PaymentClaimable::counterparty_skimmed_fee_msat`]: Self::PaymentClaimable::counterparty_skimmed_fee_msat + */ + public Option_u64Z skimmed_fee_msat; /** * If this is `true`, the forwarded HTLC was claimed by our counterparty via an on-chain * transaction. @@ -691,22 +732,34 @@ public class Event : CommonBase { /** * The final amount forwarded, in milli-satoshis, after the fee is deducted. * - * The caveat described above the `fee_earned_msat` field applies here as well. + * The caveat described above the `total_fee_earned_msat` field applies here as well. */ public Option_u64Z outbound_amount_forwarded_msat; internal Event_PaymentForwarded(long ptr) : base(null, ptr) { long prev_channel_id = bindings.LDKEvent_PaymentForwarded_get_prev_channel_id(ptr); - org.ldk.structs.Option_ThirtyTwoBytesZ prev_channel_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(prev_channel_id); + org.ldk.structs.ChannelId prev_channel_id_hu_conv = null; if (prev_channel_id < 0 || prev_channel_id > 4096) { prev_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, prev_channel_id); } if (prev_channel_id_hu_conv != null) { prev_channel_id_hu_conv.ptrs_to.AddLast(this); }; this.prev_channel_id = prev_channel_id_hu_conv; long next_channel_id = bindings.LDKEvent_PaymentForwarded_get_next_channel_id(ptr); - org.ldk.structs.Option_ThirtyTwoBytesZ next_channel_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(next_channel_id); + org.ldk.structs.ChannelId next_channel_id_hu_conv = null; if (next_channel_id < 0 || next_channel_id > 4096) { next_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, next_channel_id); } if (next_channel_id_hu_conv != null) { next_channel_id_hu_conv.ptrs_to.AddLast(this); }; this.next_channel_id = next_channel_id_hu_conv; - long fee_earned_msat = bindings.LDKEvent_PaymentForwarded_get_fee_earned_msat(ptr); - org.ldk.structs.Option_u64Z fee_earned_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(fee_earned_msat); - if (fee_earned_msat_hu_conv != null) { fee_earned_msat_hu_conv.ptrs_to.AddLast(this); }; - this.fee_earned_msat = fee_earned_msat_hu_conv; + long prev_user_channel_id = bindings.LDKEvent_PaymentForwarded_get_prev_user_channel_id(ptr); + org.ldk.structs.Option_U128Z prev_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(prev_user_channel_id); + if (prev_user_channel_id_hu_conv != null) { prev_user_channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.prev_user_channel_id = prev_user_channel_id_hu_conv; + long next_user_channel_id = bindings.LDKEvent_PaymentForwarded_get_next_user_channel_id(ptr); + org.ldk.structs.Option_U128Z next_user_channel_id_hu_conv = org.ldk.structs.Option_U128Z.constr_from_ptr(next_user_channel_id); + if (next_user_channel_id_hu_conv != null) { next_user_channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.next_user_channel_id = next_user_channel_id_hu_conv; + long total_fee_earned_msat = bindings.LDKEvent_PaymentForwarded_get_total_fee_earned_msat(ptr); + org.ldk.structs.Option_u64Z total_fee_earned_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(total_fee_earned_msat); + if (total_fee_earned_msat_hu_conv != null) { total_fee_earned_msat_hu_conv.ptrs_to.AddLast(this); }; + this.total_fee_earned_msat = total_fee_earned_msat_hu_conv; + long skimmed_fee_msat = bindings.LDKEvent_PaymentForwarded_get_skimmed_fee_msat(ptr); + org.ldk.structs.Option_u64Z skimmed_fee_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(skimmed_fee_msat); + if (skimmed_fee_msat_hu_conv != null) { skimmed_fee_msat_hu_conv.ptrs_to.AddLast(this); }; + this.skimmed_fee_msat = skimmed_fee_msat_hu_conv; this.claim_from_onchain_tx = bindings.LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(ptr); long outbound_amount_forwarded_msat = bindings.LDKEvent_PaymentForwarded_get_outbound_amount_forwarded_msat(ptr); org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(outbound_amount_forwarded_msat); @@ -719,7 +772,7 @@ public class Event : CommonBase { /** * The `channel_id` of the channel that is pending confirmation. */ - public byte[] channel_id; + public ChannelId channel_id; /** * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if @@ -735,8 +788,10 @@ public class Event : CommonBase { * The `temporary_channel_id` this channel used to be known by during channel establishment. * * Will be `None` for channels created prior to LDK version 0.0.115. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_ThirtyTwoBytesZ former_temporary_channel_id; + public ChannelId former_temporary_channel_id; /** * The `node_id` of the channel counterparty. */ @@ -745,15 +800,24 @@ public class Event : CommonBase { * The outpoint of the channel's funding transaction. */ public OutPoint funding_txo; + /** + * The features that this channel will operate with. + * + * Will be `None` for channels created prior to LDK version 0.0.122. + * + * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelTypeFeatures channel_type; internal Event_ChannelPending(long ptr) : base(null, ptr) { long channel_id = bindings.LDKEvent_ChannelPending_get_channel_id(ptr); - byte[] channel_id_conv = InternalUtils.decodeUint8Array(channel_id); - this.channel_id = channel_id_conv; + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; long user_channel_id = bindings.LDKEvent_ChannelPending_get_user_channel_id(ptr); org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); this.user_channel_id = user_channel_id_conv; long former_temporary_channel_id = bindings.LDKEvent_ChannelPending_get_former_temporary_channel_id(ptr); - org.ldk.structs.Option_ThirtyTwoBytesZ former_temporary_channel_id_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(former_temporary_channel_id); + org.ldk.structs.ChannelId former_temporary_channel_id_hu_conv = null; if (former_temporary_channel_id < 0 || former_temporary_channel_id > 4096) { former_temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, former_temporary_channel_id); } if (former_temporary_channel_id_hu_conv != null) { former_temporary_channel_id_hu_conv.ptrs_to.AddLast(this); }; this.former_temporary_channel_id = former_temporary_channel_id_hu_conv; long counterparty_node_id = bindings.LDKEvent_ChannelPending_get_counterparty_node_id(ptr); @@ -763,6 +827,10 @@ public class Event : CommonBase { org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.AddLast(this); }; this.funding_txo = funding_txo_hu_conv; + long channel_type = bindings.LDKEvent_ChannelPending_get_channel_type(ptr); + org.ldk.structs.ChannelTypeFeatures channel_type_hu_conv = null; if (channel_type < 0 || channel_type > 4096) { channel_type_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, channel_type); } + if (channel_type_hu_conv != null) { channel_type_hu_conv.ptrs_to.AddLast(this); }; + this.channel_type = channel_type_hu_conv; } } /** A Event of type ChannelReady */ @@ -770,7 +838,7 @@ public class Event : CommonBase { /** * The `channel_id` of the channel that is ready. */ - public byte[] channel_id; + public ChannelId channel_id; /** * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if @@ -792,8 +860,9 @@ public class Event : CommonBase { public ChannelTypeFeatures channel_type; internal Event_ChannelReady(long ptr) : base(null, ptr) { long channel_id = bindings.LDKEvent_ChannelReady_get_channel_id(ptr); - byte[] channel_id_conv = InternalUtils.decodeUint8Array(channel_id); - this.channel_id = channel_id_conv; + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; long user_channel_id = bindings.LDKEvent_ChannelReady_get_user_channel_id(ptr); org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); this.user_channel_id = user_channel_id_conv; @@ -812,7 +881,7 @@ public class Event : CommonBase { * The `channel_id` of the channel which has been closed. Note that on-chain transactions * resolving the channel are likely still awaiting confirmation. */ - public byte[] channel_id; + public ChannelId channel_id; /** * The `user_channel_id` value passed in to [`ChannelManager::create_channel`] for outbound * channels, or to [`ChannelManager::accept_inbound_channel`] for inbound channels if @@ -854,8 +923,9 @@ public class Event : CommonBase { public OutPoint channel_funding_txo; internal Event_ChannelClosed(long ptr) : base(null, ptr) { long channel_id = bindings.LDKEvent_ChannelClosed_get_channel_id(ptr); - byte[] channel_id_conv = InternalUtils.decodeUint8Array(channel_id); - this.channel_id = channel_id_conv; + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; long user_channel_id = bindings.LDKEvent_ChannelClosed_get_user_channel_id(ptr); org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id); this.user_channel_id = user_channel_id_conv; @@ -881,15 +951,16 @@ public class Event : CommonBase { /** * The channel_id of the channel which has been closed. */ - public byte[] channel_id; + public ChannelId channel_id; /** * The full transaction received from the user */ public byte[] transaction; internal Event_DiscardFunding(long ptr) : base(null, ptr) { long channel_id = bindings.LDKEvent_DiscardFunding_get_channel_id(ptr); - byte[] channel_id_conv = InternalUtils.decodeUint8Array(channel_id); - this.channel_id = channel_id_conv; + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; long transaction = bindings.LDKEvent_DiscardFunding_get_transaction(ptr); byte[] transaction_conv = InternalUtils.decodeUint8Array(transaction); this.transaction = transaction_conv; @@ -907,7 +978,7 @@ public class Event : CommonBase { * [`ChannelManager::accept_inbound_channel`]: crate::ln::channelmanager::ChannelManager::accept_inbound_channel * [`ChannelManager::force_close_without_broadcasting_txn`]: crate::ln::channelmanager::ChannelManager::force_close_without_broadcasting_txn */ - public byte[] temporary_channel_id; + public ChannelId temporary_channel_id; /** * The node_id of the counterparty requesting to open the channel. * @@ -948,8 +1019,9 @@ public class Event : CommonBase { public ChannelTypeFeatures channel_type; internal Event_OpenChannelRequest(long ptr) : base(null, ptr) { long temporary_channel_id = bindings.LDKEvent_OpenChannelRequest_get_temporary_channel_id(ptr); - byte[] temporary_channel_id_conv = InternalUtils.decodeUint8Array(temporary_channel_id); - this.temporary_channel_id = temporary_channel_id_conv; + org.ldk.structs.ChannelId temporary_channel_id_hu_conv = null; if (temporary_channel_id < 0 || temporary_channel_id > 4096) { temporary_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, temporary_channel_id); } + if (temporary_channel_id_hu_conv != null) { temporary_channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.temporary_channel_id = temporary_channel_id_hu_conv; long counterparty_node_id = bindings.LDKEvent_OpenChannelRequest_get_counterparty_node_id(ptr); byte[] counterparty_node_id_conv = InternalUtils.decodeUint8Array(counterparty_node_id); this.counterparty_node_id = counterparty_node_id_conv; @@ -966,15 +1038,16 @@ public class Event : CommonBase { /** * The channel over which the HTLC was received. */ - public byte[] prev_channel_id; + public ChannelId prev_channel_id; /** * Destination of the HTLC that failed to be processed. */ public HTLCDestination failed_next_destination; internal Event_HTLCHandlingFailed(long ptr) : base(null, ptr) { long prev_channel_id = bindings.LDKEvent_HTLCHandlingFailed_get_prev_channel_id(ptr); - byte[] prev_channel_id_conv = InternalUtils.decodeUint8Array(prev_channel_id); - this.prev_channel_id = prev_channel_id_conv; + org.ldk.structs.ChannelId prev_channel_id_hu_conv = null; if (prev_channel_id < 0 || prev_channel_id > 4096) { prev_channel_id_hu_conv = new org.ldk.structs.ChannelId(null, prev_channel_id); } + if (prev_channel_id_hu_conv != null) { prev_channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.prev_channel_id = prev_channel_id_hu_conv; long failed_next_destination = bindings.LDKEvent_HTLCHandlingFailed_get_failed_next_destination(ptr); org.ldk.structs.HTLCDestination failed_next_destination_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(failed_next_destination); if (failed_next_destination_hu_conv != null) { failed_next_destination_hu_conv.ptrs_to.AddLast(this); }; @@ -1012,8 +1085,8 @@ public class Event : CommonBase { /** * Utility method to constructs a new FundingGenerationReady-variant Event */ - public static Event funding_generation_ready(byte[] temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, org.ldk.util.UInt128 user_channel_id) { - long ret = bindings.Event_funding_generation_ready(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_value_satoshis, InternalUtils.encodeUint8Array(output_script), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes())); + public static Event funding_generation_ready(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long channel_value_satoshis, byte[] output_script, org.ldk.util.UInt128 user_channel_id) { + long ret = bindings.Event_funding_generation_ready(temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_value_satoshis, InternalUtils.encodeUint8Array(output_script), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes())); GC.KeepAlive(temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(channel_value_satoshis); @@ -1022,14 +1095,15 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id); }; return ret_hu_conv; } /** * Utility method to constructs a new PaymentClaimable-variant Event */ - public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, org.ldk.structs.RecipientOnionFields onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, org.ldk.structs.PaymentPurpose purpose, org.ldk.structs.Option_ThirtyTwoBytesZ via_channel_id, org.ldk.structs.Option_U128Z via_user_channel_id, org.ldk.structs.Option_u32Z claim_deadline) { - long ret = bindings.Event_payment_claimable(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(receiver_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), onion_fields == null ? 0 : onion_fields.ptr, amount_msat, counterparty_skimmed_fee_msat, purpose.ptr, via_channel_id.ptr, via_user_channel_id.ptr, claim_deadline.ptr); + public static Event payment_claimable(byte[] receiver_node_id, byte[] payment_hash, org.ldk.structs.RecipientOnionFields onion_fields, long amount_msat, long counterparty_skimmed_fee_msat, org.ldk.structs.PaymentPurpose purpose, org.ldk.structs.ChannelId via_channel_id, org.ldk.structs.Option_U128Z via_user_channel_id, org.ldk.structs.Option_u32Z claim_deadline) { + long ret = bindings.Event_payment_claimable(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(receiver_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), onion_fields.ptr, amount_msat, counterparty_skimmed_fee_msat, purpose.ptr, via_channel_id.ptr, via_user_channel_id.ptr, claim_deadline.ptr); GC.KeepAlive(receiver_node_id); GC.KeepAlive(payment_hash); GC.KeepAlive(onion_fields); @@ -1054,7 +1128,7 @@ public class Event : CommonBase { * Utility method to constructs a new PaymentClaimed-variant Event */ public static Event payment_claimed(byte[] receiver_node_id, byte[] payment_hash, long amount_msat, org.ldk.structs.PaymentPurpose purpose, ClaimedHTLC[] htlcs, org.ldk.structs.Option_u64Z sender_intended_total_msat) { - long ret = bindings.Event_payment_claimed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(receiver_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), amount_msat, purpose.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlcs, htlcs_conv_13 => htlcs_conv_13 == null ? 0 : htlcs_conv_13.ptr)), sender_intended_total_msat.ptr); + long ret = bindings.Event_payment_claimed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(receiver_node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), amount_msat, purpose.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(htlcs, htlcs_conv_13 => htlcs_conv_13.ptr)), sender_intended_total_msat.ptr); GC.KeepAlive(receiver_node_id); GC.KeepAlive(payment_hash); GC.KeepAlive(amount_msat); @@ -1132,7 +1206,7 @@ public class Event : CommonBase { * Utility method to constructs a new PaymentPathSuccessful-variant Event */ public static Event payment_path_successful(byte[] payment_id, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, org.ldk.structs.Path path) { - long ret = bindings.Event_payment_path_successful(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), payment_hash.ptr, path == null ? 0 : path.ptr); + long ret = bindings.Event_payment_path_successful(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), payment_hash.ptr, path.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(path); @@ -1148,7 +1222,7 @@ public class Event : CommonBase { * Utility method to constructs a new PaymentPathFailed-variant Event */ public static Event payment_path_failed(org.ldk.structs.Option_ThirtyTwoBytesZ payment_id, byte[] payment_hash, bool payment_failed_permanently, org.ldk.structs.PathFailure failure, org.ldk.structs.Path path, org.ldk.structs.Option_u64Z short_channel_id) { - long ret = bindings.Event_payment_path_failed(payment_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), payment_failed_permanently, failure.ptr, path == null ? 0 : path.ptr, short_channel_id.ptr); + long ret = bindings.Event_payment_path_failed(payment_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), payment_failed_permanently, failure.ptr, path.ptr, short_channel_id.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(payment_failed_permanently); @@ -1169,7 +1243,7 @@ public class Event : CommonBase { * Utility method to constructs a new ProbeSuccessful-variant Event */ public static Event probe_successful(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Path path) { - long ret = bindings.Event_probe_successful(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), path == null ? 0 : path.ptr); + long ret = bindings.Event_probe_successful(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), path.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(path); @@ -1184,7 +1258,7 @@ public class Event : CommonBase { * Utility method to constructs a new ProbeFailed-variant Event */ public static Event probe_failed(byte[] payment_id, byte[] payment_hash, org.ldk.structs.Path path, org.ldk.structs.Option_u64Z short_channel_id) { - long ret = bindings.Event_probe_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), path == null ? 0 : path.ptr, short_channel_id.ptr); + long ret = bindings.Event_probe_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), path.ptr, short_channel_id.ptr); GC.KeepAlive(payment_id); GC.KeepAlive(payment_hash); GC.KeepAlive(path); @@ -1228,7 +1302,7 @@ public class Event : CommonBase { /** * Utility method to constructs a new SpendableOutputs-variant Event */ - public static Event spendable_outputs(SpendableOutputDescriptor[] outputs, org.ldk.structs.Option_ThirtyTwoBytesZ channel_id) { + public static Event spendable_outputs(SpendableOutputDescriptor[] outputs, org.ldk.structs.ChannelId channel_id) { long ret = bindings.Event_spendable_outputs(InternalUtils.encodeUint64Array(InternalUtils.mapArray(outputs, outputs_conv_27 => outputs_conv_27.ptr)), channel_id.ptr); GC.KeepAlive(outputs); GC.KeepAlive(channel_id); @@ -1243,11 +1317,14 @@ public class Event : CommonBase { /** * Utility method to constructs a new PaymentForwarded-variant Event */ - public static Event payment_forwarded(org.ldk.structs.Option_ThirtyTwoBytesZ prev_channel_id, org.ldk.structs.Option_ThirtyTwoBytesZ next_channel_id, org.ldk.structs.Option_u64Z fee_earned_msat, bool claim_from_onchain_tx, org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat) { - long ret = bindings.Event_payment_forwarded(prev_channel_id.ptr, next_channel_id.ptr, fee_earned_msat.ptr, claim_from_onchain_tx, outbound_amount_forwarded_msat.ptr); + public static Event payment_forwarded(org.ldk.structs.ChannelId prev_channel_id, org.ldk.structs.ChannelId next_channel_id, org.ldk.structs.Option_U128Z prev_user_channel_id, org.ldk.structs.Option_U128Z next_user_channel_id, org.ldk.structs.Option_u64Z total_fee_earned_msat, org.ldk.structs.Option_u64Z skimmed_fee_msat, bool claim_from_onchain_tx, org.ldk.structs.Option_u64Z outbound_amount_forwarded_msat) { + long ret = bindings.Event_payment_forwarded(prev_channel_id.ptr, next_channel_id.ptr, prev_user_channel_id.ptr, next_user_channel_id.ptr, total_fee_earned_msat.ptr, skimmed_fee_msat.ptr, claim_from_onchain_tx, outbound_amount_forwarded_msat.ptr); GC.KeepAlive(prev_channel_id); GC.KeepAlive(next_channel_id); - GC.KeepAlive(fee_earned_msat); + GC.KeepAlive(prev_user_channel_id); + GC.KeepAlive(next_user_channel_id); + GC.KeepAlive(total_fee_earned_msat); + GC.KeepAlive(skimmed_fee_msat); GC.KeepAlive(claim_from_onchain_tx); GC.KeepAlive(outbound_amount_forwarded_msat); if (ret >= 0 && ret <= 4096) { return null; } @@ -1255,7 +1332,10 @@ public class Event : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prev_channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(next_channel_id); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_earned_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prev_user_channel_id); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(next_user_channel_id); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(total_fee_earned_msat); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(skimmed_fee_msat); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outbound_amount_forwarded_msat); }; return ret_hu_conv; } @@ -1263,26 +1343,29 @@ public class Event : CommonBase { /** * Utility method to constructs a new ChannelPending-variant Event */ - public static Event channel_pending(byte[] channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.Option_ThirtyTwoBytesZ former_temporary_channel_id, byte[] counterparty_node_id, org.ldk.structs.OutPoint funding_txo) { - long ret = bindings.Event_channel_pending(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), former_temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding_txo == null ? 0 : funding_txo.ptr); + public static Event channel_pending(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ChannelId former_temporary_channel_id, byte[] counterparty_node_id, org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelTypeFeatures channel_type) { + long ret = bindings.Event_channel_pending(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), former_temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding_txo.ptr, channel_type.ptr); GC.KeepAlive(channel_id); GC.KeepAlive(user_channel_id); GC.KeepAlive(former_temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(funding_txo); + GC.KeepAlive(channel_type); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(former_temporary_channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type); }; return ret_hu_conv; } /** * Utility method to constructs a new ChannelReady-variant Event */ - public static Event channel_ready(byte[] channel_id, org.ldk.util.UInt128 user_channel_id, byte[] counterparty_node_id, org.ldk.structs.ChannelTypeFeatures channel_type) { - long ret = bindings.Event_channel_ready(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_type == null ? 0 : channel_type.ptr); + public static Event channel_ready(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, byte[] counterparty_node_id, org.ldk.structs.ChannelTypeFeatures channel_type) { + long ret = bindings.Event_channel_ready(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_type.ptr); GC.KeepAlive(channel_id); GC.KeepAlive(user_channel_id); GC.KeepAlive(counterparty_node_id); @@ -1290,6 +1373,7 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type); }; return ret_hu_conv; } @@ -1297,8 +1381,8 @@ public class Event : CommonBase { /** * Utility method to constructs a new ChannelClosed-variant Event */ - public static Event channel_closed(byte[] channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ClosureReason reason, byte[] counterparty_node_id, org.ldk.structs.Option_u64Z channel_capacity_sats, org.ldk.structs.OutPoint channel_funding_txo) { - long ret = bindings.Event_channel_closed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), reason.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_capacity_sats.ptr, channel_funding_txo == null ? 0 : channel_funding_txo.ptr); + public static Event channel_closed(org.ldk.structs.ChannelId channel_id, org.ldk.util.UInt128 user_channel_id, org.ldk.structs.ClosureReason reason, byte[] counterparty_node_id, org.ldk.structs.Option_u64Z channel_capacity_sats, org.ldk.structs.OutPoint channel_funding_txo) { + long ret = bindings.Event_channel_closed(channel_id.ptr, InternalUtils.encodeUint8Array(user_channel_id.getLEBytes()), reason.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), channel_capacity_sats.ptr, channel_funding_txo.ptr); GC.KeepAlive(channel_id); GC.KeepAlive(user_channel_id); GC.KeepAlive(reason); @@ -1308,6 +1392,7 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reason); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_capacity_sats); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_funding_txo); }; @@ -1317,21 +1402,22 @@ public class Event : CommonBase { /** * Utility method to constructs a new DiscardFunding-variant Event */ - public static Event discard_funding(byte[] channel_id, byte[] transaction) { - long ret = bindings.Event_discard_funding(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32)), InternalUtils.encodeUint8Array(transaction)); + public static Event discard_funding(org.ldk.structs.ChannelId channel_id, byte[] transaction) { + long ret = bindings.Event_discard_funding(channel_id.ptr, InternalUtils.encodeUint8Array(transaction)); GC.KeepAlive(channel_id); GC.KeepAlive(transaction); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } /** * Utility method to constructs a new OpenChannelRequest-variant Event */ - public static Event open_channel_request(byte[] temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, org.ldk.structs.ChannelTypeFeatures channel_type) { - long ret = bindings.Event_open_channel_request(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding_satoshis, push_msat, channel_type == null ? 0 : channel_type.ptr); + public static Event open_channel_request(org.ldk.structs.ChannelId temporary_channel_id, byte[] counterparty_node_id, long funding_satoshis, long push_msat, org.ldk.structs.ChannelTypeFeatures channel_type) { + long ret = bindings.Event_open_channel_request(temporary_channel_id.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id, 33)), funding_satoshis, push_msat, channel_type.ptr); GC.KeepAlive(temporary_channel_id); GC.KeepAlive(counterparty_node_id); GC.KeepAlive(funding_satoshis); @@ -1340,6 +1426,7 @@ public class Event : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type); }; return ret_hu_conv; } @@ -1347,13 +1434,14 @@ public class Event : CommonBase { /** * Utility method to constructs a new HTLCHandlingFailed-variant Event */ - public static Event htlchandling_failed(byte[] prev_channel_id, org.ldk.structs.HTLCDestination failed_next_destination) { - long ret = bindings.Event_htlchandling_failed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(prev_channel_id, 32)), failed_next_destination.ptr); + public static Event htlchandling_failed(org.ldk.structs.ChannelId prev_channel_id, org.ldk.structs.HTLCDestination failed_next_destination) { + long ret = bindings.Event_htlchandling_failed(prev_channel_id.ptr, failed_next_destination.ptr); GC.KeepAlive(prev_channel_id); GC.KeepAlive(failed_next_destination); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Event ret_hu_conv = org.ldk.structs.Event.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prev_channel_id); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(failed_next_destination); }; return ret_hu_conv; } @@ -1376,7 +1464,7 @@ public class Event : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.Event b) { - bool ret = bindings.Event_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Event_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/ExpiryTime.cs b/c_sharp/src/org/ldk/structs/ExpiryTime.cs index 66aaf8dc..bd8be08e 100644 --- a/c_sharp/src/org/ldk/structs/ExpiryTime.cs +++ b/c_sharp/src/org/ldk/structs/ExpiryTime.cs @@ -52,7 +52,7 @@ public class ExpiryTime : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ExpiryTime b) { - bool ret = bindings.ExpiryTime_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ExpiryTime_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Fallback.cs b/c_sharp/src/org/ldk/structs/Fallback.cs index 0fc469f3..371af63e 100644 --- a/c_sharp/src/org/ldk/structs/Fallback.cs +++ b/c_sharp/src/org/ldk/structs/Fallback.cs @@ -128,7 +128,7 @@ public class Fallback : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.Fallback b) { - bool ret = bindings.Fallback_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Fallback_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/FeeEstimator.cs b/c_sharp/src/org/ldk/structs/FeeEstimator.cs index 964cf002..e2d73ccc 100644 --- a/c_sharp/src/org/ldk/structs/FeeEstimator.cs +++ b/c_sharp/src/org/ldk/structs/FeeEstimator.cs @@ -33,6 +33,10 @@ public interface FeeEstimatorInterface { * * Note that all of the functions implemented here *must* be reentrant-safe (obviously - they're * called from inside the library in response to chain events, P2P events, or timer events). + * + * LDK may generate a substantial number of fee-estimation calls in some cases. You should + * pre-calculate and cache the fee estimate results to ensure you don't substantially slow HTLC + * handling. */ public class FeeEstimator : CommonBase { internal bindings.LDKFeeEstimator bindings_instance; diff --git a/c_sharp/src/org/ldk/structs/Filter.cs b/c_sharp/src/org/ldk/structs/Filter.cs index 32fb570e..f27d0a52 100644 --- a/c_sharp/src/org/ldk/structs/Filter.cs +++ b/c_sharp/src/org/ldk/structs/Filter.cs @@ -106,7 +106,7 @@ public class Filter : CommonBase { * registered mid-processing. */ public void register_output(org.ldk.structs.WatchedOutput output) { - bindings.Filter_register_output(this.ptr, output == null ? 0 : output.ptr); + bindings.Filter_register_output(this.ptr, output.ptr); GC.KeepAlive(this); GC.KeepAlive(output); if (this != null) { this.ptrs_to.AddLast(output); }; diff --git a/c_sharp/src/org/ldk/structs/ForwardNode.cs b/c_sharp/src/org/ldk/structs/ForwardNode.cs index 6860009e..82c4edb2 100644 --- a/c_sharp/src/org/ldk/structs/ForwardNode.cs +++ b/c_sharp/src/org/ldk/structs/ForwardNode.cs @@ -33,7 +33,7 @@ public class ForwardNode : CommonBase { * used for [`BlindedPayInfo`] construction. */ public void set_tlvs(org.ldk.structs.ForwardTlvs val) { - bindings.ForwardNode_set_tlvs(this.ptr, val == null ? 0 : val.ptr); + bindings.ForwardNode_set_tlvs(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -81,7 +81,7 @@ public class ForwardNode : CommonBase { * Constructs a new ForwardNode given each field */ public static ForwardNode of(org.ldk.structs.ForwardTlvs tlvs_arg, byte[] node_id_arg, long htlc_maximum_msat_arg) { - long ret = bindings.ForwardNode_new(tlvs_arg == null ? 0 : tlvs_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_arg, 33)), htlc_maximum_msat_arg); + long ret = bindings.ForwardNode_new(tlvs_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_arg, 33)), htlc_maximum_msat_arg); GC.KeepAlive(tlvs_arg); GC.KeepAlive(node_id_arg); GC.KeepAlive(htlc_maximum_msat_arg); diff --git a/c_sharp/src/org/ldk/structs/ForwardTlvs.cs b/c_sharp/src/org/ldk/structs/ForwardTlvs.cs index fb662994..d703878b 100644 --- a/c_sharp/src/org/ldk/structs/ForwardTlvs.cs +++ b/c_sharp/src/org/ldk/structs/ForwardTlvs.cs @@ -49,7 +49,7 @@ public class ForwardTlvs : CommonBase { * Payment parameters for relaying over [`Self::short_channel_id`]. */ public void set_payment_relay(org.ldk.structs.PaymentRelay val) { - bindings.ForwardTlvs_set_payment_relay(this.ptr, val == null ? 0 : val.ptr); + bindings.ForwardTlvs_set_payment_relay(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -71,7 +71,7 @@ public class ForwardTlvs : CommonBase { * Payment constraints for relaying over [`Self::short_channel_id`]. */ public void set_payment_constraints(org.ldk.structs.PaymentConstraints val) { - bindings.ForwardTlvs_set_payment_constraints(this.ptr, val == null ? 0 : val.ptr); + bindings.ForwardTlvs_set_payment_constraints(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -99,7 +99,7 @@ public class ForwardTlvs : CommonBase { * [`BlindedHop::encrypted_payload`]: crate::blinded_path::BlindedHop::encrypted_payload */ public void set_features(org.ldk.structs.BlindedHopFeatures val) { - bindings.ForwardTlvs_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.ForwardTlvs_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -109,7 +109,7 @@ public class ForwardTlvs : CommonBase { * Constructs a new ForwardTlvs given each field */ public static ForwardTlvs of(long short_channel_id_arg, org.ldk.structs.PaymentRelay payment_relay_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.BlindedHopFeatures features_arg) { - long ret = bindings.ForwardTlvs_new(short_channel_id_arg, payment_relay_arg == null ? 0 : payment_relay_arg.ptr, payment_constraints_arg == null ? 0 : payment_constraints_arg.ptr, features_arg == null ? 0 : features_arg.ptr); + long ret = bindings.ForwardTlvs_new(short_channel_id_arg, payment_relay_arg.ptr, payment_constraints_arg.ptr, features_arg.ptr); GC.KeepAlive(short_channel_id_arg); GC.KeepAlive(payment_relay_arg); GC.KeepAlive(payment_constraints_arg); diff --git a/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs new file mode 100644 index 00000000..daeb4f10 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ.cs @@ -0,0 +1,110 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ : CommonBase { + internal FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ(object _dummy, long ptr) : base(ptr) { } + ~FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ() { + if (ptr != 0) { bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_free(ptr); } + } + + /** + * + */ + public OutPoint get_a() { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ChannelId get_b() { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public MonitorEvent[] get_c() { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_c(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_14_len = InternalUtils.getArrayLength(ret); + MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret_conv_14_len]; + for (int o = 0; o < ret_conv_14_len; o++) { + long ret_conv_14 = InternalUtils.getU64ArrayElem(ret, o); + org.ldk.structs.MonitorEvent ret_conv_14_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret_conv_14); + if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_14_arr[o] = ret_conv_14_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_14_arr; + } + + /** + * + */ + public byte[] get_d() { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_get_d(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + internal long clone_ptr() { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ clone() { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ ret_hu_conv = new FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ from the contained elements. + */ + public static FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ of(org.ldk.structs.OutPoint a, org.ldk.structs.ChannelId b, MonitorEvent[] c, byte[] d) { + long ret = bindings.C4Tuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ_new(a.ptr, b.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(c, c_conv_14 => c_conv_14.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(d, 33))); + GC.KeepAlive(a); + GC.KeepAlive(b); + GC.KeepAlive(c); + GC.KeepAlive(d); + if (ret >= 0 && ret <= 4096) { return null; } + FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ ret_hu_conv = new FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; + foreach (MonitorEvent c_conv_14 in c) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(c_conv_14); }; }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/FundingCreated.cs b/c_sharp/src/org/ldk/structs/FundingCreated.cs index 55436ec1..0e15eaf8 100644 --- a/c_sharp/src/org/ldk/structs/FundingCreated.cs +++ b/c_sharp/src/org/ldk/structs/FundingCreated.cs @@ -22,21 +22,23 @@ public class FundingCreated : CommonBase { /** * A temporary channel ID, until the funding is established */ - public byte[] get_temporary_channel_id() { + public ChannelId get_temporary_channel_id() { long ret = bindings.FundingCreated_get_temporary_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * A temporary channel ID, until the funding is established */ - public void set_temporary_channel_id(byte[] val) { - bindings.FundingCreated_set_temporary_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_temporary_channel_id(org.ldk.structs.ChannelId val) { + bindings.FundingCreated_set_temporary_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -100,8 +102,8 @@ public class FundingCreated : CommonBase { /** * Constructs a new FundingCreated given each field */ - public static FundingCreated of(byte[] temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { - long ret = bindings.FundingCreated_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_txid_arg, 32)), funding_output_index_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64))); + public static FundingCreated of(org.ldk.structs.ChannelId temporary_channel_id_arg, byte[] funding_txid_arg, short funding_output_index_arg, byte[] signature_arg) { + long ret = bindings.FundingCreated_new(temporary_channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_txid_arg, 32)), funding_output_index_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64))); GC.KeepAlive(temporary_channel_id_arg); GC.KeepAlive(funding_txid_arg); GC.KeepAlive(funding_output_index_arg); @@ -109,6 +111,7 @@ public class FundingCreated : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.FundingCreated ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingCreated(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(temporary_channel_id_arg); }; return ret_hu_conv; } @@ -148,7 +151,7 @@ public class FundingCreated : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.FundingCreated b) { - bool ret = bindings.FundingCreated_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.FundingCreated_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/FundingSigned.cs b/c_sharp/src/org/ldk/structs/FundingSigned.cs index 9056396a..8ca3f344 100644 --- a/c_sharp/src/org/ldk/structs/FundingSigned.cs +++ b/c_sharp/src/org/ldk/structs/FundingSigned.cs @@ -22,21 +22,23 @@ public class FundingSigned : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.FundingSigned_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.FundingSigned_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.FundingSigned_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -62,13 +64,14 @@ public class FundingSigned : CommonBase { /** * Constructs a new FundingSigned given each field */ - public static FundingSigned of(byte[] channel_id_arg, byte[] signature_arg) { - long ret = bindings.FundingSigned_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64))); + public static FundingSigned of(org.ldk.structs.ChannelId channel_id_arg, byte[] signature_arg) { + long ret = bindings.FundingSigned_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(signature_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.FundingSigned ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.FundingSigned(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -108,7 +111,7 @@ public class FundingSigned : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.FundingSigned b) { - bool ret = bindings.FundingSigned_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.FundingSigned_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Future.cs b/c_sharp/src/org/ldk/structs/Future.cs index b48dbf6f..2a858199 100644 --- a/c_sharp/src/org/ldk/structs/Future.cs +++ b/c_sharp/src/org/ldk/structs/Future.cs @@ -8,8 +8,6 @@ namespace org { namespace ldk { namespace structs { /** * A simple future which can complete once, and calls some callback(s) when it does so. - * - * Clones can be made and all futures cloned from the same source will complete at the same time. */ public class Future : CommonBase { internal Future(object _dummy, long ptr) : base(ptr) { } @@ -17,24 +15,6 @@ public class Future : CommonBase { if (ptr != 0) { bindings.Future_free(ptr); } } - internal long clone_ptr() { - long ret = bindings.Future_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a copy of the Future - */ - public Future clone() { - long ret = bindings.Future_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Future ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Future(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - /** * Registers a callback to be called upon completion of this future. If the future has already * completed, the callback will be called immediately. @@ -52,7 +32,6 @@ public class Future : CommonBase { public void wait() { bindings.Future_wait(this.ptr); GC.KeepAlive(this); - if (this != null) { this.ptrs_to.AddLast(this); }; } /** @@ -64,7 +43,6 @@ public class Future : CommonBase { bool ret = bindings.Future_wait_timeout(this.ptr, max_wait); GC.KeepAlive(this); GC.KeepAlive(max_wait); - if (this != null) { this.ptrs_to.AddLast(this); }; return ret; } diff --git a/c_sharp/src/org/ldk/structs/GossipSync.cs b/c_sharp/src/org/ldk/structs/GossipSync.cs index 65d547d8..c26c54f9 100644 --- a/c_sharp/src/org/ldk/structs/GossipSync.cs +++ b/c_sharp/src/org/ldk/structs/GossipSync.cs @@ -54,7 +54,7 @@ public class GossipSync : CommonBase { * Utility method to constructs a new P2P-variant GossipSync */ public static GossipSync p2_p(org.ldk.structs.P2PGossipSync a) { - long ret = bindings.GossipSync_p2_p(a == null ? 0 : a.ptr); + long ret = bindings.GossipSync_p2_p(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); @@ -67,7 +67,7 @@ public class GossipSync : CommonBase { * Utility method to constructs a new Rapid-variant GossipSync */ public static GossipSync rapid(org.ldk.structs.RapidGossipSync a) { - long ret = bindings.GossipSync_rapid(a == null ? 0 : a.ptr); + long ret = bindings.GossipSync_rapid(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GossipSync ret_hu_conv = org.ldk.structs.GossipSync.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs b/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs index 8eac4266..5c512cd3 100644 --- a/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs +++ b/c_sharp/src/org/ldk/structs/GossipTimestampFilter.cs @@ -125,7 +125,7 @@ public class GossipTimestampFilter : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.GossipTimestampFilter b) { - bool ret = bindings.GossipTimestampFilter_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.GossipTimestampFilter_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/GraphSyncError.cs b/c_sharp/src/org/ldk/structs/GraphSyncError.cs index 1078fe24..2aadea96 100644 --- a/c_sharp/src/org/ldk/structs/GraphSyncError.cs +++ b/c_sharp/src/org/ldk/structs/GraphSyncError.cs @@ -79,7 +79,7 @@ public class GraphSyncError : CommonBase { * Utility method to constructs a new LightningError-variant GraphSyncError */ public static GraphSyncError lightning_error(org.ldk.structs.LightningError a) { - long ret = bindings.GraphSyncError_lightning_error(a == null ? 0 : a.ptr); + long ret = bindings.GraphSyncError_lightning_error(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.GraphSyncError ret_hu_conv = org.ldk.structs.GraphSyncError.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs b/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs index 9abae7ca..0197978e 100644 --- a/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/HTLCDescriptor.cs @@ -31,12 +31,32 @@ public class HTLCDescriptor : CommonBase { * The parameters required to derive the signer for the HTLC input. */ public void set_channel_derivation_parameters(org.ldk.structs.ChannelDerivationParameters val) { - bindings.HTLCDescriptor_set_channel_derivation_parameters(this.ptr, val == null ? 0 : val.ptr); + bindings.HTLCDescriptor_set_channel_derivation_parameters(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; } + /** + * The txid of the commitment transaction in which the HTLC output lives. + */ + public byte[] get_commitment_txid() { + long ret = bindings.HTLCDescriptor_get_commitment_txid(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The txid of the commitment transaction in which the HTLC output lives. + */ + public void set_commitment_txid(byte[] val) { + bindings.HTLCDescriptor_set_commitment_txid(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + /** * The number of the commitment transaction in which the HTLC output lives. */ @@ -121,7 +141,7 @@ public class HTLCDescriptor : CommonBase { * The details of the HTLC as it appears in the commitment transaction. */ public void set_htlc(org.ldk.structs.HTLCOutputInCommitment val) { - bindings.HTLCDescriptor_set_htlc(this.ptr, val == null ? 0 : val.ptr); + bindings.HTLCDescriptor_set_htlc(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -171,6 +191,28 @@ public class HTLCDescriptor : CommonBase { GC.KeepAlive(val); } + /** + * Constructs a new HTLCDescriptor given each field + */ + public static HTLCDescriptor of(org.ldk.structs.ChannelDerivationParameters channel_derivation_parameters_arg, byte[] commitment_txid_arg, long per_commitment_number_arg, byte[] per_commitment_point_arg, int feerate_per_kw_arg, org.ldk.structs.HTLCOutputInCommitment htlc_arg, org.ldk.structs.Option_ThirtyTwoBytesZ preimage_arg, byte[] counterparty_sig_arg) { + long ret = bindings.HTLCDescriptor_new(channel_derivation_parameters_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(commitment_txid_arg, 32)), per_commitment_number_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point_arg, 33)), feerate_per_kw_arg, htlc_arg.ptr, preimage_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_sig_arg, 64))); + GC.KeepAlive(channel_derivation_parameters_arg); + GC.KeepAlive(commitment_txid_arg); + GC.KeepAlive(per_commitment_number_arg); + GC.KeepAlive(per_commitment_point_arg); + GC.KeepAlive(feerate_per_kw_arg); + GC.KeepAlive(htlc_arg); + GC.KeepAlive(preimage_arg); + GC.KeepAlive(counterparty_sig_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HTLCDescriptor ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.HTLCDescriptor(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_derivation_parameters_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(htlc_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(preimage_arg); }; + return ret_hu_conv; + } + internal long clone_ptr() { long ret = bindings.HTLCDescriptor_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -195,7 +237,7 @@ public class HTLCDescriptor : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.HTLCDescriptor b) { - bool ret = bindings.HTLCDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.HTLCDescriptor_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/HTLCDestination.cs b/c_sharp/src/org/ldk/structs/HTLCDestination.cs index c8ebe79d..256ad5c3 100644 --- a/c_sharp/src/org/ldk/structs/HTLCDestination.cs +++ b/c_sharp/src/org/ldk/structs/HTLCDestination.cs @@ -20,7 +20,8 @@ public class HTLCDestination : CommonBase { case 0: return new HTLCDestination_NextHopChannel(ptr); case 1: return new HTLCDestination_UnknownNextHop(ptr); case 2: return new HTLCDestination_InvalidForward(ptr); - case 3: return new HTLCDestination_FailedPayment(ptr); + case 3: return new HTLCDestination_InvalidOnion(ptr); + case 4: return new HTLCDestination_FailedPayment(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -39,14 +40,15 @@ public class HTLCDestination : CommonBase { /** * The outgoing `channel_id` between us and the next node. */ - public byte[] channel_id; + public ChannelId channel_id; internal HTLCDestination_NextHopChannel(long ptr) : base(null, ptr) { long node_id = bindings.LDKHTLCDestination_NextHopChannel_get_node_id(ptr); byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id); this.node_id = node_id_conv; long channel_id = bindings.LDKHTLCDestination_NextHopChannel_get_channel_id(ptr); - byte[] channel_id_conv = InternalUtils.decodeUint8Array(channel_id); - this.channel_id = channel_id_conv; + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; } } /** A HTLCDestination of type UnknownNextHop */ @@ -69,6 +71,11 @@ public class HTLCDestination : CommonBase { this.requested_forward_scid = bindings.LDKHTLCDestination_InvalidForward_get_requested_forward_scid(ptr); } } + /** A HTLCDestination of type InvalidOnion */ + public class HTLCDestination_InvalidOnion : HTLCDestination { + internal HTLCDestination_InvalidOnion(long ptr) : base(null, ptr) { + } + } /** A HTLCDestination of type FailedPayment */ public class HTLCDestination_FailedPayment : HTLCDestination { /** @@ -102,13 +109,14 @@ public class HTLCDestination : CommonBase { /** * Utility method to constructs a new NextHopChannel-variant HTLCDestination */ - public static HTLCDestination next_hop_channel(byte[] node_id, byte[] channel_id) { - long ret = bindings.HTLCDestination_next_hop_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id, 32))); + public static HTLCDestination next_hop_channel(byte[] node_id, org.ldk.structs.ChannelId channel_id) { + long ret = bindings.HTLCDestination_next_hop_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), channel_id.ptr); GC.KeepAlive(node_id); GC.KeepAlive(channel_id); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } @@ -136,6 +144,17 @@ public class HTLCDestination : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new InvalidOnion-variant HTLCDestination + */ + public static HTLCDestination invalid_onion() { + long ret = bindings.HTLCDestination_invalid_onion(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.HTLCDestination ret_hu_conv = org.ldk.structs.HTLCDestination.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new FailedPayment-variant HTLCDestination */ @@ -153,7 +172,7 @@ public class HTLCDestination : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.HTLCDestination b) { - bool ret = bindings.HTLCDestination_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.HTLCDestination_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs b/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs index 4e64beee..e2866c4e 100644 --- a/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs +++ b/c_sharp/src/org/ldk/structs/HTLCOutputInCommitment.cs @@ -164,7 +164,7 @@ public class HTLCOutputInCommitment : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.HTLCOutputInCommitment b) { - bool ret = bindings.HTLCOutputInCommitment_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.HTLCOutputInCommitment_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/HTLCUpdate.cs b/c_sharp/src/org/ldk/structs/HTLCUpdate.cs index 74bb98ce..eaea62bf 100644 --- a/c_sharp/src/org/ldk/structs/HTLCUpdate.cs +++ b/c_sharp/src/org/ldk/structs/HTLCUpdate.cs @@ -41,7 +41,7 @@ public class HTLCUpdate : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.HTLCUpdate b) { - bool ret = bindings.HTLCUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.HTLCUpdate_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs index c8da499c..d7fdec8f 100644 --- a/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/HolderCommitmentTransaction.cs @@ -111,7 +111,7 @@ public class HolderCommitmentTransaction : CommonBase { * The funding keys are used to figure out which signature should go first when building the transaction for broadcast. */ public static HolderCommitmentTransaction of(org.ldk.structs.CommitmentTransaction commitment_tx, byte[] counterparty_sig, byte[][] counterparty_htlc_sigs, byte[] holder_funding_key, byte[] counterparty_funding_key) { - long ret = bindings.HolderCommitmentTransaction_new(commitment_tx == null ? 0 : commitment_tx.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_sig, 64)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(counterparty_htlc_sigs, counterparty_htlc_sigs_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)))), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(holder_funding_key, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_funding_key, 33))); + long ret = bindings.HolderCommitmentTransaction_new(commitment_tx.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_sig, 64)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(counterparty_htlc_sigs, counterparty_htlc_sigs_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_htlc_sigs_conv_8, 64)))), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(holder_funding_key, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_funding_key, 33))); GC.KeepAlive(commitment_tx); GC.KeepAlive(counterparty_sig); GC.KeepAlive(counterparty_htlc_sigs); diff --git a/c_sharp/src/org/ldk/structs/Hostname.cs b/c_sharp/src/org/ldk/structs/Hostname.cs index 0d5840ed..b5f0ec54 100644 --- a/c_sharp/src/org/ldk/structs/Hostname.cs +++ b/c_sharp/src/org/ldk/structs/Hostname.cs @@ -57,7 +57,7 @@ public class Hostname : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Hostname b) { - bool ret = bindings.Hostname_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Hostname_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/HtlcBasepoint.cs b/c_sharp/src/org/ldk/structs/HtlcBasepoint.cs index 5738f99a..67690bf6 100644 --- a/c_sharp/src/org/ldk/structs/HtlcBasepoint.cs +++ b/c_sharp/src/org/ldk/structs/HtlcBasepoint.cs @@ -51,7 +51,7 @@ public class HtlcBasepoint : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.HtlcBasepoint b) { - bool ret = bindings.HtlcBasepoint_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.HtlcBasepoint_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -103,6 +103,18 @@ public class HtlcBasepoint : CommonBase { return ret_conv; } + /** + * Derives the \"tweak\" used in calculate [`HtlcKey::from_basepoint`].\n\n[`HtlcKey::from_basepoint`] calculates a private key as:\n`privkey = basepoint_secret + SHA256(per_commitment_point || basepoint)`\n\nThis calculates the hash part in the tweak derivation process, which is used to\nensure that each key is unique and cannot be guessed by an external party. + */ + public byte[] derive_add_tweak(byte[] per_commitment_point) { + long ret = bindings.HtlcBasepoint_derive_add_tweak(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); + GC.KeepAlive(this); + GC.KeepAlive(per_commitment_point); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Serialize the HtlcBasepoint object into a byte array which can be read by HtlcBasepoint_read */ diff --git a/c_sharp/src/org/ldk/structs/HtlcKey.cs b/c_sharp/src/org/ldk/structs/HtlcKey.cs index c91c83a8..5e1d4545 100644 --- a/c_sharp/src/org/ldk/structs/HtlcKey.cs +++ b/c_sharp/src/org/ldk/structs/HtlcKey.cs @@ -55,7 +55,7 @@ public class HtlcKey : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.HtlcKey b) { - bool ret = bindings.HtlcKey_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.HtlcKey_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -88,7 +88,7 @@ public class HtlcKey : CommonBase { * Derive a public htlcpubkey using one node\'s `per_commitment_point` and its countersignatory\'s `basepoint` */ public static HtlcKey from_basepoint(org.ldk.structs.HtlcBasepoint countersignatory_basepoint, byte[] per_commitment_point) { - long ret = bindings.HtlcKey_from_basepoint(countersignatory_basepoint == null ? 0 : countersignatory_basepoint.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); + long ret = bindings.HtlcKey_from_basepoint(countersignatory_basepoint.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); GC.KeepAlive(countersignatory_basepoint); GC.KeepAlive(per_commitment_point); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs b/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs index 6a805b28..ec17174e 100644 --- a/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs +++ b/c_sharp/src/org/ldk/structs/InFlightHtlcs.cs @@ -49,7 +49,7 @@ public class InFlightHtlcs : CommonBase { * Takes in a path with payer's node id and adds the path's details to `InFlightHtlcs`. */ public void process_path(org.ldk.structs.Path path, byte[] payer_node_id) { - bindings.InFlightHtlcs_process_path(this.ptr, path == null ? 0 : path.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer_node_id, 33))); + bindings.InFlightHtlcs_process_path(this.ptr, path.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer_node_id, 33))); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(payer_node_id); @@ -61,7 +61,7 @@ public class InFlightHtlcs : CommonBase { * id. */ public void add_inflight_htlc(org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, long channel_scid, long used_msat) { - bindings.InFlightHtlcs_add_inflight_htlc(this.ptr, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, channel_scid, used_msat); + bindings.InFlightHtlcs_add_inflight_htlc(this.ptr, source.ptr, target.ptr, channel_scid, used_msat); GC.KeepAlive(this); GC.KeepAlive(source); GC.KeepAlive(target); @@ -76,7 +76,7 @@ public class InFlightHtlcs : CommonBase { * id. */ public Option_u64Z used_liquidity_msat(org.ldk.structs.NodeId source, org.ldk.structs.NodeId target, long channel_scid) { - long ret = bindings.InFlightHtlcs_used_liquidity_msat(this.ptr, source == null ? 0 : source.ptr, target == null ? 0 : target.ptr, channel_scid); + long ret = bindings.InFlightHtlcs_used_liquidity_msat(this.ptr, source.ptr, target.ptr, channel_scid); GC.KeepAlive(this); GC.KeepAlive(source); GC.KeepAlive(target); diff --git a/c_sharp/src/org/ldk/structs/InMemorySigner.cs b/c_sharp/src/org/ldk/structs/InMemorySigner.cs index caa0905e..c6fdea4a 100644 --- a/c_sharp/src/org/ldk/structs/InMemorySigner.cs +++ b/c_sharp/src/org/ldk/structs/InMemorySigner.cs @@ -308,7 +308,7 @@ public class InMemorySigner : CommonBase { * [`descriptor.outpoint`]: StaticPaymentOutputDescriptor::outpoint */ public Result_WitnessNoneZ sign_counterparty_payment_input(byte[] spend_tx, long input_idx, org.ldk.structs.StaticPaymentOutputDescriptor descriptor) { - long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, InternalUtils.encodeUint8Array(spend_tx), input_idx, descriptor == null ? 0 : descriptor.ptr); + long ret = bindings.InMemorySigner_sign_counterparty_payment_input(this.ptr, InternalUtils.encodeUint8Array(spend_tx), input_idx, descriptor.ptr); GC.KeepAlive(this); GC.KeepAlive(spend_tx); GC.KeepAlive(input_idx); @@ -332,7 +332,7 @@ public class InMemorySigner : CommonBase { * [`descriptor.to_self_delay`]: DelayedPaymentOutputDescriptor::to_self_delay */ public Result_WitnessNoneZ sign_dynamic_p2wsh_input(byte[] spend_tx, long input_idx, org.ldk.structs.DelayedPaymentOutputDescriptor descriptor) { - long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, InternalUtils.encodeUint8Array(spend_tx), input_idx, descriptor == null ? 0 : descriptor.ptr); + long ret = bindings.InMemorySigner_sign_dynamic_p2wsh_input(this.ptr, InternalUtils.encodeUint8Array(spend_tx), input_idx, descriptor.ptr); GC.KeepAlive(this); GC.KeepAlive(spend_tx); GC.KeepAlive(input_idx); diff --git a/c_sharp/src/org/ldk/structs/InboundHTLCErr.cs b/c_sharp/src/org/ldk/structs/InboundHTLCErr.cs index ccca20d2..985eaf35 100644 --- a/c_sharp/src/org/ldk/structs/InboundHTLCErr.cs +++ b/c_sharp/src/org/ldk/structs/InboundHTLCErr.cs @@ -89,5 +89,52 @@ public class InboundHTLCErr : CommonBase { return ret_hu_conv; } + internal long clone_ptr() { + long ret = bindings.InboundHTLCErr_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the InboundHTLCErr + */ + public InboundHTLCErr clone() { + long ret = bindings.InboundHTLCErr_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InboundHTLCErr ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InboundHTLCErr(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the InboundHTLCErr. + */ + public long hash() { + long ret = bindings.InboundHTLCErr_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two InboundHTLCErrs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.InboundHTLCErr b) { + bool ret = bindings.InboundHTLCErr_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is InboundHTLCErr)) return false; + return this.eq((InboundHTLCErr)o); + } } } } } diff --git a/c_sharp/src/org/ldk/structs/Init.cs b/c_sharp/src/org/ldk/structs/Init.cs index bc5f9ca6..d65f1b0e 100644 --- a/c_sharp/src/org/ldk/structs/Init.cs +++ b/c_sharp/src/org/ldk/structs/Init.cs @@ -33,7 +33,7 @@ public class Init : CommonBase { * The relevant features which the sender supports. */ public void set_features(org.ldk.structs.InitFeatures val) { - bindings.Init_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.Init_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -103,7 +103,7 @@ public class Init : CommonBase { * Constructs a new Init given each field */ public static Init of(org.ldk.structs.InitFeatures features_arg, org.ldk.structs.Option_CVec_ThirtyTwoBytesZZ networks_arg, org.ldk.structs.Option_SocketAddressZ remote_network_address_arg) { - long ret = bindings.Init_new(features_arg == null ? 0 : features_arg.ptr, networks_arg.ptr, remote_network_address_arg.ptr); + long ret = bindings.Init_new(features_arg.ptr, networks_arg.ptr, remote_network_address_arg.ptr); GC.KeepAlive(features_arg); GC.KeepAlive(networks_arg); GC.KeepAlive(remote_network_address_arg); @@ -152,7 +152,7 @@ public class Init : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Init b) { - bool ret = bindings.Init_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Init_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/InitFeatures.cs b/c_sharp/src/org/ldk/structs/InitFeatures.cs index 4f1551e3..2b5d514c 100644 --- a/c_sharp/src/org/ldk/structs/InitFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InitFeatures.cs @@ -21,7 +21,7 @@ public class InitFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.InitFeatures b) { - bool ret = bindings.InitFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.InitFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class InitFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.InitFeatures other) { - bool ret = bindings.InitFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.InitFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; @@ -791,5 +791,39 @@ public class InitFeatures : CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_trampoline_routing_optional() { + bindings.InitFeatures_set_trampoline_routing_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_trampoline_routing_required() { + bindings.InitFeatures_set_trampoline_routing_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_trampoline_routing() { + bool ret = bindings.InitFeatures_supports_trampoline_routing(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_trampoline_routing() { + bool ret = bindings.InitFeatures_requires_trampoline_routing(this.ptr); + GC.KeepAlive(this); + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Input.cs b/c_sharp/src/org/ldk/structs/Input.cs index b5d1084a..f3436002 100644 --- a/c_sharp/src/org/ldk/structs/Input.cs +++ b/c_sharp/src/org/ldk/structs/Input.cs @@ -33,7 +33,7 @@ public class Input : CommonBase { * The unique identifier of the input. */ public void set_outpoint(org.ldk.structs.OutPoint val) { - bindings.Input_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + bindings.Input_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -85,7 +85,7 @@ public class Input : CommonBase { * Constructs a new Input given each field */ public static Input of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut previous_utxo_arg, long satisfaction_weight_arg) { - long ret = bindings.Input_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, previous_utxo_arg.ptr, satisfaction_weight_arg); + long ret = bindings.Input_new(outpoint_arg.ptr, previous_utxo_arg.ptr, satisfaction_weight_arg); GC.KeepAlive(outpoint_arg); GC.KeepAlive(previous_utxo_arg); GC.KeepAlive(satisfaction_weight_arg); @@ -132,7 +132,7 @@ public class Input : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Input b) { - bool ret = bindings.Input_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Input_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/IntroductionNode.cs b/c_sharp/src/org/ldk/structs/IntroductionNode.cs new file mode 100644 index 00000000..7e1dee9d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/IntroductionNode.cs @@ -0,0 +1,116 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The unblinded node in a [`BlindedPath`]. + */ +public class IntroductionNode : CommonBase { + protected IntroductionNode(object _dummy, long ptr) : base(ptr) { } + ~IntroductionNode() { + if (ptr != 0) { bindings.IntroductionNode_free(ptr); } + } + + internal static IntroductionNode constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKIntroductionNode_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new IntroductionNode_NodeId(ptr); + case 1: return new IntroductionNode_DirectedShortChannelId(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A IntroductionNode of type NodeId */ + public class IntroductionNode_NodeId : IntroductionNode { + public byte[] node_id; + internal IntroductionNode_NodeId(long ptr) : base(null, ptr) { + long node_id = bindings.LDKIntroductionNode_NodeId_get_node_id(ptr); + byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id); + this.node_id = node_id_conv; + } + } + /** A IntroductionNode of type DirectedShortChannelId */ + public class IntroductionNode_DirectedShortChannelId : IntroductionNode { + public Direction _0; + public long _1; + internal IntroductionNode_DirectedShortChannelId(long ptr) : base(null, ptr) { + this._0 = bindings.LDKIntroductionNode_DirectedShortChannelId_get__0(ptr); + this._1 = bindings.LDKIntroductionNode_DirectedShortChannelId_get__1(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.IntroductionNode_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the IntroductionNode + */ + public IntroductionNode clone() { + long ret = bindings.IntroductionNode_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new NodeId-variant IntroductionNode + */ + public static IntroductionNode node_id(byte[] a) { + long ret = bindings.IntroductionNode_node_id(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33))); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new DirectedShortChannelId-variant IntroductionNode + */ + public static IntroductionNode directed_short_channel_id(Direction a, long b) { + long ret = bindings.IntroductionNode_directed_short_channel_id(a, b); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.IntroductionNode ret_hu_conv = org.ldk.structs.IntroductionNode.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the IntroductionNode. + */ + public long hash() { + long ret = bindings.IntroductionNode_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two IntroductionNodes contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.IntroductionNode b) { + bool ret = bindings.IntroductionNode_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is IntroductionNode)) return false; + return this.eq((IntroductionNode)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceError.cs b/c_sharp/src/org/ldk/structs/InvoiceError.cs index d797add8..a251e7a7 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceError.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceError.cs @@ -66,7 +66,7 @@ public class InvoiceError : CommonBase { * An explanation of the error. */ public void set_message(org.ldk.structs.UntrustedString val) { - bindings.InvoiceError_set_message(this.ptr, val == null ? 0 : val.ptr); + bindings.InvoiceError_set_message(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -78,7 +78,7 @@ public class InvoiceError : CommonBase { * Note that erroneous_field_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static InvoiceError of(org.ldk.structs.ErroneousField erroneous_field_arg, org.ldk.structs.UntrustedString message_arg) { - long ret = bindings.InvoiceError_new(erroneous_field_arg == null ? 0 : erroneous_field_arg.ptr, message_arg == null ? 0 : message_arg.ptr); + long ret = bindings.InvoiceError_new(erroneous_field_arg == null ? 0 : erroneous_field_arg.ptr, message_arg.ptr); GC.KeepAlive(erroneous_field_arg); GC.KeepAlive(message_arg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequest.cs b/c_sharp/src/org/ldk/structs/InvoiceRequest.cs index edbbb5a6..f84df903 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceRequest.cs @@ -74,14 +74,12 @@ public class InvoiceRequest : CommonBase { /** * The minimum amount required for a successful payment of a single item. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Amount amount() { + public Option_AmountZ amount() { long ret = bindings.InvoiceRequest_amount(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -89,6 +87,8 @@ public class InvoiceRequest : CommonBase { /** * A complete description of the purpose of the payment. Intended to be displayed to the user * but with the caveat that it has not been verified in any way. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public PrintableString description() { long ret = bindings.InvoiceRequest_description(this.ptr); @@ -167,13 +167,15 @@ public class InvoiceRequest : CommonBase { long ret = bindings.InvoiceRequest_supported_quantity(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** * The public key used by the recipient to sign invoices. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public byte[] signing_pubkey() { long ret = bindings.InvoiceRequest_signing_pubkey(this.ptr); @@ -274,16 +276,58 @@ public class InvoiceRequest : CommonBase { } /** - * Signature of the invoice request using [`payer_id`]. + * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the + * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time. * - * [`payer_id`]: Self::payer_id + * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned + * creation time is used for the `created_at` parameter. + * + * [`Duration`]: core::time::Duration */ - public byte[] signature() { - long ret = bindings.InvoiceRequest_signature(this.ptr); + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash) { + long ret = bindings.InvoiceRequest_respond_with(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_37 => payment_paths_conv_37.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); GC.KeepAlive(this); + GC.KeepAlive(payment_paths); + GC.KeepAlive(payment_hash); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates an [`InvoiceBuilder`] for the request with the given required fields. + * + * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after + * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds + * where [`std::time::SystemTime`] is not available. + * + * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment + * for the invoice. + * + * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It + * must contain one or more elements ordered from most-preferred to least-preferred, if there's + * a preference. Note, however, that any privacy is lost if a public node id was used for + * [`Offer::signing_pubkey`]. + * + * Errors if the request contains unknown required features. + * + * # Note + * + * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`], + * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead. + * + * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at + * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey + */ + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash, long created_at) { + long ret = bindings.InvoiceRequest_respond_with_no_std(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_37 => payment_paths_conv_37.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), created_at); + GC.KeepAlive(this); + GC.KeepAlive(payment_paths); + GC.KeepAlive(payment_hash); + GC.KeepAlive(created_at); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; } /** @@ -294,7 +338,7 @@ public class InvoiceRequest : CommonBase { * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice */ public Result_VerifiedInvoiceRequestNoneZ verify(org.ldk.structs.ExpandedKey key) { - long ret = bindings.InvoiceRequest_verify(this.ptr, key == null ? 0 : key.ptr); + long ret = bindings.InvoiceRequest_verify(this.ptr, key.ptr); GC.KeepAlive(this); GC.KeepAlive(key); if (ret >= 0 && ret <= 4096) { return null; } @@ -304,6 +348,19 @@ public class InvoiceRequest : CommonBase { return ret_hu_conv; } + /** + * Signature of the invoice request using [`payer_id`]. + * + * [`payer_id`]: Self::payer_id + */ + public byte[] signature() { + long ret = bindings.InvoiceRequest_signature(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Serialize the InvoiceRequest object into a byte array which can be read by InvoiceRequest_read */ diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs index f3d15d0d..6a80ee02 100644 --- a/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestFeatures.cs @@ -21,7 +21,7 @@ public class InvoiceRequestFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.InvoiceRequestFeatures b) { - bool ret = bindings.InvoiceRequestFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.InvoiceRequestFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class InvoiceRequestFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.InvoiceRequestFeatures other) { - bool ret = bindings.InvoiceRequestFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.InvoiceRequestFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs new file mode 100644 index 00000000..15f21c11 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestFields.cs @@ -0,0 +1,166 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Fields sent in an [`InvoiceRequest`] message to include in [`PaymentContext::Bolt12Offer`]. + * + * [`PaymentContext::Bolt12Offer`]: crate::blinded_path::payment::PaymentContext::Bolt12Offer + */ +public class InvoiceRequestFields : CommonBase { + internal InvoiceRequestFields(object _dummy, long ptr) : base(ptr) { } + ~InvoiceRequestFields() { + if (ptr != 0) { bindings.InvoiceRequestFields_free(ptr); } + } + + /** + * A possibly transient pubkey used to sign the invoice request. + */ + public byte[] get_payer_id() { + long ret = bindings.InvoiceRequestFields_get_payer_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * A possibly transient pubkey used to sign the invoice request. + */ + public void set_payer_id(byte[] val) { + bindings.InvoiceRequestFields_set_payer_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`]. + */ + public Option_u64Z get_quantity() { + long ret = bindings.InvoiceRequestFields_get_quantity(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_u64Z ret_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The quantity of the offer's item conforming to [`Offer::is_valid_quantity`]. + */ + public void set_quantity(org.ldk.structs.Option_u64Z val) { + bindings.InvoiceRequestFields_set_quantity(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * A payer-provided note which will be seen by the recipient and reflected back in the invoice + * response. Truncated to [`PAYER_NOTE_LIMIT`] characters. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public UntrustedString get_payer_note_truncated() { + long ret = bindings.InvoiceRequestFields_get_payer_note_truncated(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UntrustedString ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UntrustedString(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * A payer-provided note which will be seen by the recipient and reflected back in the invoice + * response. Truncated to [`PAYER_NOTE_LIMIT`] characters. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_payer_note_truncated(org.ldk.structs.UntrustedString val) { + bindings.InvoiceRequestFields_set_payer_note_truncated(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new InvoiceRequestFields given each field + * + * Note that payer_note_truncated_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static InvoiceRequestFields of(byte[] payer_id_arg, org.ldk.structs.Option_u64Z quantity_arg, org.ldk.structs.UntrustedString payer_note_truncated_arg) { + long ret = bindings.InvoiceRequestFields_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer_id_arg, 33)), quantity_arg.ptr, payer_note_truncated_arg == null ? 0 : payer_note_truncated_arg.ptr); + GC.KeepAlive(payer_id_arg); + GC.KeepAlive(quantity_arg); + GC.KeepAlive(payer_note_truncated_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(quantity_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payer_note_truncated_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.InvoiceRequestFields_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the InvoiceRequestFields + */ + public InvoiceRequestFields clone() { + long ret = bindings.InvoiceRequestFields_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InvoiceRequestFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two InvoiceRequestFieldss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.InvoiceRequestFields b) { + bool ret = bindings.InvoiceRequestFields_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is InvoiceRequestFields)) return false; + return this.eq((InvoiceRequestFields)o); + } + /** + * Serialize the InvoiceRequestFields object into a byte array which can be read by InvoiceRequestFields_read + */ + public byte[] write() { + long ret = bindings.InvoiceRequestFields_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a InvoiceRequestFields from a byte array, created by InvoiceRequestFields_write + */ + public static Result_InvoiceRequestFieldsDecodeErrorZ read(byte[] ser) { + long ret = bindings.InvoiceRequestFields_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFieldsDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFieldsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestWithDerivedPayerIdBuilder.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestWithDerivedPayerIdBuilder.cs new file mode 100644 index 00000000..d23373a5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestWithDerivedPayerIdBuilder.cs @@ -0,0 +1,138 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow. + * + * See [module-level documentation] for usage. + * + * [module-level documentation]: self + */ +public class InvoiceRequestWithDerivedPayerIdBuilder : CommonBase { + internal InvoiceRequestWithDerivedPayerIdBuilder(object _dummy, long ptr) : base(ptr) { } + ~InvoiceRequestWithDerivedPayerIdBuilder() { + if (ptr != 0) { bindings.InvoiceRequestWithDerivedPayerIdBuilder_free(ptr); } + } + + /** + * Builds a signed [`InvoiceRequest`] after checking for valid semantics. + */ + public Result_InvoiceRequestBolt12SemanticErrorZ build_and_sign() { + long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_build_and_sign(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not + * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported + * by the offer. + * + * Successive calls to this method will override the previous setting. + */ + public Result_NoneBolt12SemanticErrorZ chain(Network network) { + long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_chain(this.ptr, network); + GC.KeepAlive(this); + GC.KeepAlive(network); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is + * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]). + * + * Successive calls to this method will override the previous setting. + * + * [`quantity`]: Self::quantity + */ + public Result_NoneBolt12SemanticErrorZ amount_msats(long amount_msats) { + long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_amount_msats(this.ptr, amount_msats); + GC.KeepAlive(this); + GC.KeepAlive(amount_msats); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity` + * does not conform to [`Offer::is_valid_quantity`]. + * + * Successive calls to this method will override the previous setting. + */ + public Result_NoneBolt12SemanticErrorZ quantity(long quantity) { + long ret = bindings.InvoiceRequestWithDerivedPayerIdBuilder_quantity(this.ptr, quantity); + GC.KeepAlive(this); + GC.KeepAlive(quantity); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`InvoiceRequest::payer_note`]. + * + * Successive calls to this method will override the previous setting. + */ + public void payer_note(string payer_note) { + bindings.InvoiceRequestWithDerivedPayerIdBuilder_payer_note(this.ptr, InternalUtils.encodeString(payer_note)); + GC.KeepAlive(this); + GC.KeepAlive(payer_note); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.cs b/c_sharp/src/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.cs new file mode 100644 index 00000000..6900c12c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceRequestWithExplicitPayerIdBuilder.cs @@ -0,0 +1,139 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds an [`InvoiceRequest`] from an [`Offer`] for the \"offer to be paid\" flow. + * + * See [module-level documentation] for usage. + * + * [module-level documentation]: self + */ +public class InvoiceRequestWithExplicitPayerIdBuilder : CommonBase { + internal InvoiceRequestWithExplicitPayerIdBuilder(object _dummy, long ptr) : base(ptr) { } + ~InvoiceRequestWithExplicitPayerIdBuilder() { + if (ptr != 0) { bindings.InvoiceRequestWithExplicitPayerIdBuilder_free(ptr); } + } + + /** + * Builds an unsigned [`InvoiceRequest`] after checking for valid semantics. It can be signed + * by [`UnsignedInvoiceRequest::sign`]. + */ + public Result_UnsignedInvoiceRequestBolt12SemanticErrorZ build() { + long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_build(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`InvoiceRequest::chain`] of the given [`Network`] for paying an invoice. If not + * called, [`Network::Bitcoin`] is assumed. Errors if the chain for `network` is not supported + * by the offer. + * + * Successive calls to this method will override the previous setting. + */ + public Result_NoneBolt12SemanticErrorZ chain(Network network) { + long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_chain(this.ptr, network); + GC.KeepAlive(this); + GC.KeepAlive(network); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`InvoiceRequest::amount_msats`] for paying an invoice. Errors if `amount_msats` is + * not at least the expected invoice amount (i.e., [`Offer::amount`] times [`quantity`]). + * + * Successive calls to this method will override the previous setting. + * + * [`quantity`]: Self::quantity + */ + public Result_NoneBolt12SemanticErrorZ amount_msats(long amount_msats) { + long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_amount_msats(this.ptr, amount_msats); + GC.KeepAlive(this); + GC.KeepAlive(amount_msats); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets [`InvoiceRequest::quantity`] of items. If not set, `1` is assumed. Errors if `quantity` + * does not conform to [`Offer::is_valid_quantity`]. + * + * Successive calls to this method will override the previous setting. + */ + public Result_NoneBolt12SemanticErrorZ quantity(long quantity) { + long ret = bindings.InvoiceRequestWithExplicitPayerIdBuilder_quantity(this.ptr, quantity); + GC.KeepAlive(this); + GC.KeepAlive(quantity); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`InvoiceRequest::payer_note`]. + * + * Successive calls to this method will override the previous setting. + */ + public void payer_note(string payer_note) { + bindings.InvoiceRequestWithExplicitPayerIdBuilder_payer_note(this.ptr, InternalUtils.encodeString(payer_note)); + GC.KeepAlive(this); + GC.KeepAlive(payer_note); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs b/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs new file mode 100644 index 00000000..a5c5da4c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceWithDerivedSigningPubkeyBuilder.cs @@ -0,0 +1,150 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds a [`Bolt12Invoice`] from either: + * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or + * - a [`Refund`] for the \"offer for money\" flow. + * + * See [module-level documentation] for usage. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Refund`]: crate::offers::refund::Refund + * [module-level documentation]: self + */ +public class InvoiceWithDerivedSigningPubkeyBuilder : CommonBase { + internal InvoiceWithDerivedSigningPubkeyBuilder(object _dummy, long ptr) : base(ptr) { } + ~InvoiceWithDerivedSigningPubkeyBuilder() { + if (ptr != 0) { bindings.InvoiceWithDerivedSigningPubkeyBuilder_free(ptr); } + } + + /** + * Builds a signed [`Bolt12Invoice`] after checking for valid semantics. + */ + public Result_Bolt12InvoiceBolt12SemanticErrorZ build_and_sign() { + long ret = bindings.InvoiceWithDerivedSigningPubkeyBuilder_build_and_sign(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_Bolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`]. + * Any expiry that has already passed is valid and can be checked for using + * [`Bolt12Invoice::is_expired`]. + * + * Successive calls to this method will override the previous setting. + */ + public void relative_expiry(int relative_expiry_secs) { + bindings.InvoiceWithDerivedSigningPubkeyBuilder_relative_expiry(this.ptr, relative_expiry_secs); + GC.KeepAlive(this); + GC.KeepAlive(relative_expiry_secs); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`]. + * + * Successive calls to this method will add another address. Caller is responsible for not + * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses. + */ + public void fallback_v0_p2wsh(byte[] script_hash) { + bindings.InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wsh(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(script_hash, 32))); + GC.KeepAlive(this); + GC.KeepAlive(script_hash); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`]. + * + * Successive calls to this method will add another address. Caller is responsible for not + * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses. + */ + public void fallback_v0_p2wpkh(byte[] pubkey_hash) { + bindings.InvoiceWithDerivedSigningPubkeyBuilder_fallback_v0_p2wpkh(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey_hash, 20))); + GC.KeepAlive(this); + GC.KeepAlive(pubkey_hash); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Adds a P2TR address to [`Bolt12Invoice::fallbacks`]. + * + * Successive calls to this method will add another address. Caller is responsible for not + * adding duplicate addresses and only calling if capable of receiving to P2TR addresses. + */ + public void fallback_v1_p2tr_tweaked(byte[] utput_key) { + bindings.InvoiceWithDerivedSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(utput_key, 32))); + GC.KeepAlive(this); + GC.KeepAlive(utput_key); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is + * disallowed. + */ + public void allow_mpp() { + bindings.InvoiceWithDerivedSigningPubkeyBuilder_allow_mpp(this.ptr); + GC.KeepAlive(this); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs b/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs new file mode 100644 index 00000000..6bfb8c74 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/InvoiceWithExplicitSigningPubkeyBuilder.cs @@ -0,0 +1,151 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds a [`Bolt12Invoice`] from either: + * - an [`InvoiceRequest`] for the \"offer to be paid\" flow or + * - a [`Refund`] for the \"offer for money\" flow. + * + * See [module-level documentation] for usage. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`Refund`]: crate::offers::refund::Refund + * [module-level documentation]: self + */ +public class InvoiceWithExplicitSigningPubkeyBuilder : CommonBase { + internal InvoiceWithExplicitSigningPubkeyBuilder(object _dummy, long ptr) : base(ptr) { } + ~InvoiceWithExplicitSigningPubkeyBuilder() { + if (ptr != 0) { bindings.InvoiceWithExplicitSigningPubkeyBuilder_free(ptr); } + } + + /** + * Builds an unsigned [`Bolt12Invoice`] after checking for valid semantics. It can be signed by + * [`UnsignedBolt12Invoice::sign`]. + */ + public Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ build() { + long ret = bindings.InvoiceWithExplicitSigningPubkeyBuilder_build(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + return ret_hu_conv; + } + + /** + * Sets the [`Bolt12Invoice::relative_expiry`] as seconds since [`Bolt12Invoice::created_at`]. + * Any expiry that has already passed is valid and can be checked for using + * [`Bolt12Invoice::is_expired`]. + * + * Successive calls to this method will override the previous setting. + */ + public void relative_expiry(int relative_expiry_secs) { + bindings.InvoiceWithExplicitSigningPubkeyBuilder_relative_expiry(this.ptr, relative_expiry_secs); + GC.KeepAlive(this); + GC.KeepAlive(relative_expiry_secs); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Adds a P2WSH address to [`Bolt12Invoice::fallbacks`]. + * + * Successive calls to this method will add another address. Caller is responsible for not + * adding duplicate addresses and only calling if capable of receiving to P2WSH addresses. + */ + public void fallback_v0_p2wsh(byte[] script_hash) { + bindings.InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wsh(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(script_hash, 32))); + GC.KeepAlive(this); + GC.KeepAlive(script_hash); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Adds a P2WPKH address to [`Bolt12Invoice::fallbacks`]. + * + * Successive calls to this method will add another address. Caller is responsible for not + * adding duplicate addresses and only calling if capable of receiving to P2WPKH addresses. + */ + public void fallback_v0_p2wpkh(byte[] pubkey_hash) { + bindings.InvoiceWithExplicitSigningPubkeyBuilder_fallback_v0_p2wpkh(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey_hash, 20))); + GC.KeepAlive(this); + GC.KeepAlive(pubkey_hash); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Adds a P2TR address to [`Bolt12Invoice::fallbacks`]. + * + * Successive calls to this method will add another address. Caller is responsible for not + * adding duplicate addresses and only calling if capable of receiving to P2TR addresses. + */ + public void fallback_v1_p2tr_tweaked(byte[] utput_key) { + bindings.InvoiceWithExplicitSigningPubkeyBuilder_fallback_v1_p2tr_tweaked(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(utput_key, 32))); + GC.KeepAlive(this); + GC.KeepAlive(utput_key); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + + /** + * Sets [`Bolt12Invoice::invoice_features`] to indicate MPP may be used. Otherwise, MPP is + * disallowed. + */ + public void allow_mpp() { + bindings.InvoiceWithExplicitSigningPubkeyBuilder_allow_mpp(this.ptr); + GC.KeepAlive(this); + if (this != null) { this.ptrs_to.AddLast(this); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid this being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after this call, this is reset to null and is now a dummy object. + this.ptr = 0;; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/KVStore.cs b/c_sharp/src/org/ldk/structs/KVStore.cs index 8e33e985..16adaebd 100644 --- a/c_sharp/src/org/ldk/structs/KVStore.cs +++ b/c_sharp/src/org/ldk/structs/KVStore.cs @@ -94,7 +94,7 @@ public class KVStore : CommonBase { string _key_conv = InternalUtils.decodeString(_key); Result_CVec_u8ZIOErrorZ ret = arg.read(_primary_namespace_conv, _secondary_namespace_conv, _key_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long write(long _primary_namespace, long _secondary_namespace, long _key, long _buf) { @@ -104,7 +104,7 @@ public class KVStore : CommonBase { byte[] _buf_conv = InternalUtils.decodeUint8Array(_buf); Result_NoneIOErrorZ ret = arg.write(_primary_namespace_conv, _secondary_namespace_conv, _key_conv, _buf_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long remove(long _primary_namespace, long _secondary_namespace, long _key, bool _lazy) { @@ -113,7 +113,7 @@ public class KVStore : CommonBase { string _key_conv = InternalUtils.decodeString(_key); Result_NoneIOErrorZ ret = arg.remove(_primary_namespace_conv, _secondary_namespace_conv, _key_conv, _lazy); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long list(long _primary_namespace, long _secondary_namespace) { @@ -121,7 +121,7 @@ public class KVStore : CommonBase { string _secondary_namespace_conv = InternalUtils.decodeString(_secondary_namespace); Result_CVec_StrZIOErrorZ ret = arg.list(_primary_namespace_conv, _secondary_namespace_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } diff --git a/c_sharp/src/org/ldk/structs/KeysManager.cs b/c_sharp/src/org/ldk/structs/KeysManager.cs index 1b780285..333c1de4 100644 --- a/c_sharp/src/org/ldk/structs/KeysManager.cs +++ b/c_sharp/src/org/ldk/structs/KeysManager.cs @@ -103,40 +103,6 @@ public class KeysManager : CommonBase { return ret_hu_conv; } - /** - * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an - * output to the given change destination (if sufficient change value remains). The - * transaction will have a feerate, at least, of the given value. - * - * The `locktime` argument is used to set the transaction's locktime. If `None`, the - * transaction will have a locktime of 0. It it recommended to set this to the current block - * height to avoid fee sniping, unless you have some specific reason to use a different - * locktime. - * - * Returns `Err(())` if the output value is greater than the input value minus required fee, - * if a descriptor was duplicated, or if an output descriptor `script_pubkey` - * does not match the one we can spend. - * - * We do not enforce that outputs meet the dust limit or that any output scripts are standard. - * - * May panic if the [`SpendableOutputDescriptor`]s were not generated by channels which used - * this [`KeysManager`] or one of the [`InMemorySigner`] created by this [`KeysManager`]. - */ - public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { - long ret = bindings.KeysManager_spend_spendable_outputs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr)), InternalUtils.encodeUint8Array(change_destination_script), feerate_sat_per_1000_weight, locktime.ptr); - GC.KeepAlive(this); - GC.KeepAlive(descriptors); - GC.KeepAlive(outputs); - GC.KeepAlive(change_destination_script); - GC.KeepAlive(feerate_sat_per_1000_weight); - GC.KeepAlive(locktime); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); - foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; - if (this != null) { this.ptrs_to.AddLast(locktime); }; - return ret_hu_conv; - } - /** * Constructs a new EntropySource which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is @@ -163,6 +129,19 @@ public class KeysManager : CommonBase { return ret_hu_conv; } + /** + * Constructs a new OutputSpender which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is + */ + public OutputSpender as_OutputSpender() { + long ret = bindings.KeysManager_as_OutputSpender(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OutputSpender ret_hu_conv = new OutputSpender(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Constructs a new SignerProvider which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is diff --git a/c_sharp/src/org/ldk/structs/Listen.cs b/c_sharp/src/org/ldk/structs/Listen.cs index fa31f714..21dd7b2f 100644 --- a/c_sharp/src/org/ldk/structs/Listen.cs +++ b/c_sharp/src/org/ldk/structs/Listen.cs @@ -92,7 +92,7 @@ public class Listen : CommonBase { * possibly filtered. */ public void filtered_block_connected(byte[] header, TwoTuple_usizeTransactionZ[] txdata, int height) { - bindings.Listen_filtered_block_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28 != null ? txdata_conv_28.ptr : 0)), height); + bindings.Listen_filtered_block_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(header, 80)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(txdata, txdata_conv_28 => txdata_conv_28.ptr)), height); GC.KeepAlive(this); GC.KeepAlive(header); GC.KeepAlive(txdata); diff --git a/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs b/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs index 3cc67b31..8e0c88b8 100644 --- a/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs +++ b/c_sharp/src/org/ldk/structs/MaxDustHTLCExposure.cs @@ -6,7 +6,7 @@ using System; namespace org { namespace ldk { namespace structs { /** - * Options for how to set the max dust HTLC exposure allowed on a channel. See + * Options for how to set the max dust exposure allowed on a channel. See * [`ChannelConfig::max_dust_htlc_exposure`] for details. */ public class MaxDustHTLCExposure : CommonBase { @@ -86,7 +86,7 @@ public class MaxDustHTLCExposure : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.MaxDustHTLCExposure b) { - bool ret = bindings.MaxDustHTLCExposure_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.MaxDustHTLCExposure_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/MessageRouter.cs b/c_sharp/src/org/ldk/structs/MessageRouter.cs index 12f593e1..28b3b20b 100644 --- a/c_sharp/src/org/ldk/structs/MessageRouter.cs +++ b/c_sharp/src/org/ldk/structs/MessageRouter.cs @@ -50,7 +50,7 @@ public class MessageRouter : CommonBase { if (_destination_hu_conv != null) { _destination_hu_conv.ptrs_to.AddLast(this); }; Result_OnionMessagePathNoneZ ret = arg.find_path(_sender_conv, _peers_conv_8_arr, _destination_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long create_blinded_paths(long _recipient, long _peers) { @@ -65,7 +65,7 @@ public class MessageRouter : CommonBase { bindings.free_buffer(_peers); Result_CVec_BlindedPathZNoneZ ret = arg.create_blinded_paths(_recipient_conv, _peers_conv_8_arr); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } diff --git a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs index fb60dee8..66b8c585 100644 --- a/c_sharp/src/org/ldk/structs/MessageSendEvent.cs +++ b/c_sharp/src/org/ldk/structs/MessageSendEvent.cs @@ -799,7 +799,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendAcceptChannel-variant MessageSendEvent */ public static MessageSendEvent send_accept_channel(byte[] node_id, org.ldk.structs.AcceptChannel msg) { - long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_accept_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -813,7 +813,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendAcceptChannelV2-variant MessageSendEvent */ public static MessageSendEvent send_accept_channel_v2(byte[] node_id, org.ldk.structs.AcceptChannelV2 msg) { - long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_accept_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -827,7 +827,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendOpenChannel-variant MessageSendEvent */ public static MessageSendEvent send_open_channel(byte[] node_id, org.ldk.structs.OpenChannel msg) { - long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_open_channel(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -841,7 +841,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendOpenChannelV2-variant MessageSendEvent */ public static MessageSendEvent send_open_channel_v2(byte[] node_id, org.ldk.structs.OpenChannelV2 msg) { - long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_open_channel_v2(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -855,7 +855,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendFundingCreated-variant MessageSendEvent */ public static MessageSendEvent send_funding_created(byte[] node_id, org.ldk.structs.FundingCreated msg) { - long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_funding_created(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -869,7 +869,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendFundingSigned-variant MessageSendEvent */ public static MessageSendEvent send_funding_signed(byte[] node_id, org.ldk.structs.FundingSigned msg) { - long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_funding_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -883,7 +883,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendStfu-variant MessageSendEvent */ public static MessageSendEvent send_stfu(byte[] node_id, org.ldk.structs.Stfu msg) { - long ret = bindings.MessageSendEvent_send_stfu(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_stfu(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -897,7 +897,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendSplice-variant MessageSendEvent */ public static MessageSendEvent send_splice(byte[] node_id, org.ldk.structs.Splice msg) { - long ret = bindings.MessageSendEvent_send_splice(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_splice(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -911,7 +911,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendSpliceAck-variant MessageSendEvent */ public static MessageSendEvent send_splice_ack(byte[] node_id, org.ldk.structs.SpliceAck msg) { - long ret = bindings.MessageSendEvent_send_splice_ack(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_splice_ack(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -925,7 +925,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendSpliceLocked-variant MessageSendEvent */ public static MessageSendEvent send_splice_locked(byte[] node_id, org.ldk.structs.SpliceLocked msg) { - long ret = bindings.MessageSendEvent_send_splice_locked(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_splice_locked(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -939,7 +939,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxAddInput-variant MessageSendEvent */ public static MessageSendEvent send_tx_add_input(byte[] node_id, org.ldk.structs.TxAddInput msg) { - long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_add_input(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -953,7 +953,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxAddOutput-variant MessageSendEvent */ public static MessageSendEvent send_tx_add_output(byte[] node_id, org.ldk.structs.TxAddOutput msg) { - long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_add_output(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -967,7 +967,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxRemoveInput-variant MessageSendEvent */ public static MessageSendEvent send_tx_remove_input(byte[] node_id, org.ldk.structs.TxRemoveInput msg) { - long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_remove_input(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -981,7 +981,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxRemoveOutput-variant MessageSendEvent */ public static MessageSendEvent send_tx_remove_output(byte[] node_id, org.ldk.structs.TxRemoveOutput msg) { - long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_remove_output(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -995,7 +995,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxComplete-variant MessageSendEvent */ public static MessageSendEvent send_tx_complete(byte[] node_id, org.ldk.structs.TxComplete msg) { - long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_complete(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1009,7 +1009,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxSignatures-variant MessageSendEvent */ public static MessageSendEvent send_tx_signatures(byte[] node_id, org.ldk.structs.TxSignatures msg) { - long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_signatures(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1023,7 +1023,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxInitRbf-variant MessageSendEvent */ public static MessageSendEvent send_tx_init_rbf(byte[] node_id, org.ldk.structs.TxInitRbf msg) { - long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_init_rbf(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1037,7 +1037,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxAckRbf-variant MessageSendEvent */ public static MessageSendEvent send_tx_ack_rbf(byte[] node_id, org.ldk.structs.TxAckRbf msg) { - long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_ack_rbf(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1051,7 +1051,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendTxAbort-variant MessageSendEvent */ public static MessageSendEvent send_tx_abort(byte[] node_id, org.ldk.structs.TxAbort msg) { - long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_tx_abort(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1065,7 +1065,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendChannelReady-variant MessageSendEvent */ public static MessageSendEvent send_channel_ready(byte[] node_id, org.ldk.structs.ChannelReady msg) { - long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_channel_ready(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1079,7 +1079,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendAnnouncementSignatures-variant MessageSendEvent */ public static MessageSendEvent send_announcement_signatures(byte[] node_id, org.ldk.structs.AnnouncementSignatures msg) { - long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_announcement_signatures(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1093,7 +1093,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new UpdateHTLCs-variant MessageSendEvent */ public static MessageSendEvent update_htlcs(byte[] node_id, org.ldk.structs.CommitmentUpdate updates) { - long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), updates == null ? 0 : updates.ptr); + long ret = bindings.MessageSendEvent_update_htlcs(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), updates.ptr); GC.KeepAlive(node_id); GC.KeepAlive(updates); if (ret >= 0 && ret <= 4096) { return null; } @@ -1107,7 +1107,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendRevokeAndACK-variant MessageSendEvent */ public static MessageSendEvent send_revoke_and_ack(byte[] node_id, org.ldk.structs.RevokeAndACK msg) { - long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_revoke_and_ack(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1121,7 +1121,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendClosingSigned-variant MessageSendEvent */ public static MessageSendEvent send_closing_signed(byte[] node_id, org.ldk.structs.ClosingSigned msg) { - long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_closing_signed(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1135,7 +1135,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendShutdown-variant MessageSendEvent */ public static MessageSendEvent send_shutdown(byte[] node_id, org.ldk.structs.Shutdown msg) { - long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_shutdown(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1149,7 +1149,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendChannelReestablish-variant MessageSendEvent */ public static MessageSendEvent send_channel_reestablish(byte[] node_id, org.ldk.structs.ChannelReestablish msg) { - long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_channel_reestablish(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1163,7 +1163,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendChannelAnnouncement-variant MessageSendEvent */ public static MessageSendEvent send_channel_announcement(byte[] node_id, org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) { - long ret = bindings.MessageSendEvent_send_channel_announcement(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr); + long ret = bindings.MessageSendEvent_send_channel_announcement(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr, update_msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); GC.KeepAlive(update_msg); @@ -1179,7 +1179,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new BroadcastChannelAnnouncement-variant MessageSendEvent */ public static MessageSendEvent broadcast_channel_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.ChannelUpdate update_msg) { - long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg == null ? 0 : msg.ptr, update_msg == null ? 0 : update_msg.ptr); + long ret = bindings.MessageSendEvent_broadcast_channel_announcement(msg.ptr, update_msg.ptr); GC.KeepAlive(msg); GC.KeepAlive(update_msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1194,7 +1194,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new BroadcastChannelUpdate-variant MessageSendEvent */ public static MessageSendEvent broadcast_channel_update(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.MessageSendEvent_broadcast_channel_update(msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_broadcast_channel_update(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); @@ -1207,7 +1207,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new BroadcastNodeAnnouncement-variant MessageSendEvent */ public static MessageSendEvent broadcast_node_announcement(org.ldk.structs.NodeAnnouncement msg) { - long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_broadcast_node_announcement(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MessageSendEvent ret_hu_conv = org.ldk.structs.MessageSendEvent.constr_from_ptr(ret); @@ -1220,7 +1220,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendChannelUpdate-variant MessageSendEvent */ public static MessageSendEvent send_channel_update(byte[] node_id, org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_channel_update(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1248,7 +1248,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendChannelRangeQuery-variant MessageSendEvent */ public static MessageSendEvent send_channel_range_query(byte[] node_id, org.ldk.structs.QueryChannelRange msg) { - long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_channel_range_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1262,7 +1262,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendShortIdsQuery-variant MessageSendEvent */ public static MessageSendEvent send_short_ids_query(byte[] node_id, org.ldk.structs.QueryShortChannelIds msg) { - long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_short_ids_query(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1276,7 +1276,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendReplyChannelRange-variant MessageSendEvent */ public static MessageSendEvent send_reply_channel_range(byte[] node_id, org.ldk.structs.ReplyChannelRange msg) { - long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_reply_channel_range(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -1290,7 +1290,7 @@ public class MessageSendEvent : CommonBase { * Utility method to constructs a new SendGossipTimestampFilter-variant MessageSendEvent */ public static MessageSendEvent send_gossip_timestamp_filter(byte[] node_id, org.ldk.structs.GossipTimestampFilter msg) { - long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.MessageSendEvent_send_gossip_timestamp_filter(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), msg.ptr); GC.KeepAlive(node_id); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs b/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs index 815a5409..5bb12c5b 100644 --- a/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs +++ b/c_sharp/src/org/ldk/structs/MessageSendEventsProvider.cs @@ -36,7 +36,7 @@ public class MessageSendEventsProvider : CommonBase { public long get_and_clear_pending_msg_events() { MessageSendEvent[] ret = arg.get_and_clear_pending_msg_events(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_18 => ret_conv_18 == null ? 0 : ret_conv_18.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_18 => ret_conv_18.clone_ptr())); foreach (MessageSendEvent ret_conv_18 in ret) { if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret_conv_18); }; }; return result; } diff --git a/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs b/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs index e407faf8..3c7de38a 100644 --- a/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs +++ b/c_sharp/src/org/ldk/structs/MinFinalCltvExpiryDelta.cs @@ -75,7 +75,7 @@ public class MinFinalCltvExpiryDelta : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.MinFinalCltvExpiryDelta b) { - bool ret = bindings.MinFinalCltvExpiryDelta_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.MinFinalCltvExpiryDelta_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/MonitorEvent.cs b/c_sharp/src/org/ldk/structs/MonitorEvent.cs index d569d222..dc163a41 100644 --- a/c_sharp/src/org/ldk/structs/MonitorEvent.cs +++ b/c_sharp/src/org/ldk/structs/MonitorEvent.cs @@ -18,8 +18,9 @@ public class MonitorEvent : CommonBase { long raw_ty = bindings.LDKMonitorEvent_ty_from_ptr(ptr); switch (raw_ty) { case 0: return new MonitorEvent_HTLCEvent(ptr); - case 1: return new MonitorEvent_HolderForceClosed(ptr); - case 2: return new MonitorEvent_Completed(ptr); + case 1: return new MonitorEvent_HolderForceClosedWithInfo(ptr); + case 2: return new MonitorEvent_HolderForceClosed(ptr); + case 3: return new MonitorEvent_Completed(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -35,6 +36,35 @@ public class MonitorEvent : CommonBase { this.htlc_event = htlc_event_hu_conv; } } + /** A MonitorEvent of type HolderForceClosedWithInfo */ + public class MonitorEvent_HolderForceClosedWithInfo : MonitorEvent { + /** + * The reason the channel was closed. + */ + public ClosureReason reason; + /** + * The funding outpoint of the channel. + */ + public OutPoint outpoint; + /** + * The channel ID of the channel. + */ + public ChannelId channel_id; + internal MonitorEvent_HolderForceClosedWithInfo(long ptr) : base(null, ptr) { + long reason = bindings.LDKMonitorEvent_HolderForceClosedWithInfo_get_reason(ptr); + org.ldk.structs.ClosureReason reason_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(reason); + if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.AddLast(this); }; + this.reason = reason_hu_conv; + long outpoint = bindings.LDKMonitorEvent_HolderForceClosedWithInfo_get_outpoint(ptr); + org.ldk.structs.OutPoint outpoint_hu_conv = null; if (outpoint < 0 || outpoint > 4096) { outpoint_hu_conv = new org.ldk.structs.OutPoint(null, outpoint); } + if (outpoint_hu_conv != null) { outpoint_hu_conv.ptrs_to.AddLast(this); }; + this.outpoint = outpoint_hu_conv; + long channel_id = bindings.LDKMonitorEvent_HolderForceClosedWithInfo_get_channel_id(ptr); + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; + } + } /** A MonitorEvent of type HolderForceClosed */ public class MonitorEvent_HolderForceClosed : MonitorEvent { public OutPoint holder_force_closed; @@ -51,6 +81,10 @@ public class MonitorEvent : CommonBase { * The funding outpoint of the [`ChannelMonitor`] that was updated */ public OutPoint funding_txo; + /** + * The channel ID of the channel associated with the [`ChannelMonitor`] + */ + public ChannelId channel_id; /** * The Update ID from [`ChannelMonitorUpdate::update_id`] which was applied or * [`ChannelMonitor::get_latest_update_id`]. @@ -64,6 +98,10 @@ public class MonitorEvent : CommonBase { org.ldk.structs.OutPoint funding_txo_hu_conv = null; if (funding_txo < 0 || funding_txo > 4096) { funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, funding_txo); } if (funding_txo_hu_conv != null) { funding_txo_hu_conv.ptrs_to.AddLast(this); }; this.funding_txo = funding_txo_hu_conv; + long channel_id = bindings.LDKMonitorEvent_Completed_get_channel_id(ptr); + org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); } + if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.AddLast(this); }; + this.channel_id = channel_id_hu_conv; this.monitor_update_id = bindings.LDKMonitorEvent_Completed_get_monitor_update_id(ptr); } } @@ -89,7 +127,7 @@ public class MonitorEvent : CommonBase { * Utility method to constructs a new HTLCEvent-variant MonitorEvent */ public static MonitorEvent htlcevent(org.ldk.structs.HTLCUpdate a) { - long ret = bindings.MonitorEvent_htlcevent(a == null ? 0 : a.ptr); + long ret = bindings.MonitorEvent_htlcevent(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); @@ -98,11 +136,28 @@ public class MonitorEvent : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new HolderForceClosedWithInfo-variant MonitorEvent + */ + public static MonitorEvent holder_force_closed_with_info(org.ldk.structs.ClosureReason reason, org.ldk.structs.OutPoint outpoint, org.ldk.structs.ChannelId channel_id) { + long ret = bindings.MonitorEvent_holder_force_closed_with_info(reason.ptr, outpoint.ptr, channel_id.ptr); + GC.KeepAlive(reason); + GC.KeepAlive(outpoint); + GC.KeepAlive(channel_id); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reason); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(outpoint); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new HolderForceClosed-variant MonitorEvent */ public static MonitorEvent holder_force_closed(org.ldk.structs.OutPoint a) { - long ret = bindings.MonitorEvent_holder_force_closed(a == null ? 0 : a.ptr); + long ret = bindings.MonitorEvent_holder_force_closed(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); @@ -114,14 +169,16 @@ public class MonitorEvent : CommonBase { /** * Utility method to constructs a new Completed-variant MonitorEvent */ - public static MonitorEvent completed(org.ldk.structs.OutPoint funding_txo, long monitor_update_id) { - long ret = bindings.MonitorEvent_completed(funding_txo == null ? 0 : funding_txo.ptr, monitor_update_id); + public static MonitorEvent completed(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelId channel_id, long monitor_update_id) { + long ret = bindings.MonitorEvent_completed(funding_txo.ptr, channel_id.ptr, monitor_update_id); GC.KeepAlive(funding_txo); + GC.KeepAlive(channel_id); GC.KeepAlive(monitor_update_id); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.MonitorEvent ret_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_txo); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id); }; return ret_hu_conv; } @@ -130,7 +187,7 @@ public class MonitorEvent : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.MonitorEvent b) { - bool ret = bindings.MonitorEvent_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.MonitorEvent_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs b/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs index 95245380..ec125837 100644 --- a/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs +++ b/c_sharp/src/org/ldk/structs/MonitorUpdateId.cs @@ -51,7 +51,7 @@ public class MonitorUpdateId : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.MonitorUpdateId b) { - bool ret = bindings.MonitorUpdateId_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.MonitorUpdateId_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/NetworkGraph.cs b/c_sharp/src/org/ldk/structs/NetworkGraph.cs index d5d098ac..34fcb9e4 100644 --- a/c_sharp/src/org/ldk/structs/NetworkGraph.cs +++ b/c_sharp/src/org/ldk/structs/NetworkGraph.cs @@ -23,7 +23,7 @@ public class NetworkGraph : CommonBase { * [`Event`]: crate::events::Event */ public void handle_network_update(org.ldk.structs.NetworkUpdate network_update) { - bindings.NetworkGraph_handle_network_update(this.ptr, network_update == null ? 0 : network_update.ptr); + bindings.NetworkGraph_handle_network_update(this.ptr, network_update.ptr); GC.KeepAlive(this); GC.KeepAlive(network_update); } @@ -121,7 +121,7 @@ public class NetworkGraph : CommonBase { * routing messages from a source using a protocol other than the lightning P2P protocol. */ public Result_NoneLightningErrorZ update_node_from_announcement(org.ldk.structs.NodeAnnouncement msg) { - long ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkGraph_update_node_from_announcement(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -137,7 +137,7 @@ public class NetworkGraph : CommonBase { * peers. */ public Result_NoneLightningErrorZ update_node_from_unsigned_announcement(org.ldk.structs.UnsignedNodeAnnouncement msg) { - long ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkGraph_update_node_from_unsigned_announcement(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -157,7 +157,7 @@ public class NetworkGraph : CommonBase { * the corresponding UTXO exists on chain and is correctly-formatted. */ public Result_NoneLightningErrorZ update_channel_from_announcement(org.ldk.structs.ChannelAnnouncement msg, org.ldk.structs.Option_UtxoLookupZ utxo_lookup) { - long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg == null ? 0 : msg.ptr, utxo_lookup.ptr); + long ret = bindings.NetworkGraph_update_channel_from_announcement(this.ptr, msg.ptr, utxo_lookup.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); GC.KeepAlive(utxo_lookup); @@ -178,7 +178,7 @@ public class NetworkGraph : CommonBase { * This will skip verification of if the channel is actually on-chain. */ public Result_NoneLightningErrorZ update_channel_from_announcement_no_lookup(org.ldk.structs.ChannelAnnouncement msg) { - long ret = bindings.NetworkGraph_update_channel_from_announcement_no_lookup(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkGraph_update_channel_from_announcement_no_lookup(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -196,7 +196,7 @@ public class NetworkGraph : CommonBase { * the corresponding UTXO exists on chain and is correctly-formatted. */ public Result_NoneLightningErrorZ update_channel_from_unsigned_announcement(org.ldk.structs.UnsignedChannelAnnouncement msg, org.ldk.structs.Option_UtxoLookupZ utxo_lookup) { - long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg == null ? 0 : msg.ptr, utxo_lookup.ptr); + long ret = bindings.NetworkGraph_update_channel_from_unsigned_announcement(this.ptr, msg.ptr, utxo_lookup.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); GC.KeepAlive(utxo_lookup); @@ -216,7 +216,7 @@ public class NetworkGraph : CommonBase { * All other parameters as used in [`msgs::UnsignedChannelAnnouncement`] fields. */ public Result_NoneLightningErrorZ add_channel_from_partial_announcement(long short_channel_id, long timestamp, org.ldk.structs.ChannelFeatures features, byte[] node_id_1, byte[] node_id_2) { - long ret = bindings.NetworkGraph_add_channel_from_partial_announcement(this.ptr, short_channel_id, timestamp, features == null ? 0 : features.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_1, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_2, 33))); + long ret = bindings.NetworkGraph_add_channel_from_partial_announcement(this.ptr, short_channel_id, timestamp, features.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_1, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id_2, 33))); GC.KeepAlive(this); GC.KeepAlive(short_channel_id); GC.KeepAlive(timestamp); @@ -306,7 +306,7 @@ public class NetworkGraph : CommonBase { * materially in the future will be rejected. */ public Result_NoneLightningErrorZ update_channel(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.NetworkGraph_update_channel(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkGraph_update_channel(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -324,7 +324,7 @@ public class NetworkGraph : CommonBase { * materially in the future will be rejected. */ public Result_NoneLightningErrorZ update_channel_unsigned(org.ldk.structs.UnsignedChannelUpdate msg) { - long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkGraph_update_channel_unsigned(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -342,7 +342,7 @@ public class NetworkGraph : CommonBase { * materially in the future will be rejected. */ public Result_NoneLightningErrorZ verify_channel_update(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.NetworkGraph_verify_channel_update(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkGraph_verify_channel_update(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/NetworkUpdate.cs b/c_sharp/src/org/ldk/structs/NetworkUpdate.cs index 44ba3641..8642d16a 100644 --- a/c_sharp/src/org/ldk/structs/NetworkUpdate.cs +++ b/c_sharp/src/org/ldk/structs/NetworkUpdate.cs @@ -97,7 +97,7 @@ public class NetworkUpdate : CommonBase { * Utility method to constructs a new ChannelUpdateMessage-variant NetworkUpdate */ public static NetworkUpdate channel_update_message(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.NetworkUpdate_channel_update_message(msg == null ? 0 : msg.ptr); + long ret = bindings.NetworkUpdate_channel_update_message(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.NetworkUpdate ret_hu_conv = org.ldk.structs.NetworkUpdate.constr_from_ptr(ret); @@ -137,7 +137,7 @@ public class NetworkUpdate : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.NetworkUpdate b) { - bool ret = bindings.NetworkUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.NetworkUpdate_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/NextMessageHop.cs b/c_sharp/src/org/ldk/structs/NextMessageHop.cs new file mode 100644 index 00000000..70935c3c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/NextMessageHop.cs @@ -0,0 +1,115 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The next hop to forward an onion message along its path. + * + * Note that payment blinded paths always specify their next hop using an explicit node id. + */ +public class NextMessageHop : CommonBase { + protected NextMessageHop(object _dummy, long ptr) : base(ptr) { } + ~NextMessageHop() { + if (ptr != 0) { bindings.NextMessageHop_free(ptr); } + } + + internal static NextMessageHop constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKNextMessageHop_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new NextMessageHop_NodeId(ptr); + case 1: return new NextMessageHop_ShortChannelId(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A NextMessageHop of type NodeId */ + public class NextMessageHop_NodeId : NextMessageHop { + public byte[] node_id; + internal NextMessageHop_NodeId(long ptr) : base(null, ptr) { + long node_id = bindings.LDKNextMessageHop_NodeId_get_node_id(ptr); + byte[] node_id_conv = InternalUtils.decodeUint8Array(node_id); + this.node_id = node_id_conv; + } + } + /** A NextMessageHop of type ShortChannelId */ + public class NextMessageHop_ShortChannelId : NextMessageHop { + public long short_channel_id; + internal NextMessageHop_ShortChannelId(long ptr) : base(null, ptr) { + this.short_channel_id = bindings.LDKNextMessageHop_ShortChannelId_get_short_channel_id(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.NextMessageHop_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the NextMessageHop + */ + public NextMessageHop clone() { + long ret = bindings.NextMessageHop_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NextMessageHop ret_hu_conv = org.ldk.structs.NextMessageHop.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new NodeId-variant NextMessageHop + */ + public static NextMessageHop node_id(byte[] a) { + long ret = bindings.NextMessageHop_node_id(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33))); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NextMessageHop ret_hu_conv = org.ldk.structs.NextMessageHop.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new ShortChannelId-variant NextMessageHop + */ + public static NextMessageHop short_channel_id(long a) { + long ret = bindings.NextMessageHop_short_channel_id(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.NextMessageHop ret_hu_conv = org.ldk.structs.NextMessageHop.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the NextMessageHop. + */ + public long hash() { + long ret = bindings.NextMessageHop_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two NextMessageHops contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.NextMessageHop b) { + bool ret = bindings.NextMessageHop_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is NextMessageHop)) return false; + return this.eq((NextMessageHop)o); + } +} +} } } diff --git a/c_sharp/src/org/ldk/structs/NodeAlias.cs b/c_sharp/src/org/ldk/structs/NodeAlias.cs index 8121cf14..8eaed432 100644 --- a/c_sharp/src/org/ldk/structs/NodeAlias.cs +++ b/c_sharp/src/org/ldk/structs/NodeAlias.cs @@ -80,7 +80,7 @@ public class NodeAlias : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.NodeAlias b) { - bool ret = bindings.NodeAlias_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.NodeAlias_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs index ae331955..26d28c70 100644 --- a/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncement.cs @@ -53,7 +53,7 @@ public class NodeAnnouncement : CommonBase { * The actual content of the announcement */ public void set_contents(org.ldk.structs.UnsignedNodeAnnouncement val) { - bindings.NodeAnnouncement_set_contents(this.ptr, val == null ? 0 : val.ptr); + bindings.NodeAnnouncement_set_contents(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -63,7 +63,7 @@ public class NodeAnnouncement : CommonBase { * Constructs a new NodeAnnouncement given each field */ public static NodeAnnouncement of(byte[] signature_arg, org.ldk.structs.UnsignedNodeAnnouncement contents_arg) { - long ret = bindings.NodeAnnouncement_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), contents_arg == null ? 0 : contents_arg.ptr); + long ret = bindings.NodeAnnouncement_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signature_arg, 64)), contents_arg.ptr); GC.KeepAlive(signature_arg); GC.KeepAlive(contents_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -109,7 +109,7 @@ public class NodeAnnouncement : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.NodeAnnouncement b) { - bool ret = bindings.NodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.NodeAnnouncement_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs b/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs index e1a6e022..b44a9b98 100644 --- a/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeAnnouncementInfo.cs @@ -31,7 +31,7 @@ public class NodeAnnouncementInfo : CommonBase { * Protocol features the node announced support for */ public void set_features(org.ldk.structs.NodeFeatures val) { - bindings.NodeAnnouncementInfo_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.NodeAnnouncementInfo_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -97,7 +97,7 @@ public class NodeAnnouncementInfo : CommonBase { * should not be exposed to the user. */ public void set_alias(org.ldk.structs.NodeAlias val) { - bindings.NodeAnnouncementInfo_set_alias(this.ptr, val == null ? 0 : val.ptr); + bindings.NodeAnnouncementInfo_set_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -141,7 +141,7 @@ public class NodeAnnouncementInfo : CommonBase { * Note that announcement_message_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static NodeAnnouncementInfo of(org.ldk.structs.NodeFeatures features_arg, int last_update_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, org.ldk.structs.NodeAnnouncement announcement_message_arg) { - long ret = bindings.NodeAnnouncementInfo_new(features_arg == null ? 0 : features_arg.ptr, last_update_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(rgb_arg, 3)), alias_arg == null ? 0 : alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr); + long ret = bindings.NodeAnnouncementInfo_new(features_arg.ptr, last_update_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(rgb_arg, 3)), alias_arg.ptr, announcement_message_arg == null ? 0 : announcement_message_arg.ptr); GC.KeepAlive(features_arg); GC.KeepAlive(last_update_arg); GC.KeepAlive(rgb_arg); @@ -180,7 +180,7 @@ public class NodeAnnouncementInfo : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.NodeAnnouncementInfo b) { - bool ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.NodeAnnouncementInfo_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/NodeFeatures.cs b/c_sharp/src/org/ldk/structs/NodeFeatures.cs index 32eaf48f..38871aba 100644 --- a/c_sharp/src/org/ldk/structs/NodeFeatures.cs +++ b/c_sharp/src/org/ldk/structs/NodeFeatures.cs @@ -21,7 +21,7 @@ public class NodeFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.NodeFeatures b) { - bool ret = bindings.NodeFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.NodeFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class NodeFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.NodeFeatures other) { - bool ret = bindings.NodeFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.NodeFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; @@ -800,5 +800,39 @@ public class NodeFeatures : CommonBase { return ret; } + /** + * Set this feature as optional. + */ + public void set_trampoline_routing_optional() { + bindings.NodeFeatures_set_trampoline_routing_optional(this.ptr); + GC.KeepAlive(this); + } + + /** + * Set this feature as required. + */ + public void set_trampoline_routing_required() { + bindings.NodeFeatures_set_trampoline_routing_required(this.ptr); + GC.KeepAlive(this); + } + + /** + * Checks if this feature is supported. + */ + public bool supports_trampoline_routing() { + bool ret = bindings.NodeFeatures_supports_trampoline_routing(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Checks if this feature is required. + */ + public bool requires_trampoline_routing() { + bool ret = bindings.NodeFeatures_requires_trampoline_routing(this.ptr); + GC.KeepAlive(this); + return ret; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/NodeId.cs b/c_sharp/src/org/ldk/structs/NodeId.cs index b5b0522c..c994ad56 100644 --- a/c_sharp/src/org/ldk/structs/NodeId.cs +++ b/c_sharp/src/org/ldk/structs/NodeId.cs @@ -45,6 +45,17 @@ public class NodeId : CommonBase { return ret_hu_conv; } + /** + * Create a new NodeId from a slice of bytes + */ + public static Result_NodeIdDecodeErrorZ from_slice(byte[] bytes) { + long ret = bindings.NodeId_from_slice(InternalUtils.encodeUint8Array(bytes)); + GC.KeepAlive(bytes); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + /** * Get the public key slice from this NodeId */ diff --git a/c_sharp/src/org/ldk/structs/NodeIdLookUp.cs b/c_sharp/src/org/ldk/structs/NodeIdLookUp.cs new file mode 100644 index 00000000..42250287 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/NodeIdLookUp.cs @@ -0,0 +1,85 @@ + +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + + +/** An implementation of NodeIdLookUp */ +public interface NodeIdLookUpInterface { + /**Returns the node id of the forwarding node's channel counterparty with `short_channel_id`. + * + * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized + * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers. + * + * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + byte[] next_node_id(long short_channel_id); +} + +/** + * An interface for looking up the node id of a channel counterparty for the purpose of forwarding + * an [`OnionMessage`]. + * + * [`OnionMessage`]: crate::ln::msgs::OnionMessage + */ +public class NodeIdLookUp : CommonBase { + internal bindings.LDKNodeIdLookUp bindings_instance; + internal long instance_idx; + + internal NodeIdLookUp(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + ~NodeIdLookUp() { + if (ptr != 0) { bindings.NodeIdLookUp_free(ptr); } + } + + private class LDKNodeIdLookUpHolder { internal NodeIdLookUp held; } + private class LDKNodeIdLookUpImpl : bindings.LDKNodeIdLookUp { + internal LDKNodeIdLookUpImpl(NodeIdLookUpInterface arg, LDKNodeIdLookUpHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private NodeIdLookUpInterface arg; + private LDKNodeIdLookUpHolder impl_holder; + public long next_node_id(long _short_channel_id) { + byte[] ret = arg.next_node_id(_short_channel_id); + GC.KeepAlive(arg); + long result = InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(ret, 33)); + return result; + } + } + + /** Creates a new instance of NodeIdLookUp from a given implementation */ + public static NodeIdLookUp new_impl(NodeIdLookUpInterface arg) { + LDKNodeIdLookUpHolder impl_holder = new LDKNodeIdLookUpHolder(); + LDKNodeIdLookUpImpl impl = new LDKNodeIdLookUpImpl(arg, impl_holder); + long[] ptr_idx = bindings.LDKNodeIdLookUp_new(impl); + + impl_holder.held = new NodeIdLookUp(null, ptr_idx[0]); + impl_holder.held.instance_idx = ptr_idx[1]; + impl_holder.held.bindings_instance = impl; + return impl_holder.held; + } + + /** + * Returns the node id of the forwarding node's channel counterparty with `short_channel_id`. + * + * Here, the forwarding node is referring to the node of the [`OnionMessenger`] parameterized + * by the [`NodeIdLookUp`] and the counterparty to one of that node's peers. + * + * [`OnionMessenger`]: crate::onion_message::messenger::OnionMessenger + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public byte[] next_node_id(long short_channel_id) { + long ret = bindings.NodeIdLookUp_next_node_id(this.ptr, short_channel_id); + GC.KeepAlive(this); + GC.KeepAlive(short_channel_id); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/NodeInfo.cs b/c_sharp/src/org/ldk/structs/NodeInfo.cs index 78bb6190..2f1c0a22 100644 --- a/c_sharp/src/org/ldk/structs/NodeInfo.cs +++ b/c_sharp/src/org/ldk/structs/NodeInfo.cs @@ -107,7 +107,7 @@ public class NodeInfo : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.NodeInfo b) { - bool ret = bindings.NodeInfo_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.NodeInfo_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -118,6 +118,15 @@ public class NodeInfo : CommonBase { if (!(o is NodeInfo)) return false; return this.eq((NodeInfo)o); } + /** + * Returns whether the node has only announced Tor addresses. + */ + public bool is_tor_only() { + bool ret = bindings.NodeInfo_is_tor_only(this.ptr); + GC.KeepAlive(this); + return ret; + } + /** * Serialize the NodeInfo object into a byte array which can be read by NodeInfo_read */ diff --git a/c_sharp/src/org/ldk/structs/NodeSigner.cs b/c_sharp/src/org/ldk/structs/NodeSigner.cs index 033f93ac..f5f001b9 100644 --- a/c_sharp/src/org/ldk/structs/NodeSigner.cs +++ b/c_sharp/src/org/ldk/structs/NodeSigner.cs @@ -114,7 +114,7 @@ public class NodeSigner : CommonBase { public long get_node_id(Recipient _recipient) { Result_PublicKeyNoneZ ret = arg.get_node_id(_recipient); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long ecdh(Recipient _recipient, long _other_key, long _tweak) { @@ -123,7 +123,7 @@ public class NodeSigner : CommonBase { if (_tweak_hu_conv != null) { _tweak_hu_conv.ptrs_to.AddLast(this); }; Result_ThirtyTwoBytesNoneZ ret = arg.ecdh(_recipient, _other_key_conv, _tweak_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_invoice(long _hrp_bytes, long _invoice_data, Recipient _recipient) { @@ -138,21 +138,21 @@ public class NodeSigner : CommonBase { bindings.free_buffer(_invoice_data); Result_RecoverableSignatureNoneZ ret = arg.sign_invoice(_hrp_bytes_conv, _invoice_data_conv_7_arr, _recipient); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_bolt12_invoice_request(long _invoice_request) { org.ldk.structs.UnsignedInvoiceRequest _invoice_request_hu_conv = null; if (_invoice_request < 0 || _invoice_request > 4096) { _invoice_request_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, _invoice_request); } Result_SchnorrSignatureNoneZ ret = arg.sign_bolt12_invoice_request(_invoice_request_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_bolt12_invoice(long _invoice) { org.ldk.structs.UnsignedBolt12Invoice _invoice_hu_conv = null; if (_invoice < 0 || _invoice > 4096) { _invoice_hu_conv = new org.ldk.structs.UnsignedBolt12Invoice(null, _invoice); } Result_SchnorrSignatureNoneZ ret = arg.sign_bolt12_invoice(_invoice_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_gossip_message(long _msg) { @@ -160,7 +160,7 @@ public class NodeSigner : CommonBase { if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); }; Result_ECDSASignatureNoneZ ret = arg.sign_gossip_message(_msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -273,7 +273,7 @@ public class NodeSigner : CommonBase { * [`TaggedHash`]: crate::offers::merkle::TaggedHash */ public Result_SchnorrSignatureNoneZ sign_bolt12_invoice_request(org.ldk.structs.UnsignedInvoiceRequest invoice_request) { - long ret = bindings.NodeSigner_sign_bolt12_invoice_request(this.ptr, invoice_request == null ? 0 : invoice_request.ptr); + long ret = bindings.NodeSigner_sign_bolt12_invoice_request(this.ptr, invoice_request.ptr); GC.KeepAlive(this); GC.KeepAlive(invoice_request); if (ret >= 0 && ret <= 4096) { return null; } @@ -296,7 +296,7 @@ public class NodeSigner : CommonBase { * [`TaggedHash`]: crate::offers::merkle::TaggedHash */ public Result_SchnorrSignatureNoneZ sign_bolt12_invoice(org.ldk.structs.UnsignedBolt12Invoice invoice) { - long ret = bindings.NodeSigner_sign_bolt12_invoice(this.ptr, invoice == null ? 0 : invoice.ptr); + long ret = bindings.NodeSigner_sign_bolt12_invoice(this.ptr, invoice.ptr); GC.KeepAlive(this); GC.KeepAlive(invoice); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/Offer.cs b/c_sharp/src/org/ldk/structs/Offer.cs index 8ff67b8a..61159556 100644 --- a/c_sharp/src/org/ldk/structs/Offer.cs +++ b/c_sharp/src/org/ldk/structs/Offer.cs @@ -80,14 +80,12 @@ public class Offer : CommonBase { /** * The minimum amount required for a successful payment of a single item. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Amount amount() { + public Option_AmountZ amount() { long ret = bindings.Offer_amount(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -95,6 +93,8 @@ public class Offer : CommonBase { /** * A complete description of the purpose of the payment. Intended to be displayed to the user * but with the caveat that it has not been verified in any way. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public PrintableString description() { long ret = bindings.Offer_description(this.ptr); @@ -173,13 +173,15 @@ public class Offer : CommonBase { long ret = bindings.Offer_supported_quantity(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** * The public key used by the recipient to sign invoices. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public byte[] signing_pubkey() { long ret = bindings.Offer_signing_pubkey(this.ptr); @@ -189,6 +191,18 @@ public class Offer : CommonBase { return ret_conv; } + /** + * Returns the id of the offer. + */ + public OfferId id() { + long ret = bindings.Offer_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Returns whether the given chain is supported by the offer. */ @@ -239,6 +253,95 @@ public class Offer : CommonBase { return ret; } + /** + * Similar to [`Offer::request_invoice`] except it: + * - derives the [`InvoiceRequest::payer_id`] such that a different key can be used for each + * request, + * - sets [`InvoiceRequest::payer_metadata`] when [`InvoiceRequestBuilder::build`] is called + * such that it can be used by [`Bolt12Invoice::verify`] to determine if the invoice was + * requested using a base [`ExpandedKey`] from which the payer id was derived, and + * - includes the [`PaymentId`] encrypted in [`InvoiceRequest::payer_metadata`] so that it can + * be used when sending the payment for the requested invoice. + * + * Useful to protect the sender's privacy. + * + * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id + * [`InvoiceRequest::payer_metadata`]: crate::offers::invoice_request::InvoiceRequest::payer_metadata + * [`Bolt12Invoice::verify`]: crate::offers::invoice::Bolt12Invoice::verify + * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey + */ + public Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_payer_id(org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source, byte[] payment_id) { + long ret = bindings.Offer_request_invoice_deriving_payer_id(this.ptr, expanded_key.ptr, entropy_source.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + GC.KeepAlive(this); + GC.KeepAlive(expanded_key); + GC.KeepAlive(entropy_source); + GC.KeepAlive(payment_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(expanded_key); }; + if (this != null) { this.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Similar to [`Offer::request_invoice_deriving_payer_id`] except uses `payer_id` for the + * [`InvoiceRequest::payer_id`] instead of deriving a different key for each request. + * + * Useful for recurring payments using the same `payer_id` with different invoices. + * + * [`InvoiceRequest::payer_id`]: crate::offers::invoice_request::InvoiceRequest::payer_id + */ + public Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ request_invoice_deriving_metadata(byte[] payer_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source, byte[] payment_id) { + long ret = bindings.Offer_request_invoice_deriving_metadata(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer_id, 33)), expanded_key.ptr, entropy_source.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + GC.KeepAlive(this); + GC.KeepAlive(payer_id); + GC.KeepAlive(expanded_key); + GC.KeepAlive(entropy_source); + GC.KeepAlive(payment_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(expanded_key); }; + if (this != null) { this.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Creates an [`InvoiceRequestBuilder`] for the offer with the given `metadata` and `payer_id`, + * which will be reflected in the `Bolt12Invoice` response. + * + * The `metadata` is useful for including information about the derivation of `payer_id` such + * that invoice response handling can be stateless. Also serves as payer-provided entropy while + * hashing in the signature calculation. + * + * This should not leak any information such as by using a simple BIP-32 derivation path. + * Otherwise, payments may be correlated. + * + * Errors if the offer contains unknown required features. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ request_invoice(byte[] metadata, byte[] payer_id) { + long ret = bindings.Offer_request_invoice(this.ptr, InternalUtils.encodeUint8Array(metadata), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer_id, 33))); + GC.KeepAlive(this); + GC.KeepAlive(metadata); + GC.KeepAlive(payer_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the Offer. + */ + public long hash() { + long ret = bindings.Offer_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Serialize the Offer object into a byte array which can be read by Offer_read */ diff --git a/c_sharp/src/org/ldk/structs/OfferFeatures.cs b/c_sharp/src/org/ldk/structs/OfferFeatures.cs index 8e6af54b..d72a7ad0 100644 --- a/c_sharp/src/org/ldk/structs/OfferFeatures.cs +++ b/c_sharp/src/org/ldk/structs/OfferFeatures.cs @@ -21,7 +21,7 @@ public class OfferFeatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.OfferFeatures b) { - bool ret = bindings.OfferFeatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.OfferFeatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -77,7 +77,7 @@ public class OfferFeatures : CommonBase { * Returns true if this `Features` object contains required features unknown by `other`. */ public bool requires_unknown_bits_from(org.ldk.structs.OfferFeatures other) { - bool ret = bindings.OfferFeatures_requires_unknown_bits_from(this.ptr, other == null ? 0 : other.ptr); + bool ret = bindings.OfferFeatures_requires_unknown_bits_from(this.ptr, other.ptr); GC.KeepAlive(this); GC.KeepAlive(other); if (this != null) { this.ptrs_to.AddLast(other); }; diff --git a/c_sharp/src/org/ldk/structs/OfferId.cs b/c_sharp/src/org/ldk/structs/OfferId.cs new file mode 100644 index 00000000..215e9b54 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OfferId.cs @@ -0,0 +1,102 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An identifier for an [`Offer`] built using [`DerivedMetadata`]. + */ +public class OfferId : CommonBase { + internal OfferId(object _dummy, long ptr) : base(ptr) { } + ~OfferId() { + if (ptr != 0) { bindings.OfferId_free(ptr); } + } + + public byte[] get_a() { + long ret = bindings.OfferId_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + public void set_a(byte[] val) { + bindings.OfferId_set_a(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new OfferId given each field + */ + public static OfferId of(byte[] a_arg) { + long ret = bindings.OfferId_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a_arg, 32))); + GC.KeepAlive(a_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.OfferId_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OfferId + */ + public OfferId clone() { + long ret = bindings.OfferId_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two OfferIds contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.OfferId b) { + bool ret = bindings.OfferId_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is OfferId)) return false; + return this.eq((OfferId)o); + } + /** + * Serialize the OfferId object into a byte array which can be read by OfferId_read + */ + public byte[] write() { + long ret = bindings.OfferId_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a OfferId from a byte array, created by OfferId_write + */ + public static Result_OfferIdDecodeErrorZ read(byte[] ser) { + long ret = bindings.OfferId_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferIdDecodeErrorZ ret_hu_conv = Result_OfferIdDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs b/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs new file mode 100644 index 00000000..ae8349ab --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OfferWithDerivedMetadataBuilder.cs @@ -0,0 +1,172 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds an [`Offer`] for the \"offer to be paid\" flow. + * + * See [module-level documentation] for usage. + * + * [module-level documentation]: self + */ +public class OfferWithDerivedMetadataBuilder : CommonBase { + internal OfferWithDerivedMetadataBuilder(object _dummy, long ptr) : base(ptr) { } + ~OfferWithDerivedMetadataBuilder() { + if (ptr != 0) { bindings.OfferWithDerivedMetadataBuilder_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.OfferWithDerivedMetadataBuilder_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OfferWithDerivedMetadataBuilder + */ + public OfferWithDerivedMetadataBuilder clone() { + long ret = bindings.OfferWithDerivedMetadataBuilder_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferWithDerivedMetadataBuilder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferWithDerivedMetadataBuilder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Similar to [`OfferBuilder::new`] except, if [`OfferBuilder::path`] is called, the signing + * pubkey is derived from the given [`ExpandedKey`] and [`EntropySource`]. This provides + * recipient privacy by using a different signing pubkey for each offer. Otherwise, the + * provided `node_id` is used for the signing pubkey. + * + * Also, sets the metadata when [`OfferBuilder::build`] is called such that it can be used by + * [`InvoiceRequest::verify`] to determine if the request was produced for the offer given an + * [`ExpandedKey`]. + * + * [`InvoiceRequest::verify`]: crate::offers::invoice_request::InvoiceRequest::verify + * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey + */ + public static OfferWithDerivedMetadataBuilder deriving_signing_pubkey(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.OfferWithDerivedMetadataBuilder_deriving_signing_pubkey(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), expanded_key.ptr, entropy_source.ptr); + GC.KeepAlive(node_id); + GC.KeepAlive(expanded_key); + GC.KeepAlive(entropy_source); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferWithDerivedMetadataBuilder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferWithDerivedMetadataBuilder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(expanded_key); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called, + * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported. + * + * See [`Offer::chains`] on how this relates to the payment currency. + * + * Successive calls to this method will add another chain hash. + */ + public void chain(Network network) { + bindings.OfferWithDerivedMetadataBuilder_chain(this.ptr, network); + GC.KeepAlive(this); + GC.KeepAlive(network); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`]. + * + * Successive calls to this method will override the previous setting. + */ + public void amount_msats(long amount_msats) { + bindings.OfferWithDerivedMetadataBuilder_amount_msats(this.ptr, amount_msats); + GC.KeepAlive(this); + GC.KeepAlive(amount_msats); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has + * already passed is valid and can be checked for using [`Offer::is_expired`]. + * + * Successive calls to this method will override the previous setting. + */ + public void absolute_expiry(long absolute_expiry) { + bindings.OfferWithDerivedMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); + GC.KeepAlive(this); + GC.KeepAlive(absolute_expiry); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::description`]. + * + * Successive calls to this method will override the previous setting. + */ + public void description(string description) { + bindings.OfferWithDerivedMetadataBuilder_description(this.ptr, InternalUtils.encodeString(description)); + GC.KeepAlive(this); + GC.KeepAlive(description); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::issuer`]. + * + * Successive calls to this method will override the previous setting. + */ + public void issuer(string issuer) { + bindings.OfferWithDerivedMetadataBuilder_issuer(this.ptr, InternalUtils.encodeString(issuer)); + GC.KeepAlive(this); + GC.KeepAlive(issuer); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by + * private channels or if [`Offer::signing_pubkey`] is not a public node id. + * + * Successive calls to this method will add another blinded path. Caller is responsible for not + * adding duplicate paths. + */ + public void path(org.ldk.structs.BlindedPath path) { + bindings.OfferWithDerivedMetadataBuilder_path(this.ptr, path.ptr); + GC.KeepAlive(this); + GC.KeepAlive(path); + if (this != null) { this.ptrs_to.AddLast(path); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to + * [`Quantity::One`]. + * + * Successive calls to this method will override the previous setting. + */ + public void supported_quantity(org.ldk.structs.Quantity quantity) { + bindings.OfferWithDerivedMetadataBuilder_supported_quantity(this.ptr, quantity.ptr); + GC.KeepAlive(this); + GC.KeepAlive(quantity); + if (this != null) { this.ptrs_to.AddLast(quantity); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Builds an [`Offer`] from the builder's settings. + */ + public Result_OfferBolt12SemanticErrorZ build() { + long ret = bindings.OfferWithDerivedMetadataBuilder_build(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OfferWithExplicitMetadataBuilder.cs b/c_sharp/src/org/ldk/structs/OfferWithExplicitMetadataBuilder.cs new file mode 100644 index 00000000..23dfa87d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OfferWithExplicitMetadataBuilder.cs @@ -0,0 +1,184 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds an [`Offer`] for the \"offer to be paid\" flow. + * + * See [module-level documentation] for usage. + * + * [module-level documentation]: self + */ +public class OfferWithExplicitMetadataBuilder : CommonBase { + internal OfferWithExplicitMetadataBuilder(object _dummy, long ptr) : base(ptr) { } + ~OfferWithExplicitMetadataBuilder() { + if (ptr != 0) { bindings.OfferWithExplicitMetadataBuilder_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.OfferWithExplicitMetadataBuilder_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OfferWithExplicitMetadataBuilder + */ + public OfferWithExplicitMetadataBuilder clone() { + long ret = bindings.OfferWithExplicitMetadataBuilder_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferWithExplicitMetadataBuilder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferWithExplicitMetadataBuilder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new builder for an offer using the [`Offer::signing_pubkey`] for signing invoices. + * The associated secret key must be remembered while the offer is valid. + * + * Use a different pubkey per offer to avoid correlating offers. + * + * # Note + * + * If constructing an [`Offer`] for use with a [`ChannelManager`], use + * [`ChannelManager::create_offer_builder`] instead of [`OfferBuilder::new`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelManager::create_offer_builder`]: crate::ln::channelmanager::ChannelManager::create_offer_builder + */ + public static OfferWithExplicitMetadataBuilder of(byte[] signing_pubkey) { + long ret = bindings.OfferWithExplicitMetadataBuilder_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(signing_pubkey, 33))); + GC.KeepAlive(signing_pubkey); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferWithExplicitMetadataBuilder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferWithExplicitMetadataBuilder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Sets the [`Offer::metadata`] to the given bytes. + * + * Successive calls to this method will override the previous setting. + */ + public Result_NoneBolt12SemanticErrorZ metadata(byte[] metadata) { + long ret = bindings.OfferWithExplicitMetadataBuilder_metadata(this.ptr, InternalUtils.encodeUint8Array(metadata)); + GC.KeepAlive(this); + GC.KeepAlive(metadata); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneBolt12SemanticErrorZ ret_hu_conv = Result_NoneBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Adds the chain hash of the given [`Network`] to [`Offer::chains`]. If not called, + * the chain hash of [`Network::Bitcoin`] is assumed to be the only one supported. + * + * See [`Offer::chains`] on how this relates to the payment currency. + * + * Successive calls to this method will add another chain hash. + */ + public void chain(Network network) { + bindings.OfferWithExplicitMetadataBuilder_chain(this.ptr, network); + GC.KeepAlive(this); + GC.KeepAlive(network); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::amount`] as an [`Amount::Bitcoin`]. + * + * Successive calls to this method will override the previous setting. + */ + public void amount_msats(long amount_msats) { + bindings.OfferWithExplicitMetadataBuilder_amount_msats(this.ptr, amount_msats); + GC.KeepAlive(this); + GC.KeepAlive(amount_msats); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has + * already passed is valid and can be checked for using [`Offer::is_expired`]. + * + * Successive calls to this method will override the previous setting. + */ + public void absolute_expiry(long absolute_expiry) { + bindings.OfferWithExplicitMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); + GC.KeepAlive(this); + GC.KeepAlive(absolute_expiry); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::description`]. + * + * Successive calls to this method will override the previous setting. + */ + public void description(string description) { + bindings.OfferWithExplicitMetadataBuilder_description(this.ptr, InternalUtils.encodeString(description)); + GC.KeepAlive(this); + GC.KeepAlive(description); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Offer::issuer`]. + * + * Successive calls to this method will override the previous setting. + */ + public void issuer(string issuer) { + bindings.OfferWithExplicitMetadataBuilder_issuer(this.ptr, InternalUtils.encodeString(issuer)); + GC.KeepAlive(this); + GC.KeepAlive(issuer); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Adds a blinded path to [`Offer::paths`]. Must include at least one path if only connected by + * private channels or if [`Offer::signing_pubkey`] is not a public node id. + * + * Successive calls to this method will add another blinded path. Caller is responsible for not + * adding duplicate paths. + */ + public void path(org.ldk.structs.BlindedPath path) { + bindings.OfferWithExplicitMetadataBuilder_path(this.ptr, path.ptr); + GC.KeepAlive(this); + GC.KeepAlive(path); + if (this != null) { this.ptrs_to.AddLast(path); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the quantity of items for [`Offer::supported_quantity`]. If not called, defaults to + * [`Quantity::One`]. + * + * Successive calls to this method will override the previous setting. + */ + public void supported_quantity(org.ldk.structs.Quantity quantity) { + bindings.OfferWithExplicitMetadataBuilder_supported_quantity(this.ptr, quantity.ptr); + GC.KeepAlive(this); + GC.KeepAlive(quantity); + if (this != null) { this.ptrs_to.AddLast(quantity); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Builds an [`Offer`] from the builder's settings. + */ + public Result_OfferBolt12SemanticErrorZ build() { + long ret = bindings.OfferWithExplicitMetadataBuilder_build(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OffersMessage.cs b/c_sharp/src/org/ldk/structs/OffersMessage.cs index 4f146f1e..f5e7b8b8 100644 --- a/c_sharp/src/org/ldk/structs/OffersMessage.cs +++ b/c_sharp/src/org/ldk/structs/OffersMessage.cs @@ -79,7 +79,7 @@ public class OffersMessage : CommonBase { * Utility method to constructs a new InvoiceRequest-variant OffersMessage */ public static OffersMessage invoice_request(org.ldk.structs.InvoiceRequest a) { - long ret = bindings.OffersMessage_invoice_request(a == null ? 0 : a.ptr); + long ret = bindings.OffersMessage_invoice_request(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); @@ -92,7 +92,7 @@ public class OffersMessage : CommonBase { * Utility method to constructs a new Invoice-variant OffersMessage */ public static OffersMessage invoice(org.ldk.structs.Bolt12Invoice a) { - long ret = bindings.OffersMessage_invoice(a == null ? 0 : a.ptr); + long ret = bindings.OffersMessage_invoice(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); @@ -105,7 +105,7 @@ public class OffersMessage : CommonBase { * Utility method to constructs a new InvoiceError-variant OffersMessage */ public static OffersMessage invoice_error(org.ldk.structs.InvoiceError a) { - long ret = bindings.OffersMessage_invoice_error(a == null ? 0 : a.ptr); + long ret = bindings.OffersMessage_invoice_error(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OffersMessage ret_hu_conv = org.ldk.structs.OffersMessage.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs b/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs index 09ccab93..3197fcc6 100644 --- a/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/OffersMessageHandler.cs @@ -50,14 +50,14 @@ public class OffersMessageHandler : CommonBase { if (_message_hu_conv != null) { _message_hu_conv.ptrs_to.AddLast(this); }; Option_OffersMessageZ ret = arg.handle_message(_message_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } public long release_pending_messages() { ThreeTuple_OffersMessageDestinationBlindedPathZ[] ret = arg.release_pending_messages(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_49 => ret_conv_49 == null ? 0 : ret_conv_49.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_49 => ret_conv_49.clone_ptr())); return result; } } diff --git a/c_sharp/src/org/ldk/structs/OnionMessage.cs b/c_sharp/src/org/ldk/structs/OnionMessage.cs index c7e1d4ab..5a809be7 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessage.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessage.cs @@ -51,7 +51,7 @@ public class OnionMessage : CommonBase { * The full onion packet including hop data, pubkey, and hmac */ public void set_onion_routing_packet(org.ldk.structs.Packet val) { - bindings.OnionMessage_set_onion_routing_packet(this.ptr, val == null ? 0 : val.ptr); + bindings.OnionMessage_set_onion_routing_packet(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -61,7 +61,7 @@ public class OnionMessage : CommonBase { * Constructs a new OnionMessage given each field */ public static OnionMessage of(byte[] blinding_point_arg, org.ldk.structs.Packet onion_routing_packet_arg) { - long ret = bindings.OnionMessage_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), onion_routing_packet_arg == null ? 0 : onion_routing_packet_arg.ptr); + long ret = bindings.OnionMessage_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33)), onion_routing_packet_arg.ptr); GC.KeepAlive(blinding_point_arg); GC.KeepAlive(onion_routing_packet_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -107,7 +107,7 @@ public class OnionMessage : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.OnionMessage b) { - bool ret = bindings.OnionMessage_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.OnionMessage_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs b/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs index 30dccb5b..b75211ea 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessageHandler.cs @@ -77,7 +77,7 @@ public class OnionMessageHandler : CommonBase { public long get_and_clear_connections_needed() { TwoTuple_PublicKeyCVec_SocketAddressZZ[] ret = arg.get_and_clear_connections_needed(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_40 => ret_conv_40 == null ? 0 : ret_conv_40.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_40 => ret_conv_40.clone_ptr())); return result; } public void handle_onion_message(long _peer_node_id, long _msg) { @@ -98,7 +98,7 @@ public class OnionMessageHandler : CommonBase { org.ldk.structs.Init _init_hu_conv = null; if (_init < 0 || _init > 4096) { _init_hu_conv = new org.ldk.structs.Init(null, _init); } Result_NoneNoneZ ret = arg.peer_connected(_their_node_id_conv, _init_hu_conv, _inbound); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public void peer_disconnected(long _their_node_id) { @@ -113,14 +113,14 @@ public class OnionMessageHandler : CommonBase { public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long provided_init_features(long _their_node_id) { byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); InitFeatures ret = arg.provided_init_features(_their_node_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -166,7 +166,7 @@ public class OnionMessageHandler : CommonBase { * Handle an incoming `onion_message` message from the given peer. */ public void handle_onion_message(byte[] peer_node_id, org.ldk.structs.OnionMessage msg) { - bindings.OnionMessageHandler_handle_onion_message(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_node_id, 33)), msg == null ? 0 : msg.ptr); + bindings.OnionMessageHandler_handle_onion_message(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(peer_node_id); GC.KeepAlive(msg); @@ -197,7 +197,7 @@ public class OnionMessageHandler : CommonBase { * message handlers may still wish to communicate with this peer. */ public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init, bool inbound) { - long ret = bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), init == null ? 0 : init.ptr, inbound); + long ret = bindings.OnionMessageHandler_peer_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), init.ptr, inbound); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(init); diff --git a/c_sharp/src/org/ldk/structs/OnionMessagePath.cs b/c_sharp/src/org/ldk/structs/OnionMessagePath.cs index f7d573a4..8c825a43 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessagePath.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessagePath.cs @@ -132,6 +132,8 @@ public class OnionMessagePath : CommonBase { /** * Returns the first node in the path. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public byte[] first_node() { long ret = bindings.OnionMessagePath_first_node(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/OnionMessenger.cs b/c_sharp/src/org/ldk/structs/OnionMessenger.cs index 3bf8b6df..56e89563 100644 --- a/c_sharp/src/org/ldk/structs/OnionMessenger.cs +++ b/c_sharp/src/org/ldk/structs/OnionMessenger.cs @@ -30,7 +30,7 @@ namespace org { namespace ldk { namespace structs { * # use bitcoin::hashes::_export::_core::time::Duration; * # use bitcoin::hashes::hex::FromHex; * # use bitcoin::secp256k1::{PublicKey, Secp256k1, SecretKey, self}; - * # use lightning::blinded_path::BlindedPath; + * # use lightning::blinded_path::{BlindedPath, EmptyNodeIdLookUp}; * # use lightning::sign::{EntropySource, KeysManager}; * # use lightning::ln::peer_handler::IgnoringMessageHandler; * # use lightning::onion_message::messenger::{Destination, MessageRouter, OnionMessagePath, OnionMessenger}; @@ -71,14 +71,15 @@ namespace org { namespace ldk { namespace structs { * # let hop_node_id1 = PublicKey::from_secret_key(&secp_ctx, &node_secret); * # let (hop_node_id3, hop_node_id4) = (hop_node_id1, hop_node_id1); * # let destination_node_id = hop_node_id1; + * # let node_id_lookup = EmptyNodeIdLookUp {}; * # let message_router = Arc::new(FakeMessageRouter {}); * # let custom_message_handler = IgnoringMessageHandler {}; * # let offers_message_handler = IgnoringMessageHandler {}; * Create the onion messenger. This must use the same `keys_manager` as is passed to your * ChannelManager. * let onion_messenger = OnionMessenger::new( - * &keys_manager, &keys_manager, logger, message_router, &offers_message_handler, - * &custom_message_handler + * &keys_manager, &keys_manager, logger, &node_id_lookup, message_router, + * &offers_message_handler, &custom_message_handler * ); * * # #[derive(Debug, Clone)] @@ -126,11 +127,12 @@ public class OnionMessenger : CommonBase { * Constructs a new `OnionMessenger` to send, forward, and delegate received onion messages to * their respective handlers. */ - public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.MessageRouter message_router, org.ldk.structs.OffersMessageHandler offers_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { - long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, message_router.ptr, offers_handler.ptr, custom_handler.ptr); + public static OnionMessenger of(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.MessageRouter message_router, org.ldk.structs.OffersMessageHandler offers_handler, org.ldk.structs.CustomOnionMessageHandler custom_handler) { + long ret = bindings.OnionMessenger_new(entropy_source.ptr, node_signer.ptr, logger.ptr, node_id_lookup.ptr, message_router.ptr, offers_handler.ptr, custom_handler.ptr); GC.KeepAlive(entropy_source); GC.KeepAlive(node_signer); GC.KeepAlive(logger); + GC.KeepAlive(node_id_lookup); GC.KeepAlive(message_router); GC.KeepAlive(offers_handler); GC.KeepAlive(custom_handler); @@ -140,6 +142,7 @@ public class OnionMessenger : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_id_lookup); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(message_router); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(offers_handler); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(custom_handler); }; diff --git a/c_sharp/src/org/ldk/structs/OnionPacket.cs b/c_sharp/src/org/ldk/structs/OnionPacket.cs index 06585339..d459051b 100644 --- a/c_sharp/src/org/ldk/structs/OnionPacket.cs +++ b/c_sharp/src/org/ldk/structs/OnionPacket.cs @@ -58,7 +58,7 @@ public class OnionPacket : CommonBase { * like. */ public void set_public_key(org.ldk.structs.Result_PublicKeySecp256k1ErrorZ val) { - bindings.OnionPacket_set_public_key(this.ptr, val != null ? val.ptr : 0); + bindings.OnionPacket_set_public_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); } @@ -119,7 +119,7 @@ public class OnionPacket : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.OnionPacket b) { - bool ret = bindings.OnionPacket_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.OnionPacket_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/OpenChannel.cs b/c_sharp/src/org/ldk/structs/OpenChannel.cs index f46844fb..418bc33e 100644 --- a/c_sharp/src/org/ldk/structs/OpenChannel.cs +++ b/c_sharp/src/org/ldk/structs/OpenChannel.cs @@ -20,61 +20,25 @@ public class OpenChannel : CommonBase { } /** - * The genesis hash of the blockchain where the channel is to be opened + * Common fields of `open_channel(2)`-like messages */ - public byte[] get_chain_hash() { - long ret = bindings.OpenChannel_get_chain_hash(this.ptr); + public CommonOpenChannelFields get_common_fields() { + long ret = bindings.OpenChannel_get_common_fields(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The genesis hash of the blockchain where the channel is to be opened - */ - public void set_chain_hash(byte[] val) { - bindings.OpenChannel_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A temporary channel ID, until the funding outpoint is announced - */ - public byte[] get_temporary_channel_id() { - long ret = bindings.OpenChannel_get_temporary_channel_id(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * A temporary channel ID, until the funding outpoint is announced - */ - public void set_temporary_channel_id(byte[] val) { - bindings.OpenChannel_set_temporary_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The channel value - */ - public long get_funding_satoshis() { - long ret = bindings.OpenChannel_get_funding_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; + org.ldk.structs.CommonOpenChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonOpenChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * The channel value + * Common fields of `open_channel(2)`-like messages */ - public void set_funding_satoshis(long val) { - bindings.OpenChannel_set_funding_satoshis(this.ptr, val); + public void set_common_fields(org.ldk.structs.CommonOpenChannelFields val) { + bindings.OpenChannel_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -95,42 +59,6 @@ public class OpenChannel : CommonBase { GC.KeepAlive(val); } - /** - * The threshold below which outputs on transactions broadcast by sender will be omitted - */ - public long get_dust_limit_satoshis() { - long ret = bindings.OpenChannel_get_dust_limit_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The threshold below which outputs on transactions broadcast by sender will be omitted - */ - public void set_dust_limit_satoshis(long val) { - bindings.OpenChannel_set_dust_limit_satoshis(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum inbound HTLC value in flight towards sender, in milli-satoshi - */ - public long get_max_htlc_value_in_flight_msat() { - long ret = bindings.OpenChannel_get_max_htlc_value_in_flight_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum inbound HTLC value in flight towards sender, in milli-satoshi - */ - public void set_max_htlc_value_in_flight_msat(long val) { - bindings.OpenChannel_set_max_htlc_value_in_flight_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * The minimum value unencumbered by HTLCs for the counterparty to keep in the channel */ @@ -149,306 +77,18 @@ public class OpenChannel : CommonBase { GC.KeepAlive(val); } - /** - * The minimum HTLC size incoming to sender, in milli-satoshi - */ - public long get_htlc_minimum_msat() { - long ret = bindings.OpenChannel_get_htlc_minimum_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The minimum HTLC size incoming to sender, in milli-satoshi - */ - public void set_htlc_minimum_msat(long val) { - bindings.OpenChannel_set_htlc_minimum_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The feerate per 1000-weight of sender generated transactions, until updated by - * [`UpdateFee`] - */ - public int get_feerate_per_kw() { - int ret = bindings.OpenChannel_get_feerate_per_kw(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The feerate per 1000-weight of sender generated transactions, until updated by - * [`UpdateFee`] - */ - public void set_feerate_per_kw(int val) { - bindings.OpenChannel_set_feerate_per_kw(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if - * they broadcast a commitment transaction - */ - public short get_to_self_delay() { - short ret = bindings.OpenChannel_get_to_self_delay(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if - * they broadcast a commitment transaction - */ - public void set_to_self_delay(short val) { - bindings.OpenChannel_set_to_self_delay(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum number of inbound HTLCs towards sender - */ - public short get_max_accepted_htlcs() { - short ret = bindings.OpenChannel_get_max_accepted_htlcs(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum number of inbound HTLCs towards sender - */ - public void set_max_accepted_htlcs(short val) { - bindings.OpenChannel_set_max_accepted_htlcs(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The sender's key controlling the funding transaction - */ - public byte[] get_funding_pubkey() { - long ret = bindings.OpenChannel_get_funding_pubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The sender's key controlling the funding transaction - */ - public void set_funding_pubkey(byte[] val) { - bindings.OpenChannel_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public byte[] get_revocation_basepoint() { - long ret = bindings.OpenChannel_get_revocation_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public void set_revocation_basepoint(byte[] val) { - bindings.OpenChannel_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A payment key to sender for transactions broadcast by counterparty - */ - public byte[] get_payment_point() { - long ret = bindings.OpenChannel_get_payment_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * A payment key to sender for transactions broadcast by counterparty - */ - public void set_payment_point(byte[] val) { - bindings.OpenChannel_set_payment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a payment key to sender for transactions broadcast by sender - */ - public byte[] get_delayed_payment_basepoint() { - long ret = bindings.OpenChannel_get_delayed_payment_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a payment key to sender for transactions broadcast by sender - */ - public void set_delayed_payment_basepoint(byte[] val) { - bindings.OpenChannel_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive an HTLC payment key to sender - */ - public byte[] get_htlc_basepoint() { - long ret = bindings.OpenChannel_get_htlc_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive an HTLC payment key to sender - */ - public void set_htlc_basepoint(byte[] val) { - bindings.OpenChannel_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The first to-be-broadcast-by-sender transaction's per commitment point - */ - public byte[] get_first_per_commitment_point() { - long ret = bindings.OpenChannel_get_first_per_commitment_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The first to-be-broadcast-by-sender transaction's per commitment point - */ - public void set_first_per_commitment_point(byte[] val) { - bindings.OpenChannel_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The channel flags to be used - */ - public byte get_channel_flags() { - byte ret = bindings.OpenChannel_get_channel_flags(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The channel flags to be used - */ - public void set_channel_flags(byte val) { - bindings.OpenChannel_set_channel_flags(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close - */ - public Option_CVec_u8ZZ get_shutdown_scriptpubkey() { - long ret = bindings.OpenChannel_get_shutdown_scriptpubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * A request to pre-set the to-sender output's `scriptPubkey` for when we collaboratively close - */ - public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) { - bindings.OpenChannel_set_shutdown_scriptpubkey(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * The channel type that this channel will represent - * - * If this is `None`, we derive the channel type from the intersection of our - * feature bits with our counterparty's feature bits from the [`Init`] message. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public ChannelTypeFeatures get_channel_type() { - long ret = bindings.OpenChannel_get_channel_type(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The channel type that this channel will represent - * - * If this is `None`, we derive the channel type from the intersection of our - * feature bits with our counterparty's feature bits from the [`Init`] message. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { - bindings.OpenChannel_set_channel_type(this.ptr, val == null ? 0 : val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - /** * Constructs a new OpenChannel given each field - * - * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static OpenChannel of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, long funding_satoshis_arg, long push_msat_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long channel_reserve_satoshis_arg, long htlc_minimum_msat_arg, int feerate_per_kw_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_point_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte channel_flags_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg) { - long ret = bindings.OpenChannel_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id_arg, 32)), 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, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_point_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), channel_flags_arg, shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr); - GC.KeepAlive(chain_hash_arg); - GC.KeepAlive(temporary_channel_id_arg); - GC.KeepAlive(funding_satoshis_arg); + public static OpenChannel of(org.ldk.structs.CommonOpenChannelFields common_fields_arg, long push_msat_arg, long channel_reserve_satoshis_arg) { + long ret = bindings.OpenChannel_new(common_fields_arg.ptr, push_msat_arg, channel_reserve_satoshis_arg); + GC.KeepAlive(common_fields_arg); GC.KeepAlive(push_msat_arg); - GC.KeepAlive(dust_limit_satoshis_arg); - GC.KeepAlive(max_htlc_value_in_flight_msat_arg); GC.KeepAlive(channel_reserve_satoshis_arg); - GC.KeepAlive(htlc_minimum_msat_arg); - GC.KeepAlive(feerate_per_kw_arg); - GC.KeepAlive(to_self_delay_arg); - GC.KeepAlive(max_accepted_htlcs_arg); - GC.KeepAlive(funding_pubkey_arg); - GC.KeepAlive(revocation_basepoint_arg); - GC.KeepAlive(payment_point_arg); - GC.KeepAlive(delayed_payment_basepoint_arg); - GC.KeepAlive(htlc_basepoint_arg); - GC.KeepAlive(first_per_commitment_point_arg); - GC.KeepAlive(channel_flags_arg); - GC.KeepAlive(shutdown_scriptpubkey_arg); - GC.KeepAlive(channel_type_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OpenChannel ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannel(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(common_fields_arg); }; return ret_hu_conv; } @@ -488,7 +128,7 @@ public class OpenChannel : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.OpenChannel b) { - bool ret = bindings.OpenChannel_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.OpenChannel_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/OpenChannelV2.cs b/c_sharp/src/org/ldk/structs/OpenChannelV2.cs index ec182be2..73689945 100644 --- a/c_sharp/src/org/ldk/structs/OpenChannelV2.cs +++ b/c_sharp/src/org/ldk/structs/OpenChannelV2.cs @@ -18,43 +18,25 @@ public class OpenChannelV2 : CommonBase { } /** - * The genesis hash of the blockchain where the channel is to be opened + * Common fields of `open_channel(2)`-like messages */ - public byte[] get_chain_hash() { - long ret = bindings.OpenChannelV2_get_chain_hash(this.ptr); + public CommonOpenChannelFields get_common_fields() { + long ret = bindings.OpenChannelV2_get_common_fields(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The genesis hash of the blockchain where the channel is to be opened - */ - public void set_chain_hash(byte[] val) { - bindings.OpenChannelV2_set_chain_hash(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint - */ - public byte[] get_temporary_channel_id() { - long ret = bindings.OpenChannelV2_get_temporary_channel_id(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.CommonOpenChannelFields ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.CommonOpenChannelFields(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** - * A temporary channel ID derived using a zeroed out value for the channel acceptor's revocation basepoint + * Common fields of `open_channel(2)`-like messages */ - public void set_temporary_channel_id(byte[] val) { - bindings.OpenChannelV2_set_temporary_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_common_fields(org.ldk.structs.CommonOpenChannelFields val) { + bindings.OpenChannelV2_set_common_fields(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -75,136 +57,6 @@ public class OpenChannelV2 : CommonBase { GC.KeepAlive(val); } - /** - * The feerate for the commitment transaction set by the channel initiator - */ - public int get_commitment_feerate_sat_per_1000_weight() { - int ret = bindings.OpenChannelV2_get_commitment_feerate_sat_per_1000_weight(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The feerate for the commitment transaction set by the channel initiator - */ - public void set_commitment_feerate_sat_per_1000_weight(int val) { - bindings.OpenChannelV2_set_commitment_feerate_sat_per_1000_weight(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Part of the channel value contributed by the channel initiator - */ - public long get_funding_satoshis() { - long ret = bindings.OpenChannelV2_get_funding_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Part of the channel value contributed by the channel initiator - */ - public void set_funding_satoshis(long val) { - bindings.OpenChannelV2_set_funding_satoshis(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The threshold below which outputs on transactions broadcast by the channel initiator will be - * omitted - */ - public long get_dust_limit_satoshis() { - long ret = bindings.OpenChannelV2_get_dust_limit_satoshis(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The threshold below which outputs on transactions broadcast by the channel initiator will be - * omitted - */ - public void set_dust_limit_satoshis(long val) { - bindings.OpenChannelV2_set_dust_limit_satoshis(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi - */ - public long get_max_htlc_value_in_flight_msat() { - long ret = bindings.OpenChannelV2_get_max_htlc_value_in_flight_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum inbound HTLC value in flight towards channel initiator, in milli-satoshi - */ - public void set_max_htlc_value_in_flight_msat(long val) { - bindings.OpenChannelV2_set_max_htlc_value_in_flight_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The minimum HTLC size incoming to channel initiator, in milli-satoshi - */ - public long get_htlc_minimum_msat() { - long ret = bindings.OpenChannelV2_get_htlc_minimum_msat(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The minimum HTLC size incoming to channel initiator, in milli-satoshi - */ - public void set_htlc_minimum_msat(long val) { - bindings.OpenChannelV2_set_htlc_minimum_msat(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they - * broadcast a commitment transaction - */ - public short get_to_self_delay() { - short ret = bindings.OpenChannelV2_get_to_self_delay(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The number of blocks which the counterparty will have to wait to claim on-chain funds if they - * broadcast a commitment transaction - */ - public void set_to_self_delay(short val) { - bindings.OpenChannelV2_set_to_self_delay(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The maximum number of inbound HTLCs towards channel initiator - */ - public short get_max_accepted_htlcs() { - short ret = bindings.OpenChannelV2_get_max_accepted_htlcs(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * The maximum number of inbound HTLCs towards channel initiator - */ - public void set_max_accepted_htlcs(short val) { - bindings.OpenChannelV2_set_max_accepted_htlcs(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * The locktime for the funding transaction */ @@ -223,128 +75,6 @@ public class OpenChannelV2 : CommonBase { GC.KeepAlive(val); } - /** - * The channel initiator's key controlling the funding transaction - */ - public byte[] get_funding_pubkey() { - long ret = bindings.OpenChannelV2_get_funding_pubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The channel initiator's key controlling the funding transaction - */ - public void set_funding_pubkey(byte[] val) { - bindings.OpenChannelV2_set_funding_pubkey(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public byte[] get_revocation_basepoint() { - long ret = bindings.OpenChannelV2_get_revocation_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a revocation key for transactions broadcast by counterparty - */ - public void set_revocation_basepoint(byte[] val) { - bindings.OpenChannelV2_set_revocation_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * A payment key to channel initiator for transactions broadcast by counterparty - */ - public byte[] get_payment_basepoint() { - long ret = bindings.OpenChannelV2_get_payment_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * A payment key to channel initiator for transactions broadcast by counterparty - */ - public void set_payment_basepoint(byte[] val) { - bindings.OpenChannelV2_set_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive a payment key to channel initiator for transactions broadcast by channel - * initiator - */ - public byte[] get_delayed_payment_basepoint() { - long ret = bindings.OpenChannelV2_get_delayed_payment_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive a payment key to channel initiator for transactions broadcast by channel - * initiator - */ - public void set_delayed_payment_basepoint(byte[] val) { - bindings.OpenChannelV2_set_delayed_payment_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Used to derive an HTLC payment key to channel initiator - */ - public byte[] get_htlc_basepoint() { - long ret = bindings.OpenChannelV2_get_htlc_basepoint(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * Used to derive an HTLC payment key to channel initiator - */ - public void set_htlc_basepoint(byte[] val) { - bindings.OpenChannelV2_set_htlc_basepoint(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * The first to-be-broadcast-by-channel-initiator transaction's per commitment point - */ - public byte[] get_first_per_commitment_point() { - long ret = bindings.OpenChannelV2_get_first_per_commitment_point(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * The first to-be-broadcast-by-channel-initiator transaction's per commitment point - */ - public void set_first_per_commitment_point(byte[] val) { - bindings.OpenChannelV2_set_first_per_commitment_point(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - /** * The second to-be-broadcast-by-channel-initiator transaction's per commitment point */ @@ -365,78 +95,6 @@ public class OpenChannelV2 : CommonBase { GC.KeepAlive(val); } - /** - * Channel flags - */ - public byte get_channel_flags() { - byte ret = bindings.OpenChannelV2_get_channel_flags(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Channel flags - */ - public void set_channel_flags(byte val) { - bindings.OpenChannelV2_set_channel_flags(this.ptr, val); - GC.KeepAlive(this); - GC.KeepAlive(val); - } - - /** - * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we - * collaboratively close - */ - public Option_CVec_u8ZZ get_shutdown_scriptpubkey() { - long ret = bindings.OpenChannelV2_get_shutdown_scriptpubkey(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_CVec_u8ZZ ret_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Optionally, a request to pre-set the to-channel-initiator output's scriptPubkey for when we - * collaboratively close - */ - public void set_shutdown_scriptpubkey(org.ldk.structs.Option_CVec_u8ZZ val) { - bindings.OpenChannelV2_set_shutdown_scriptpubkey(this.ptr, val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - - /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public ChannelTypeFeatures get_channel_type() { - long ret = bindings.OpenChannelV2_get_channel_type(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.ChannelTypeFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelTypeFeatures(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * The channel type that this channel will represent. If none is set, we derive the channel - * type from the intersection of our feature bits with our counterparty's feature bits from - * the Init message. - * - * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None - */ - public void set_channel_type(org.ldk.structs.ChannelTypeFeatures val) { - bindings.OpenChannelV2_set_channel_type(this.ptr, val == null ? 0 : val.ptr); - GC.KeepAlive(this); - GC.KeepAlive(val); - if (this != null) { this.ptrs_to.AddLast(val); }; - } - /** * Optionally, a requirement that only confirmed inputs can be added */ @@ -457,38 +115,18 @@ public class OpenChannelV2 : CommonBase { /** * Constructs a new OpenChannelV2 given each field - * - * Note that channel_type_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static OpenChannelV2 of(byte[] chain_hash_arg, byte[] temporary_channel_id_arg, int funding_feerate_sat_per_1000_weight_arg, int commitment_feerate_sat_per_1000_weight_arg, long funding_satoshis_arg, long dust_limit_satoshis_arg, long max_htlc_value_in_flight_msat_arg, long htlc_minimum_msat_arg, short to_self_delay_arg, short max_accepted_htlcs_arg, int locktime_arg, byte[] funding_pubkey_arg, byte[] revocation_basepoint_arg, byte[] payment_basepoint_arg, byte[] delayed_payment_basepoint_arg, byte[] htlc_basepoint_arg, byte[] first_per_commitment_point_arg, byte[] second_per_commitment_point_arg, byte channel_flags_arg, org.ldk.structs.Option_CVec_u8ZZ shutdown_scriptpubkey_arg, org.ldk.structs.ChannelTypeFeatures channel_type_arg, COption_NoneZ require_confirmed_inputs_arg) { - long ret = bindings.OpenChannelV2_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(temporary_channel_id_arg, 32)), 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, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(revocation_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(delayed_payment_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_basepoint_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_per_commitment_point_arg, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(second_per_commitment_point_arg, 33)), channel_flags_arg, shutdown_scriptpubkey_arg.ptr, channel_type_arg == null ? 0 : channel_type_arg.ptr, require_confirmed_inputs_arg); - GC.KeepAlive(chain_hash_arg); - GC.KeepAlive(temporary_channel_id_arg); + public static OpenChannelV2 of(org.ldk.structs.CommonOpenChannelFields common_fields_arg, int funding_feerate_sat_per_1000_weight_arg, int locktime_arg, byte[] second_per_commitment_point_arg, COption_NoneZ require_confirmed_inputs_arg) { + long ret = bindings.OpenChannelV2_new(common_fields_arg.ptr, funding_feerate_sat_per_1000_weight_arg, locktime_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(second_per_commitment_point_arg, 33)), require_confirmed_inputs_arg); + GC.KeepAlive(common_fields_arg); GC.KeepAlive(funding_feerate_sat_per_1000_weight_arg); - GC.KeepAlive(commitment_feerate_sat_per_1000_weight_arg); - GC.KeepAlive(funding_satoshis_arg); - GC.KeepAlive(dust_limit_satoshis_arg); - GC.KeepAlive(max_htlc_value_in_flight_msat_arg); - GC.KeepAlive(htlc_minimum_msat_arg); - GC.KeepAlive(to_self_delay_arg); - GC.KeepAlive(max_accepted_htlcs_arg); GC.KeepAlive(locktime_arg); - GC.KeepAlive(funding_pubkey_arg); - GC.KeepAlive(revocation_basepoint_arg); - GC.KeepAlive(payment_basepoint_arg); - GC.KeepAlive(delayed_payment_basepoint_arg); - GC.KeepAlive(htlc_basepoint_arg); - GC.KeepAlive(first_per_commitment_point_arg); GC.KeepAlive(second_per_commitment_point_arg); - GC.KeepAlive(channel_flags_arg); - GC.KeepAlive(shutdown_scriptpubkey_arg); - GC.KeepAlive(channel_type_arg); GC.KeepAlive(require_confirmed_inputs_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.OpenChannelV2 ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OpenChannelV2(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(shutdown_scriptpubkey_arg); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_type_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(common_fields_arg); }; return ret_hu_conv; } @@ -528,7 +166,7 @@ public class OpenChannelV2 : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.OpenChannelV2 b) { - bool ret = bindings.OpenChannelV2_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.OpenChannelV2_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Option_AmountZ.cs b/c_sharp/src/org/ldk/structs/Option_AmountZ.cs new file mode 100644 index 00000000..21bfe561 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_AmountZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::offers::offer::Amount or not + */ +public class Option_AmountZ : CommonBase { + protected Option_AmountZ(object _dummy, long ptr) : base(ptr) { } + ~Option_AmountZ() { + if (ptr != 0) { bindings.COption_AmountZ_free(ptr); } + } + + internal static Option_AmountZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_AmountZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_AmountZ_Some(ptr); + case 1: return new Option_AmountZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_AmountZ of type Some */ + public class Option_AmountZ_Some : Option_AmountZ { + public Amount some; + internal Option_AmountZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_AmountZ_Some_get_some(ptr); + org.ldk.structs.Amount some_hu_conv = org.ldk.structs.Amount.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_AmountZ of type None */ + public class Option_AmountZ_None : Option_AmountZ { + internal Option_AmountZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_AmountZ containing a crate::lightning::offers::offer::Amount + */ + public static Option_AmountZ some(org.ldk.structs.Amount o) { + long ret = bindings.COption_AmountZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_AmountZ containing nothing + */ + public static Option_AmountZ none() { + long ret = bindings.COption_AmountZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_AmountZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_AmountZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_AmountZ clone() { + long ret = bindings.COption_AmountZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_BigEndianScalarZ.cs b/c_sharp/src/org/ldk/structs/Option_BigEndianScalarZ.cs index 1cc7869d..9d271a97 100644 --- a/c_sharp/src/org/ldk/structs/Option_BigEndianScalarZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_BigEndianScalarZ.cs @@ -41,13 +41,12 @@ public class Option_BigEndianScalarZ : CommonBase { /** * Constructs a new COption_BigEndianScalarZ containing a crate::c_types::BigEndianScalar */ - public static Option_BigEndianScalarZ some(byte[] o_big_endian_bytes) { - long ret = bindings.COption_BigEndianScalarZ_some(bindings.BigEndianScalar_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o_big_endian_bytes, 32)))); - GC.KeepAlive(o_big_endian_bytes); + public static Option_BigEndianScalarZ some(org.ldk.structs.BigEndianScalar o) { + long ret = bindings.COption_BigEndianScalarZ_some(o.ptr); + GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_BigEndianScalarZ ret_hu_conv = org.ldk.structs.Option_BigEndianScalarZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - ; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs index d293a8e5..a85bb2fe 100644 --- a/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.cs @@ -43,7 +43,7 @@ public class Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ : CommonBase { * Constructs a new COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ containing a crate::c_types::derived::C2Tuple__u1632_u1632Z */ public static Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ some(org.ldk.structs.TwoTuple__u1632_u1632Z o) { - long ret = bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(o != null ? o.ptr : 0); + long ret = bindings.COption_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u16ZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u16ZZ.cs index fcd352bc..c2a18b3a 100644 --- a/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u16ZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u16ZZ.cs @@ -43,7 +43,7 @@ public class Option_C2Tuple_u64u16ZZ : CommonBase { * Constructs a new COption_C2Tuple_u64u16ZZ containing a crate::c_types::derived::C2Tuple_u64u16Z */ public static Option_C2Tuple_u64u16ZZ some(org.ldk.structs.TwoTuple_u64u16Z o) { - long ret = bindings.COption_C2Tuple_u64u16ZZ_some(o != null ? o.ptr : 0); + long ret = bindings.COption_C2Tuple_u64u16ZZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_C2Tuple_u64u16ZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_u64u16ZZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u64ZZ.cs b/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u64ZZ.cs index 26fda523..f8f8de52 100644 --- a/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u64ZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_C2Tuple_u64u64ZZ.cs @@ -43,7 +43,7 @@ public class Option_C2Tuple_u64u64ZZ : CommonBase { * Constructs a new COption_C2Tuple_u64u64ZZ containing a crate::c_types::derived::C2Tuple_u64u64Z */ public static Option_C2Tuple_u64u64ZZ some(org.ldk.structs.TwoTuple_u64u64Z o) { - long ret = bindings.COption_C2Tuple_u64u64ZZ_some(o != null ? o.ptr : 0); + long ret = bindings.COption_C2Tuple_u64u64ZZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_C2Tuple_u64u64ZZ ret_hu_conv = org.ldk.structs.Option_C2Tuple_u64u64ZZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.cs b/c_sharp/src/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.cs index eb5a9177..a5ee84ff 100644 --- a/c_sharp/src/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.cs +++ b/c_sharp/src/org/ldk/structs/Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.cs @@ -43,7 +43,7 @@ public class Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ : Co * Constructs a new COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ containing a crate::c_types::derived::C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ */ public static Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ some(org.ldk.structs.ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ o) { - long ret = bindings.COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o != null ? o.ptr : 0); + long ret = bindings.COption_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_some(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_hu_conv = org.ldk.structs.Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Option_ECDSASignatureZ.cs b/c_sharp/src/org/ldk/structs/Option_ECDSASignatureZ.cs new file mode 100644 index 00000000..5e00dfb8 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_ECDSASignatureZ.cs @@ -0,0 +1,84 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::c_types::ECDSASignature or not + */ +public class Option_ECDSASignatureZ : CommonBase { + protected Option_ECDSASignatureZ(object _dummy, long ptr) : base(ptr) { } + ~Option_ECDSASignatureZ() { + if (ptr != 0) { bindings.COption_ECDSASignatureZ_free(ptr); } + } + + internal static Option_ECDSASignatureZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_ECDSASignatureZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_ECDSASignatureZ_Some(ptr); + case 1: return new Option_ECDSASignatureZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_ECDSASignatureZ of type Some */ + public class Option_ECDSASignatureZ_Some : Option_ECDSASignatureZ { + public byte[] some; + internal Option_ECDSASignatureZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_ECDSASignatureZ_Some_get_some(ptr); + byte[] some_conv = InternalUtils.decodeUint8Array(some); + this.some = some_conv; + } + } + /** A Option_ECDSASignatureZ of type None */ + public class Option_ECDSASignatureZ_None : Option_ECDSASignatureZ { + internal Option_ECDSASignatureZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_ECDSASignatureZ containing a crate::c_types::ECDSASignature + */ + public static Option_ECDSASignatureZ some(byte[] o) { + long ret = bindings.COption_ECDSASignatureZ_some(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(o, 64))); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ECDSASignatureZ ret_hu_conv = org.ldk.structs.Option_ECDSASignatureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_ECDSASignatureZ containing nothing + */ + public static Option_ECDSASignatureZ none() { + long ret = bindings.COption_ECDSASignatureZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ECDSASignatureZ ret_hu_conv = org.ldk.structs.Option_ECDSASignatureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_ECDSASignatureZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_ECDSASignatureZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_ECDSASignatureZ clone() { + long ret = bindings.COption_ECDSASignatureZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ECDSASignatureZ ret_hu_conv = org.ldk.structs.Option_ECDSASignatureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs b/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs new file mode 100644 index 00000000..115f523a --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_PaymentContextZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::blinded_path::payment::PaymentContext or not + */ +public class Option_PaymentContextZ : CommonBase { + protected Option_PaymentContextZ(object _dummy, long ptr) : base(ptr) { } + ~Option_PaymentContextZ() { + if (ptr != 0) { bindings.COption_PaymentContextZ_free(ptr); } + } + + internal static Option_PaymentContextZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_PaymentContextZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_PaymentContextZ_Some(ptr); + case 1: return new Option_PaymentContextZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_PaymentContextZ of type Some */ + public class Option_PaymentContextZ_Some : Option_PaymentContextZ { + public PaymentContext some; + internal Option_PaymentContextZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_PaymentContextZ_Some_get_some(ptr); + org.ldk.structs.PaymentContext some_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_PaymentContextZ of type None */ + public class Option_PaymentContextZ_None : Option_PaymentContextZ { + internal Option_PaymentContextZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_PaymentContextZ containing a crate::lightning::blinded_path::payment::PaymentContext + */ + public static Option_PaymentContextZ some(org.ldk.structs.PaymentContext o) { + long ret = bindings.COption_PaymentContextZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentContextZ ret_hu_conv = org.ldk.structs.Option_PaymentContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_PaymentContextZ containing nothing + */ + public static Option_PaymentContextZ none() { + long ret = bindings.COption_PaymentContextZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentContextZ ret_hu_conv = org.ldk.structs.Option_PaymentContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_PaymentContextZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_PaymentContextZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_PaymentContextZ clone() { + long ret = bindings.COption_PaymentContextZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_PaymentContextZ ret_hu_conv = org.ldk.structs.Option_PaymentContextZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs b/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs new file mode 100644 index 00000000..20188125 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Option_QuantityZ.cs @@ -0,0 +1,86 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * An enum which can either contain a crate::lightning::offers::offer::Quantity or not + */ +public class Option_QuantityZ : CommonBase { + protected Option_QuantityZ(object _dummy, long ptr) : base(ptr) { } + ~Option_QuantityZ() { + if (ptr != 0) { bindings.COption_QuantityZ_free(ptr); } + } + + internal static Option_QuantityZ constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKCOption_QuantityZ_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Option_QuantityZ_Some(ptr); + case 1: return new Option_QuantityZ_None(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Option_QuantityZ of type Some */ + public class Option_QuantityZ_Some : Option_QuantityZ { + public Quantity some; + internal Option_QuantityZ_Some(long ptr) : base(null, ptr) { + long some = bindings.LDKCOption_QuantityZ_Some_get_some(ptr); + org.ldk.structs.Quantity some_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(some); + if (some_hu_conv != null) { some_hu_conv.ptrs_to.AddLast(this); }; + this.some = some_hu_conv; + } + } + /** A Option_QuantityZ of type None */ + public class Option_QuantityZ_None : Option_QuantityZ { + internal Option_QuantityZ_None(long ptr) : base(null, ptr) { + } + } + /** + * Constructs a new COption_QuantityZ containing a crate::lightning::offers::offer::Quantity + */ + public static Option_QuantityZ some(org.ldk.structs.Quantity o) { + long ret = bindings.COption_QuantityZ_some(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_QuantityZ ret_hu_conv = org.ldk.structs.Option_QuantityZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Constructs a new COption_QuantityZ containing nothing + */ + public static Option_QuantityZ none() { + long ret = bindings.COption_QuantityZ_none(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_QuantityZ ret_hu_conv = org.ldk.structs.Option_QuantityZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.COption_QuantityZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new COption_QuantityZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Option_QuantityZ clone() { + long ret = bindings.COption_QuantityZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_QuantityZ ret_hu_conv = org.ldk.structs.Option_QuantityZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OutPoint.cs b/c_sharp/src/org/ldk/structs/OutPoint.cs index 2d01d0a2..69da1bb4 100644 --- a/c_sharp/src/org/ldk/structs/OutPoint.cs +++ b/c_sharp/src/org/ldk/structs/OutPoint.cs @@ -93,7 +93,7 @@ public class OutPoint : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.OutPoint b) { - bool ret = bindings.OutPoint_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.OutPoint_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -116,17 +116,6 @@ public class OutPoint : CommonBase { public override int GetHashCode() { return (int)this.hash(); } - /** - * Convert an `OutPoint` to a lightning channel id. - */ - public byte[] to_channel_id() { - long ret = bindings.OutPoint_to_channel_id(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - /** * Serialize the OutPoint object into a byte array which can be read by OutPoint_read */ diff --git a/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs b/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs new file mode 100644 index 00000000..d07d1245 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OutputSpendStatus.cs @@ -0,0 +1,200 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The current status of the output spend. + */ +public class OutputSpendStatus : CommonBase { + protected OutputSpendStatus(object _dummy, long ptr) : base(ptr) { } + ~OutputSpendStatus() { + if (ptr != 0) { bindings.OutputSpendStatus_free(ptr); } + } + + internal static OutputSpendStatus constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKOutputSpendStatus_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new OutputSpendStatus_PendingInitialBroadcast(ptr); + case 1: return new OutputSpendStatus_PendingFirstConfirmation(ptr); + case 2: return new OutputSpendStatus_PendingThresholdConfirmations(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A OutputSpendStatus of type PendingInitialBroadcast */ + public class OutputSpendStatus_PendingInitialBroadcast : OutputSpendStatus { + /** + * The height at which we will first generate and broadcast a spending transaction. + */ + public Option_u32Z delayed_until_height; + internal OutputSpendStatus_PendingInitialBroadcast(long ptr) : base(null, ptr) { + long delayed_until_height = bindings.LDKOutputSpendStatus_PendingInitialBroadcast_get_delayed_until_height(ptr); + org.ldk.structs.Option_u32Z delayed_until_height_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(delayed_until_height); + if (delayed_until_height_hu_conv != null) { delayed_until_height_hu_conv.ptrs_to.AddLast(this); }; + this.delayed_until_height = delayed_until_height_hu_conv; + } + } + /** A OutputSpendStatus of type PendingFirstConfirmation */ + public class OutputSpendStatus_PendingFirstConfirmation : OutputSpendStatus { + /** + * The hash of the chain tip when we first broadcast a transaction spending this output. + */ + public byte[] first_broadcast_hash; + /** + * The best height when we last broadcast a transaction spending this output. + */ + public int latest_broadcast_height; + /** + * The transaction spending this output we last broadcasted. + */ + public byte[] latest_spending_tx; + internal OutputSpendStatus_PendingFirstConfirmation(long ptr) : base(null, ptr) { + long first_broadcast_hash = bindings.LDKOutputSpendStatus_PendingFirstConfirmation_get_first_broadcast_hash(ptr); + byte[] first_broadcast_hash_conv = InternalUtils.decodeUint8Array(first_broadcast_hash); + this.first_broadcast_hash = first_broadcast_hash_conv; + this.latest_broadcast_height = bindings.LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_broadcast_height(ptr); + long latest_spending_tx = bindings.LDKOutputSpendStatus_PendingFirstConfirmation_get_latest_spending_tx(ptr); + byte[] latest_spending_tx_conv = InternalUtils.decodeUint8Array(latest_spending_tx); + this.latest_spending_tx = latest_spending_tx_conv; + } + } + /** A OutputSpendStatus of type PendingThresholdConfirmations */ + public class OutputSpendStatus_PendingThresholdConfirmations : OutputSpendStatus { + /** + * The hash of the chain tip when we first broadcast a transaction spending this output. + */ + public byte[] first_broadcast_hash; + /** + * The best height when we last broadcast a transaction spending this output. + */ + public int latest_broadcast_height; + /** + * The transaction spending this output we saw confirmed on-chain. + */ + public byte[] latest_spending_tx; + /** + * The height at which the spending transaction was confirmed. + */ + public int confirmation_height; + /** + * The hash of the block in which the spending transaction was confirmed. + */ + public byte[] confirmation_hash; + internal OutputSpendStatus_PendingThresholdConfirmations(long ptr) : base(null, ptr) { + long first_broadcast_hash = bindings.LDKOutputSpendStatus_PendingThresholdConfirmations_get_first_broadcast_hash(ptr); + byte[] first_broadcast_hash_conv = InternalUtils.decodeUint8Array(first_broadcast_hash); + this.first_broadcast_hash = first_broadcast_hash_conv; + this.latest_broadcast_height = bindings.LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_broadcast_height(ptr); + long latest_spending_tx = bindings.LDKOutputSpendStatus_PendingThresholdConfirmations_get_latest_spending_tx(ptr); + byte[] latest_spending_tx_conv = InternalUtils.decodeUint8Array(latest_spending_tx); + this.latest_spending_tx = latest_spending_tx_conv; + this.confirmation_height = bindings.LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_height(ptr); + long confirmation_hash = bindings.LDKOutputSpendStatus_PendingThresholdConfirmations_get_confirmation_hash(ptr); + byte[] confirmation_hash_conv = InternalUtils.decodeUint8Array(confirmation_hash); + this.confirmation_hash = confirmation_hash_conv; + } + } + internal long clone_ptr() { + long ret = bindings.OutputSpendStatus_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the OutputSpendStatus + */ + public OutputSpendStatus clone() { + long ret = bindings.OutputSpendStatus_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSpendStatus ret_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PendingInitialBroadcast-variant OutputSpendStatus + */ + public static OutputSpendStatus pending_initial_broadcast(org.ldk.structs.Option_u32Z delayed_until_height) { + long ret = bindings.OutputSpendStatus_pending_initial_broadcast(delayed_until_height.ptr); + GC.KeepAlive(delayed_until_height); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSpendStatus ret_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(delayed_until_height); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PendingFirstConfirmation-variant OutputSpendStatus + */ + public static OutputSpendStatus pending_first_confirmation(byte[] first_broadcast_hash, int latest_broadcast_height, byte[] latest_spending_tx) { + long ret = bindings.OutputSpendStatus_pending_first_confirmation(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_broadcast_hash, 32)), latest_broadcast_height, InternalUtils.encodeUint8Array(latest_spending_tx)); + GC.KeepAlive(first_broadcast_hash); + GC.KeepAlive(latest_broadcast_height); + GC.KeepAlive(latest_spending_tx); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSpendStatus ret_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new PendingThresholdConfirmations-variant OutputSpendStatus + */ + public static OutputSpendStatus pending_threshold_confirmations(byte[] first_broadcast_hash, int latest_broadcast_height, byte[] latest_spending_tx, int confirmation_height, byte[] confirmation_hash) { + long ret = bindings.OutputSpendStatus_pending_threshold_confirmations(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(first_broadcast_hash, 32)), latest_broadcast_height, InternalUtils.encodeUint8Array(latest_spending_tx), confirmation_height, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(confirmation_hash, 32))); + GC.KeepAlive(first_broadcast_hash); + GC.KeepAlive(latest_broadcast_height); + GC.KeepAlive(latest_spending_tx); + GC.KeepAlive(confirmation_height); + GC.KeepAlive(confirmation_hash); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSpendStatus ret_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Checks if two OutputSpendStatuss contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.OutputSpendStatus b) { + bool ret = bindings.OutputSpendStatus_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is OutputSpendStatus)) return false; + return this.eq((OutputSpendStatus)o); + } + /** + * Serialize the OutputSpendStatus object into a byte array which can be read by OutputSpendStatus_read + */ + public byte[] write() { + long ret = bindings.OutputSpendStatus_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a OutputSpendStatus from a byte array, created by OutputSpendStatus_write + */ + public static Result_OutputSpendStatusDecodeErrorZ read(byte[] ser) { + long ret = bindings.OutputSpendStatus_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSpendStatusDecodeErrorZ ret_hu_conv = Result_OutputSpendStatusDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OutputSpender.cs b/c_sharp/src/org/ldk/structs/OutputSpender.cs new file mode 100644 index 00000000..93283417 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OutputSpender.cs @@ -0,0 +1,117 @@ + +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + + +/** An implementation of OutputSpender */ +public interface OutputSpenderInterface { + /**Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an + * output to the given change destination (if sufficient change value remains). The + * transaction will have a feerate, at least, of the given value. + * + * The `locktime` argument is used to set the transaction's locktime. If `None`, the + * transaction will have a locktime of 0. It it recommended to set this to the current block + * height to avoid fee sniping, unless you have some specific reason to use a different + * locktime. + * + * Returns `Err(())` if the output value is greater than the input value minus required fee, + * if a descriptor was duplicated, or if an output descriptor `script_pubkey` + * does not match the one we can spend. + */ + Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, Option_u32Z locktime); +} + +/** + * A trait that describes a wallet capable of creating a spending [`Transaction`] from a set of + * [`SpendableOutputDescriptor`]s. + */ +public class OutputSpender : CommonBase { + internal bindings.LDKOutputSpender bindings_instance; + internal long instance_idx; + + internal OutputSpender(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + ~OutputSpender() { + if (ptr != 0) { bindings.OutputSpender_free(ptr); } + } + + private class LDKOutputSpenderHolder { internal OutputSpender held; } + private class LDKOutputSpenderImpl : bindings.LDKOutputSpender { + internal LDKOutputSpenderImpl(OutputSpenderInterface arg, LDKOutputSpenderHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private OutputSpenderInterface arg; + private LDKOutputSpenderHolder impl_holder; + public long spend_spendable_outputs(long _descriptors, long _outputs, long _change_destination_script, int _feerate_sat_per_1000_weight, long _locktime) { + int _descriptors_conv_27_len = InternalUtils.getArrayLength(_descriptors); + SpendableOutputDescriptor[] _descriptors_conv_27_arr = new SpendableOutputDescriptor[_descriptors_conv_27_len]; + for (int b = 0; b < _descriptors_conv_27_len; b++) { + long _descriptors_conv_27 = InternalUtils.getU64ArrayElem(_descriptors, b); + org.ldk.structs.SpendableOutputDescriptor _descriptors_conv_27_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(_descriptors_conv_27); + if (_descriptors_conv_27_hu_conv != null) { _descriptors_conv_27_hu_conv.ptrs_to.AddLast(this); }; + _descriptors_conv_27_arr[b] = _descriptors_conv_27_hu_conv; + } + bindings.free_buffer(_descriptors); + int _outputs_conv_7_len = InternalUtils.getArrayLength(_outputs); + TxOut[] _outputs_conv_7_arr = new TxOut[_outputs_conv_7_len]; + for (int h = 0; h < _outputs_conv_7_len; h++) { + long _outputs_conv_7 = InternalUtils.getU64ArrayElem(_outputs, h); + TxOut _outputs_conv_7_conv = new TxOut(null, _outputs_conv_7); + _outputs_conv_7_arr[h] = _outputs_conv_7_conv; + } + bindings.free_buffer(_outputs); + byte[] _change_destination_script_conv = InternalUtils.decodeUint8Array(_change_destination_script); + org.ldk.structs.Option_u32Z _locktime_hu_conv = org.ldk.structs.Option_u32Z.constr_from_ptr(_locktime); + if (_locktime_hu_conv != null) { _locktime_hu_conv.ptrs_to.AddLast(this); }; + Result_TransactionNoneZ ret = arg.spend_spendable_outputs(_descriptors_conv_27_arr, _outputs_conv_7_arr, _change_destination_script_conv, _feerate_sat_per_1000_weight, _locktime_hu_conv); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; + } + } + + /** Creates a new instance of OutputSpender from a given implementation */ + public static OutputSpender new_impl(OutputSpenderInterface arg) { + LDKOutputSpenderHolder impl_holder = new LDKOutputSpenderHolder(); + LDKOutputSpenderImpl impl = new LDKOutputSpenderImpl(arg, impl_holder); + long[] ptr_idx = bindings.LDKOutputSpender_new(impl); + + impl_holder.held = new OutputSpender(null, ptr_idx[0]); + impl_holder.held.instance_idx = ptr_idx[1]; + impl_holder.held.bindings_instance = impl; + return impl_holder.held; + } + + /** + * Creates a [`Transaction`] which spends the given descriptors to the given outputs, plus an + * output to the given change destination (if sufficient change value remains). The + * transaction will have a feerate, at least, of the given value. + * + * The `locktime` argument is used to set the transaction's locktime. If `None`, the + * transaction will have a locktime of 0. It it recommended to set this to the current block + * height to avoid fee sniping, unless you have some specific reason to use a different + * locktime. + * + * Returns `Err(())` if the output value is greater than the input value minus required fee, + * if a descriptor was duplicated, or if an output descriptor `script_pubkey` + * does not match the one we can spend. + */ + public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { + long ret = bindings.OutputSpender_spend_spendable_outputs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr)), InternalUtils.encodeUint8Array(change_destination_script), feerate_sat_per_1000_weight, locktime.ptr); + GC.KeepAlive(this); + GC.KeepAlive(descriptors); + GC.KeepAlive(outputs); + GC.KeepAlive(change_destination_script); + GC.KeepAlive(feerate_sat_per_1000_weight); + GC.KeepAlive(locktime); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); + foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; + if (this != null) { this.ptrs_to.AddLast(locktime); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/OutputSweeper.cs b/c_sharp/src/org/ldk/structs/OutputSweeper.cs new file mode 100644 index 00000000..1f2632e6 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/OutputSweeper.cs @@ -0,0 +1,179 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A utility that keeps track of [`SpendableOutputDescriptor`]s, persists them in a given + * [`KVStore`] and regularly retries sweeping them based on a callback given to the constructor + * methods. + * + * Users should call [`Self::track_spendable_outputs`] for any [`SpendableOutputDescriptor`]s received via [`Event::SpendableOutputs`]. + * + * This needs to be notified of chain state changes either via its [`Listen`] or [`Confirm`] + * implementation and hence has to be connected with the utilized chain data sources. + * + * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users are + * required to give their chain data sources (i.e., [`Filter`] implementation) to the respective + * constructor. + * + * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs + */ +public class OutputSweeper : CommonBase { + internal OutputSweeper(object _dummy, long ptr) : base(ptr) { } + ~OutputSweeper() { + if (ptr != 0) { bindings.OutputSweeper_free(ptr); } + } + + /** + * Constructs a new [`OutputSweeper`]. + * + * If chain data is provided via the [`Confirm`] interface or via filtered blocks, users also + * need to register their [`Filter`] implementation via the given `chain_data_source`. + */ + public static OutputSweeper of(org.ldk.structs.BestBlock best_block, org.ldk.structs.BroadcasterInterface broadcaster, org.ldk.structs.FeeEstimator fee_estimator, org.ldk.structs.Option_FilterZ chain_data_source, org.ldk.structs.OutputSpender output_spender, org.ldk.structs.ChangeDestinationSource change_destination_source, org.ldk.structs.KVStore kv_store, org.ldk.structs.Logger logger) { + long ret = bindings.OutputSweeper_new(best_block.ptr, broadcaster.ptr, fee_estimator.ptr, chain_data_source.ptr, output_spender.ptr, change_destination_source.ptr, kv_store.ptr, logger.ptr); + GC.KeepAlive(best_block); + GC.KeepAlive(broadcaster); + GC.KeepAlive(fee_estimator); + GC.KeepAlive(chain_data_source); + GC.KeepAlive(output_spender); + GC.KeepAlive(change_destination_source); + GC.KeepAlive(kv_store); + GC.KeepAlive(logger); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSweeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutputSweeper(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(best_block); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(fee_estimator); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(chain_data_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(output_spender); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(change_destination_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(kv_store); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(logger); }; + return ret_hu_conv; + } + + /** + * Tells the sweeper to track the given outputs descriptors. + * + * Usually, this should be called based on the values emitted by the + * [`Event::SpendableOutputs`]. + * + * The given `exclude_static_outputs` flag controls whether the sweeper will filter out + * [`SpendableOutputDescriptor::StaticOutput`]s, which may be handled directly by the on-chain + * wallet implementation. + * + * If `delay_until_height` is set, we will delay the spending until the respective block + * height is reached. This can be used to batch spends, e.g., to reduce on-chain fees. + * + * Returns `Err` on persistence failure, in which case the call may be safely retried. + * + * [`Event::SpendableOutputs`]: crate::events::Event::SpendableOutputs + * + * Note that channel_id (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public Result_NoneNoneZ track_spendable_outputs(SpendableOutputDescriptor[] output_descriptors, org.ldk.structs.ChannelId channel_id, bool exclude_static_outputs, org.ldk.structs.Option_u32Z delay_until_height) { + long ret = bindings.OutputSweeper_track_spendable_outputs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(output_descriptors, output_descriptors_conv_27 => output_descriptors_conv_27.ptr)), channel_id == null ? 0 : channel_id.ptr, exclude_static_outputs, delay_until_height.ptr); + GC.KeepAlive(this); + GC.KeepAlive(output_descriptors); + GC.KeepAlive(channel_id); + GC.KeepAlive(exclude_static_outputs); + GC.KeepAlive(delay_until_height); + if (ret >= 0 && ret <= 4096) { return null; } + Result_NoneNoneZ ret_hu_conv = Result_NoneNoneZ.constr_from_ptr(ret); + foreach (SpendableOutputDescriptor output_descriptors_conv_27 in output_descriptors) { if (this != null) { this.ptrs_to.AddLast(output_descriptors_conv_27); }; }; + if (this != null) { this.ptrs_to.AddLast(channel_id); }; + if (this != null) { this.ptrs_to.AddLast(delay_until_height); }; + return ret_hu_conv; + } + + /** + * Returns a list of the currently tracked spendable outputs. + */ + public TrackedSpendableOutput[] tracked_spendable_outputs() { + long ret = bindings.OutputSweeper_tracked_spendable_outputs(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + int ret_conv_24_len = InternalUtils.getArrayLength(ret); + TrackedSpendableOutput[] ret_conv_24_arr = new TrackedSpendableOutput[ret_conv_24_len]; + for (int y = 0; y < ret_conv_24_len; y++) { + long ret_conv_24 = InternalUtils.getU64ArrayElem(ret, y); + org.ldk.structs.TrackedSpendableOutput ret_conv_24_hu_conv = null; if (ret_conv_24 < 0 || ret_conv_24 > 4096) { ret_conv_24_hu_conv = new org.ldk.structs.TrackedSpendableOutput(null, ret_conv_24); } + if (ret_conv_24_hu_conv != null) { ret_conv_24_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_24_arr[y] = ret_conv_24_hu_conv; + } + bindings.free_buffer(ret); + return ret_conv_24_arr; + } + + /** + * Gets the latest best block which was connected either via the [`Listen`] or + * [`Confirm`] interfaces. + */ + public BestBlock current_best_block() { + long ret = bindings.OutputSweeper_current_best_block(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new Listen which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Listen must be freed before this_arg is + */ + public Listen as_Listen() { + long ret = bindings.OutputSweeper_as_Listen(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Listen ret_hu_conv = new Listen(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Constructs a new Confirm which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned Confirm must be freed before this_arg is + */ + public Confirm as_Confirm() { + long ret = bindings.OutputSweeper_as_Confirm(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Confirm ret_hu_conv = new Confirm(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Read a OutputSweeper from a byte array, created by OutputSweeper_write + */ + public static Result_OutputSweeperDecodeErrorZ read(byte[] ser, org.ldk.structs.BroadcasterInterface arg_a, org.ldk.structs.FeeEstimator arg_b, org.ldk.structs.Option_FilterZ arg_c, org.ldk.structs.OutputSpender arg_d, org.ldk.structs.ChangeDestinationSource arg_e, org.ldk.structs.KVStore arg_f, org.ldk.structs.Logger arg_g) { + long ret = bindings.OutputSweeper_read(InternalUtils.encodeUint8Array(ser), arg_a.ptr, arg_b.ptr, arg_c.ptr, arg_d.ptr, arg_e.ptr, arg_f.ptr, arg_g.ptr); + GC.KeepAlive(ser); + GC.KeepAlive(arg_a); + GC.KeepAlive(arg_b); + GC.KeepAlive(arg_c); + GC.KeepAlive(arg_d); + GC.KeepAlive(arg_e); + GC.KeepAlive(arg_f); + GC.KeepAlive(arg_g); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSweeperDecodeErrorZ ret_hu_conv = Result_OutputSweeperDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_b); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_c); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_d); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_e); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_f); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_g); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/P2PGossipSync.cs b/c_sharp/src/org/ldk/structs/P2PGossipSync.cs index 8fc4eb5e..ab618295 100644 --- a/c_sharp/src/org/ldk/structs/P2PGossipSync.cs +++ b/c_sharp/src/org/ldk/structs/P2PGossipSync.cs @@ -26,7 +26,7 @@ public class P2PGossipSync : CommonBase { * correct, and the announcement is signed with channel owners' keys. */ public static P2PGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Option_UtxoLookupZ utxo_lookup, org.ldk.structs.Logger logger) { - long ret = bindings.P2PGossipSync_new(network_graph == null ? 0 : network_graph.ptr, utxo_lookup.ptr, logger.ptr); + long ret = bindings.P2PGossipSync_new(network_graph.ptr, utxo_lookup.ptr, logger.ptr); GC.KeepAlive(network_graph); GC.KeepAlive(utxo_lookup); GC.KeepAlive(logger); diff --git a/c_sharp/src/org/ldk/structs/Packet.cs b/c_sharp/src/org/ldk/structs/Packet.cs index ca6ec26f..3a83c0e3 100644 --- a/c_sharp/src/org/ldk/structs/Packet.cs +++ b/c_sharp/src/org/ldk/structs/Packet.cs @@ -146,7 +146,7 @@ public class Packet : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Packet b) { - bool ret = bindings.Packet_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Packet_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs b/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs index d1f27fd3..0eed4d37 100644 --- a/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs +++ b/c_sharp/src/org/ldk/structs/ParseOrSemanticError.cs @@ -91,7 +91,7 @@ public class ParseOrSemanticError : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.ParseOrSemanticError b) { - bool ret = bindings.ParseOrSemanticError_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ParseOrSemanticError_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/Path.cs b/c_sharp/src/org/ldk/structs/Path.cs index 05eadf00..3022b37d 100644 --- a/c_sharp/src/org/ldk/structs/Path.cs +++ b/c_sharp/src/org/ldk/structs/Path.cs @@ -39,7 +39,7 @@ public class Path : CommonBase { * The list of unblinded hops in this [`Path`]. Must be at least length one. */ public void set_hops(RouteHop[] val) { - bindings.Path_set_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_10 => val_conv_10 == null ? 0 : val_conv_10.ptr))); + bindings.Path_set_hops(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_10 => val_conv_10.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (RouteHop val_conv_10 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_10); }; }; @@ -77,7 +77,7 @@ public class Path : CommonBase { * Note that blinded_tail_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static Path of(RouteHop[] hops_arg, org.ldk.structs.BlindedTail blinded_tail_arg) { - long ret = bindings.Path_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(hops_arg, hops_arg_conv_10 => hops_arg_conv_10 == null ? 0 : hops_arg_conv_10.ptr)), blinded_tail_arg == null ? 0 : blinded_tail_arg.ptr); + long ret = bindings.Path_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(hops_arg, hops_arg_conv_10 => hops_arg_conv_10.ptr)), blinded_tail_arg == null ? 0 : blinded_tail_arg.ptr); GC.KeepAlive(hops_arg); GC.KeepAlive(blinded_tail_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -124,7 +124,7 @@ public class Path : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Path b) { - bool ret = bindings.Path_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Path_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/PathFailure.cs b/c_sharp/src/org/ldk/structs/PathFailure.cs index 59891521..a3ca0ae6 100644 --- a/c_sharp/src/org/ldk/structs/PathFailure.cs +++ b/c_sharp/src/org/ldk/structs/PathFailure.cs @@ -107,7 +107,7 @@ public class PathFailure : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.PathFailure b) { - bool ret = bindings.PathFailure_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PathFailure_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/Payee.cs b/c_sharp/src/org/ldk/structs/Payee.cs index 69b6a4a2..2d72ccb3 100644 --- a/c_sharp/src/org/ldk/structs/Payee.cs +++ b/c_sharp/src/org/ldk/structs/Payee.cs @@ -128,7 +128,7 @@ public class Payee : CommonBase { * Utility method to constructs a new Blinded-variant Payee */ public static Payee blinded(TwoTuple_BlindedPayInfoBlindedPathZ[] route_hints, org.ldk.structs.Bolt12InvoiceFeatures features) { - long ret = bindings.Payee_blinded(InternalUtils.encodeUint64Array(InternalUtils.mapArray(route_hints, route_hints_conv_37 => route_hints_conv_37 != null ? route_hints_conv_37.ptr : 0)), features == null ? 0 : features.ptr); + long ret = bindings.Payee_blinded(InternalUtils.encodeUint64Array(InternalUtils.mapArray(route_hints, route_hints_conv_37 => route_hints_conv_37.ptr)), features.ptr); GC.KeepAlive(route_hints); GC.KeepAlive(features); if (ret >= 0 && ret <= 4096) { return null; } @@ -142,7 +142,7 @@ public class Payee : CommonBase { * Utility method to constructs a new Clear-variant Payee */ public static Payee clear(byte[] node_id, RouteHint[] route_hints, org.ldk.structs.Bolt11InvoiceFeatures features, int final_cltv_expiry_delta) { - long ret = bindings.Payee_clear(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(route_hints, route_hints_conv_11 => route_hints_conv_11 == null ? 0 : route_hints_conv_11.ptr)), features == null ? 0 : features.ptr, final_cltv_expiry_delta); + long ret = bindings.Payee_clear(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(route_hints, route_hints_conv_11 => route_hints_conv_11.ptr)), features.ptr, final_cltv_expiry_delta); GC.KeepAlive(node_id); GC.KeepAlive(route_hints); GC.KeepAlive(features); @@ -172,7 +172,7 @@ public class Payee : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.Payee b) { - bool ret = bindings.Payee_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Payee_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/PayeePubKey.cs b/c_sharp/src/org/ldk/structs/PayeePubKey.cs index 46a18c1e..a5025d32 100644 --- a/c_sharp/src/org/ldk/structs/PayeePubKey.cs +++ b/c_sharp/src/org/ldk/structs/PayeePubKey.cs @@ -77,7 +77,7 @@ public class PayeePubKey : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.PayeePubKey b) { - bool ret = bindings.PayeePubKey_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PayeePubKey_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/PaymentContext.cs b/c_sharp/src/org/ldk/structs/PaymentContext.cs new file mode 100644 index 00000000..1512c1e4 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/PaymentContext.cs @@ -0,0 +1,157 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * The context of an inbound payment, which is included in a [`BlindedPath`] via [`ReceiveTlvs`] + * and surfaced in [`PaymentPurpose`]. + * + * [`BlindedPath`]: crate::blinded_path::BlindedPath + * [`PaymentPurpose`]: crate::events::PaymentPurpose + */ +public class PaymentContext : CommonBase { + protected PaymentContext(object _dummy, long ptr) : base(ptr) { } + ~PaymentContext() { + if (ptr != 0) { bindings.PaymentContext_free(ptr); } + } + + internal static PaymentContext constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKPaymentContext_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new PaymentContext_Unknown(ptr); + case 1: return new PaymentContext_Bolt12Offer(ptr); + case 2: return new PaymentContext_Bolt12Refund(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A PaymentContext of type Unknown */ + public class PaymentContext_Unknown : PaymentContext { + public UnknownPaymentContext unknown; + internal PaymentContext_Unknown(long ptr) : base(null, ptr) { + long unknown = bindings.LDKPaymentContext_Unknown_get_unknown(ptr); + org.ldk.structs.UnknownPaymentContext unknown_hu_conv = null; if (unknown < 0 || unknown > 4096) { unknown_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, unknown); } + if (unknown_hu_conv != null) { unknown_hu_conv.ptrs_to.AddLast(this); }; + this.unknown = unknown_hu_conv; + } + } + /** A PaymentContext of type Bolt12Offer */ + public class PaymentContext_Bolt12Offer : PaymentContext { + public Bolt12OfferContext bolt12_offer; + internal PaymentContext_Bolt12Offer(long ptr) : base(null, ptr) { + long bolt12_offer = bindings.LDKPaymentContext_Bolt12Offer_get_bolt12_offer(ptr); + org.ldk.structs.Bolt12OfferContext bolt12_offer_hu_conv = null; if (bolt12_offer < 0 || bolt12_offer > 4096) { bolt12_offer_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, bolt12_offer); } + if (bolt12_offer_hu_conv != null) { bolt12_offer_hu_conv.ptrs_to.AddLast(this); }; + this.bolt12_offer = bolt12_offer_hu_conv; + } + } + /** A PaymentContext of type Bolt12Refund */ + public class PaymentContext_Bolt12Refund : PaymentContext { + public Bolt12RefundContext bolt12_refund; + internal PaymentContext_Bolt12Refund(long ptr) : base(null, ptr) { + long bolt12_refund = bindings.LDKPaymentContext_Bolt12Refund_get_bolt12_refund(ptr); + org.ldk.structs.Bolt12RefundContext bolt12_refund_hu_conv = null; if (bolt12_refund < 0 || bolt12_refund > 4096) { bolt12_refund_hu_conv = new org.ldk.structs.Bolt12RefundContext(null, bolt12_refund); } + if (bolt12_refund_hu_conv != null) { bolt12_refund_hu_conv.ptrs_to.AddLast(this); }; + this.bolt12_refund = bolt12_refund_hu_conv; + } + } + internal long clone_ptr() { + long ret = bindings.PaymentContext_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the PaymentContext + */ + public PaymentContext clone() { + long ret = bindings.PaymentContext_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Unknown-variant PaymentContext + */ + public static PaymentContext unknown(org.ldk.structs.UnknownPaymentContext a) { + long ret = bindings.PaymentContext_unknown(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Bolt12Offer-variant PaymentContext + */ + public static PaymentContext bolt12_offer(org.ldk.structs.Bolt12OfferContext a) { + long ret = bindings.PaymentContext_bolt12_offer(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Bolt12Refund-variant PaymentContext + */ + public static PaymentContext bolt12_refund(org.ldk.structs.Bolt12RefundContext a) { + long ret = bindings.PaymentContext_bolt12_refund(a.ptr); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + + /** + * Checks if two PaymentContexts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + */ + public bool eq(org.ldk.structs.PaymentContext b) { + bool ret = bindings.PaymentContext_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + return ret; + } + + public override bool Equals(object o) { + if (!(o is PaymentContext)) return false; + return this.eq((PaymentContext)o); + } + /** + * Serialize the PaymentContext object into a byte array which can be read by PaymentContext_read + */ + public byte[] write() { + long ret = bindings.PaymentContext_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a PaymentContext from a byte array, created by PaymentContext_write + */ + public static Result_PaymentContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.PaymentContext_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentContextDecodeErrorZ ret_hu_conv = Result_PaymentContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/PaymentParameters.cs b/c_sharp/src/org/ldk/structs/PaymentParameters.cs index 3f38ad62..8c7ffcfc 100644 --- a/c_sharp/src/org/ldk/structs/PaymentParameters.cs +++ b/c_sharp/src/org/ldk/structs/PaymentParameters.cs @@ -249,7 +249,7 @@ public class PaymentParameters : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.PaymentParameters b) { - bool ret = bindings.PaymentParameters_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PaymentParameters_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -329,7 +329,7 @@ public class PaymentParameters : CommonBase { * [`PaymentParameters::expiry_time`]. */ public static PaymentParameters from_bolt12_invoice(org.ldk.structs.Bolt12Invoice invoice) { - long ret = bindings.PaymentParameters_from_bolt12_invoice(invoice == null ? 0 : invoice.ptr); + long ret = bindings.PaymentParameters_from_bolt12_invoice(invoice.ptr); GC.KeepAlive(invoice); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } @@ -342,7 +342,7 @@ public class PaymentParameters : CommonBase { * Creates parameters for paying to a blinded payee from the provided blinded route hints. */ public static PaymentParameters blinded(TwoTuple_BlindedPayInfoBlindedPathZ[] blinded_route_hints) { - long ret = bindings.PaymentParameters_blinded(InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_route_hints, blinded_route_hints_conv_37 => blinded_route_hints_conv_37 != null ? blinded_route_hints_conv_37.ptr : 0))); + long ret = bindings.PaymentParameters_blinded(InternalUtils.encodeUint64Array(InternalUtils.mapArray(blinded_route_hints, blinded_route_hints_conv_37 => blinded_route_hints_conv_37.ptr))); GC.KeepAlive(blinded_route_hints); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PaymentParameters(null, ret); } diff --git a/c_sharp/src/org/ldk/structs/PaymentPurpose.cs b/c_sharp/src/org/ldk/structs/PaymentPurpose.cs index 242ead86..5fc9c02c 100644 --- a/c_sharp/src/org/ldk/structs/PaymentPurpose.cs +++ b/c_sharp/src/org/ldk/structs/PaymentPurpose.cs @@ -18,19 +18,22 @@ public class PaymentPurpose : CommonBase { internal static PaymentPurpose constr_from_ptr(long ptr) { long raw_ty = bindings.LDKPaymentPurpose_ty_from_ptr(ptr); switch (raw_ty) { - case 0: return new PaymentPurpose_InvoicePayment(ptr); - case 1: return new PaymentPurpose_SpontaneousPayment(ptr); + case 0: return new PaymentPurpose_Bolt11InvoicePayment(ptr); + case 1: return new PaymentPurpose_Bolt12OfferPayment(ptr); + case 2: return new PaymentPurpose_Bolt12RefundPayment(ptr); + case 3: return new PaymentPurpose_SpontaneousPayment(ptr); default: throw new ArgumentException("Impossible enum variant"); } } - /** A PaymentPurpose of type InvoicePayment */ - public class PaymentPurpose_InvoicePayment : PaymentPurpose { + /** A PaymentPurpose of type Bolt11InvoicePayment */ + public class PaymentPurpose_Bolt11InvoicePayment : PaymentPurpose { /** * The preimage to the payment_hash, if the payment hash (and secret) were fetched via - * [`ChannelManager::create_inbound_payment`]. If provided, this can be handed directly to - * [`ChannelManager::claim_funds`]. + * [`ChannelManager::create_inbound_payment`]. When handling [`Event::PaymentClaimable`], + * this can be passed directly to [`ChannelManager::claim_funds`] to claim the payment. No + * action is needed when seen in [`Event::PaymentClaimed`]. * * [`ChannelManager::create_inbound_payment`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds @@ -49,16 +52,92 @@ public class PaymentPurpose : CommonBase { * [`ChannelManager::create_inbound_payment_for_hash`]: crate::ln::channelmanager::ChannelManager::create_inbound_payment_for_hash */ public byte[] payment_secret; - internal PaymentPurpose_InvoicePayment(long ptr) : base(null, ptr) { - long payment_preimage = bindings.LDKPaymentPurpose_InvoicePayment_get_payment_preimage(ptr); + internal PaymentPurpose_Bolt11InvoicePayment(long ptr) : base(null, ptr) { + long payment_preimage = bindings.LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_preimage(ptr); org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_preimage); if (payment_preimage_hu_conv != null) { payment_preimage_hu_conv.ptrs_to.AddLast(this); }; this.payment_preimage = payment_preimage_hu_conv; - long payment_secret = bindings.LDKPaymentPurpose_InvoicePayment_get_payment_secret(ptr); + long payment_secret = bindings.LDKPaymentPurpose_Bolt11InvoicePayment_get_payment_secret(ptr); byte[] payment_secret_conv = InternalUtils.decodeUint8Array(payment_secret); this.payment_secret = payment_secret_conv; } } + /** A PaymentPurpose of type Bolt12OfferPayment */ + public class PaymentPurpose_Bolt12OfferPayment : PaymentPurpose { + /** + * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be + * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed + * when seen in [`Event::PaymentClaimed`]. + * + * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds + */ + public Option_ThirtyTwoBytesZ payment_preimage; + /** + * The secret used to authenticate the sender to the recipient, preventing a number of + * de-anonymization attacks while routing a payment. + * + * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details. + */ + public byte[] payment_secret; + /** + * The context of the payment such as information about the corresponding [`Offer`] and + * [`InvoiceRequest`]. + * + * [`Offer`]: crate::offers::offer::Offer + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + */ + public Bolt12OfferContext payment_context; + internal PaymentPurpose_Bolt12OfferPayment(long ptr) : base(null, ptr) { + long payment_preimage = bindings.LDKPaymentPurpose_Bolt12OfferPayment_get_payment_preimage(ptr); + org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_preimage); + if (payment_preimage_hu_conv != null) { payment_preimage_hu_conv.ptrs_to.AddLast(this); }; + this.payment_preimage = payment_preimage_hu_conv; + long payment_secret = bindings.LDKPaymentPurpose_Bolt12OfferPayment_get_payment_secret(ptr); + byte[] payment_secret_conv = InternalUtils.decodeUint8Array(payment_secret); + this.payment_secret = payment_secret_conv; + long payment_context = bindings.LDKPaymentPurpose_Bolt12OfferPayment_get_payment_context(ptr); + org.ldk.structs.Bolt12OfferContext payment_context_hu_conv = null; if (payment_context < 0 || payment_context > 4096) { payment_context_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, payment_context); } + if (payment_context_hu_conv != null) { payment_context_hu_conv.ptrs_to.AddLast(this); }; + this.payment_context = payment_context_hu_conv; + } + } + /** A PaymentPurpose of type Bolt12RefundPayment */ + public class PaymentPurpose_Bolt12RefundPayment : PaymentPurpose { + /** + * The preimage to the payment hash. When handling [`Event::PaymentClaimable`], this can be + * passed directly to [`ChannelManager::claim_funds`], if provided. No action is needed + * when seen in [`Event::PaymentClaimed`]. + * + * [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds + */ + public Option_ThirtyTwoBytesZ payment_preimage; + /** + * The secret used to authenticate the sender to the recipient, preventing a number of + * de-anonymization attacks while routing a payment. + * + * See [`PaymentPurpose::Bolt11InvoicePayment::payment_secret`] for further details. + */ + public byte[] payment_secret; + /** + * The context of the payment such as information about the corresponding [`Refund`]. + * + * [`Refund`]: crate::offers::refund::Refund + */ + public Bolt12RefundContext payment_context; + internal PaymentPurpose_Bolt12RefundPayment(long ptr) : base(null, ptr) { + long payment_preimage = bindings.LDKPaymentPurpose_Bolt12RefundPayment_get_payment_preimage(ptr); + org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(payment_preimage); + if (payment_preimage_hu_conv != null) { payment_preimage_hu_conv.ptrs_to.AddLast(this); }; + this.payment_preimage = payment_preimage_hu_conv; + long payment_secret = bindings.LDKPaymentPurpose_Bolt12RefundPayment_get_payment_secret(ptr); + byte[] payment_secret_conv = InternalUtils.decodeUint8Array(payment_secret); + this.payment_secret = payment_secret_conv; + long payment_context = bindings.LDKPaymentPurpose_Bolt12RefundPayment_get_payment_context(ptr); + org.ldk.structs.Bolt12RefundContext payment_context_hu_conv = null; if (payment_context < 0 || payment_context > 4096) { payment_context_hu_conv = new org.ldk.structs.Bolt12RefundContext(null, payment_context); } + if (payment_context_hu_conv != null) { payment_context_hu_conv.ptrs_to.AddLast(this); }; + this.payment_context = payment_context_hu_conv; + } + } /** A PaymentPurpose of type SpontaneousPayment */ public class PaymentPurpose_SpontaneousPayment : PaymentPurpose { public byte[] spontaneous_payment; @@ -87,16 +166,48 @@ public class PaymentPurpose : CommonBase { } /** - * Utility method to constructs a new InvoicePayment-variant PaymentPurpose + * Utility method to constructs a new Bolt11InvoicePayment-variant PaymentPurpose + */ + public static PaymentPurpose bolt11_invoice_payment(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, byte[] payment_secret) { + long ret = bindings.PaymentPurpose_bolt11_invoice_payment(payment_preimage.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_secret, 32))); + GC.KeepAlive(payment_preimage); + GC.KeepAlive(payment_secret); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_preimage); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Bolt12OfferPayment-variant PaymentPurpose + */ + public static PaymentPurpose bolt12_offer_payment(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, byte[] payment_secret, org.ldk.structs.Bolt12OfferContext payment_context) { + long ret = bindings.PaymentPurpose_bolt12_offer_payment(payment_preimage.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_secret, 32)), payment_context.ptr); + GC.KeepAlive(payment_preimage); + GC.KeepAlive(payment_secret); + GC.KeepAlive(payment_context); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_preimage); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_context); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Bolt12RefundPayment-variant PaymentPurpose */ - public static PaymentPurpose invoice_payment(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, byte[] payment_secret) { - long ret = bindings.PaymentPurpose_invoice_payment(payment_preimage.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_secret, 32))); + public static PaymentPurpose bolt12_refund_payment(org.ldk.structs.Option_ThirtyTwoBytesZ payment_preimage, byte[] payment_secret, org.ldk.structs.Bolt12RefundContext payment_context) { + long ret = bindings.PaymentPurpose_bolt12_refund_payment(payment_preimage.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_secret, 32)), payment_context.ptr); GC.KeepAlive(payment_preimage); GC.KeepAlive(payment_secret); + GC.KeepAlive(payment_context); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentPurpose ret_hu_conv = org.ldk.structs.PaymentPurpose.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_preimage); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_context); }; return ret_hu_conv; } @@ -117,7 +228,7 @@ public class PaymentPurpose : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.PaymentPurpose b) { - bool ret = bindings.PaymentPurpose_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PaymentPurpose_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs b/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs index cb3c70dd..03e37fe0 100644 --- a/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs +++ b/c_sharp/src/org/ldk/structs/PaymentSendFailure.cs @@ -151,7 +151,7 @@ public class PaymentSendFailure : CommonBase { * Utility method to constructs a new PathParameterError-variant PaymentSendFailure */ public static PaymentSendFailure path_parameter_error(Result_NoneAPIErrorZ[] a) { - long ret = bindings.PaymentSendFailure_path_parameter_error(InternalUtils.encodeUint64Array(InternalUtils.mapArray(a, a_conv_22 => a_conv_22 != null ? a_conv_22.ptr : 0))); + long ret = bindings.PaymentSendFailure_path_parameter_error(InternalUtils.encodeUint64Array(InternalUtils.mapArray(a, a_conv_22 => a_conv_22.ptr))); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PaymentSendFailure ret_hu_conv = org.ldk.structs.PaymentSendFailure.constr_from_ptr(ret); @@ -187,7 +187,7 @@ public class PaymentSendFailure : CommonBase { * Utility method to constructs a new PartialFailure-variant PaymentSendFailure */ public static PaymentSendFailure partial_failure(Result_NoneAPIErrorZ[] results, org.ldk.structs.RouteParameters failed_paths_retry, byte[] payment_id) { - long ret = bindings.PaymentSendFailure_partial_failure(InternalUtils.encodeUint64Array(InternalUtils.mapArray(results, results_conv_22 => results_conv_22 != null ? results_conv_22.ptr : 0)), failed_paths_retry == null ? 0 : failed_paths_retry.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + long ret = bindings.PaymentSendFailure_partial_failure(InternalUtils.encodeUint64Array(InternalUtils.mapArray(results, results_conv_22 => results_conv_22.ptr)), failed_paths_retry.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); GC.KeepAlive(results); GC.KeepAlive(failed_paths_retry); GC.KeepAlive(payment_id); @@ -203,7 +203,7 @@ public class PaymentSendFailure : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.PaymentSendFailure b) { - bool ret = bindings.PaymentSendFailure_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PaymentSendFailure_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/PeeledOnion.cs b/c_sharp/src/org/ldk/structs/PeeledOnion.cs index e3840e4e..c7d741bd 100644 --- a/c_sharp/src/org/ldk/structs/PeeledOnion.cs +++ b/c_sharp/src/org/ldk/structs/PeeledOnion.cs @@ -27,12 +27,13 @@ public class PeeledOnion : CommonBase { /** A PeeledOnion of type Forward */ public class PeeledOnion_Forward : PeeledOnion { - public byte[] _0; + public NextMessageHop _0; public OnionMessage _1; internal PeeledOnion_Forward(long ptr) : base(null, ptr) { long _0 = bindings.LDKPeeledOnion_Forward_get__0(ptr); - byte[] _0_conv = InternalUtils.decodeUint8Array(_0); - this._0 = _0_conv; + org.ldk.structs.NextMessageHop _0_hu_conv = org.ldk.structs.NextMessageHop.constr_from_ptr(_0); + if (_0_hu_conv != null) { _0_hu_conv.ptrs_to.AddLast(this); }; + this._0 = _0_hu_conv; long _1 = bindings.LDKPeeledOnion_Forward_get__1(ptr); org.ldk.structs.OnionMessage _1_hu_conv = null; if (_1 < 0 || _1 > 4096) { _1_hu_conv = new org.ldk.structs.OnionMessage(null, _1); } if (_1_hu_conv != null) { _1_hu_conv.ptrs_to.AddLast(this); }; @@ -85,13 +86,14 @@ public class PeeledOnion : CommonBase { /** * Utility method to constructs a new Forward-variant PeeledOnion */ - public static PeeledOnion forward(byte[] a, org.ldk.structs.OnionMessage b) { - long ret = bindings.PeeledOnion_forward(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33)), b == null ? 0 : b.ptr); + public static PeeledOnion forward(org.ldk.structs.NextMessageHop a, org.ldk.structs.OnionMessage b) { + long ret = bindings.PeeledOnion_forward(a.ptr, b.ptr); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PeeledOnion ret_hu_conv = org.ldk.structs.PeeledOnion.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; return ret_hu_conv; } @@ -100,7 +102,7 @@ public class PeeledOnion : CommonBase { * Utility method to constructs a new Receive-variant PeeledOnion */ public static PeeledOnion receive(org.ldk.structs.ParsedOnionMessageContents a, byte[] b, org.ldk.structs.BlindedPath c) { - long ret = bindings.PeeledOnion_receive(a.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(b, 32)), c == null ? 0 : c.ptr); + long ret = bindings.PeeledOnion_receive(a.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(b, 32)), c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/PeerDetails.cs b/c_sharp/src/org/ldk/structs/PeerDetails.cs new file mode 100644 index 00000000..3b9c6ffa --- /dev/null +++ b/c_sharp/src/org/ldk/structs/PeerDetails.cs @@ -0,0 +1,136 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Details of a connected peer as returned by [`PeerManager::list_peers`]. + */ +public class PeerDetails : CommonBase { + internal PeerDetails(object _dummy, long ptr) : base(ptr) { } + ~PeerDetails() { + if (ptr != 0) { bindings.PeerDetails_free(ptr); } + } + + /** + * The node id of the peer. + * + * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter + * passed in to [`PeerManager::new_outbound_connection`]. + */ + public byte[] get_counterparty_node_id() { + long ret = bindings.PeerDetails_get_counterparty_node_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * The node id of the peer. + * + * For outbound connections, this [`PublicKey`] will be the same as the `their_node_id` parameter + * passed in to [`PeerManager::new_outbound_connection`]. + */ + public void set_counterparty_node_id(byte[] val) { + bindings.PeerDetails_set_counterparty_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * The socket address the peer provided in the initial handshake. + * + * Will only be `Some` if an address had been previously provided to + * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`]. + * + * Returns a copy of the field. + */ + public Option_SocketAddressZ get_socket_address() { + long ret = bindings.PeerDetails_get_socket_address(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_SocketAddressZ ret_hu_conv = org.ldk.structs.Option_SocketAddressZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The socket address the peer provided in the initial handshake. + * + * Will only be `Some` if an address had been previously provided to + * [`PeerManager::new_outbound_connection`] or [`PeerManager::new_inbound_connection`]. + */ + public void set_socket_address(org.ldk.structs.Option_SocketAddressZ val) { + bindings.PeerDetails_set_socket_address(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The features the peer provided in the initial handshake. + */ + public InitFeatures get_init_features() { + long ret = bindings.PeerDetails_get_init_features(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The features the peer provided in the initial handshake. + */ + public void set_init_features(org.ldk.structs.InitFeatures val) { + bindings.PeerDetails_set_init_features(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Indicates the direction of the peer connection. + * + * Will be `true` for inbound connections, and `false` for outbound connections. + */ + public bool get_is_inbound_connection() { + bool ret = bindings.PeerDetails_get_is_inbound_connection(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Indicates the direction of the peer connection. + * + * Will be `true` for inbound connections, and `false` for outbound connections. + */ + public void set_is_inbound_connection(bool val) { + bindings.PeerDetails_set_is_inbound_connection(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new PeerDetails given each field + */ + public static PeerDetails of(byte[] counterparty_node_id_arg, org.ldk.structs.Option_SocketAddressZ socket_address_arg, org.ldk.structs.InitFeatures init_features_arg, bool is_inbound_connection_arg) { + long ret = bindings.PeerDetails_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(counterparty_node_id_arg, 33)), socket_address_arg.ptr, init_features_arg.ptr, is_inbound_connection_arg); + GC.KeepAlive(counterparty_node_id_arg); + GC.KeepAlive(socket_address_arg); + GC.KeepAlive(init_features_arg); + GC.KeepAlive(is_inbound_connection_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PeerDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerDetails(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(socket_address_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(init_features_arg); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/PeerManager.cs b/c_sharp/src/org/ldk/structs/PeerManager.cs index 051f3bf2..c2e1eeb0 100644 --- a/c_sharp/src/org/ldk/structs/PeerManager.cs +++ b/c_sharp/src/org/ldk/structs/PeerManager.cs @@ -67,31 +67,40 @@ public class PeerManager : CommonBase { } /** - * Get a list of tuples mapping from node id to network addresses for peers which have - * completed the initial handshake. - * - * For outbound connections, the [`PublicKey`] will be the same as the `their_node_id` parameter - * passed in to [`Self::new_outbound_connection`], however entries will only appear once the initial - * handshake has completed and we are sure the remote peer has the private key for the given - * [`PublicKey`]. - * - * The returned `Option`s will only be `Some` if an address had been previously given via - * [`Self::new_outbound_connection`] or [`Self::new_inbound_connection`]. + * Returns a list of [`PeerDetails`] for connected peers that have completed the initial + * handshake. */ - public TwoTuple_PublicKeyCOption_SocketAddressZZ[] get_peer_node_ids() { - long ret = bindings.PeerManager_get_peer_node_ids(this.ptr); + public PeerDetails[] list_peers() { + long ret = bindings.PeerManager_list_peers(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_43_len = InternalUtils.getArrayLength(ret); - TwoTuple_PublicKeyCOption_SocketAddressZZ[] ret_conv_43_arr = new TwoTuple_PublicKeyCOption_SocketAddressZZ[ret_conv_43_len]; - for (int r = 0; r < ret_conv_43_len; r++) { - long ret_conv_43 = InternalUtils.getU64ArrayElem(ret, r); - TwoTuple_PublicKeyCOption_SocketAddressZZ ret_conv_43_hu_conv = new TwoTuple_PublicKeyCOption_SocketAddressZZ(null, ret_conv_43); - if (ret_conv_43_hu_conv != null) { ret_conv_43_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_43_arr[r] = ret_conv_43_hu_conv; + int ret_conv_13_len = InternalUtils.getArrayLength(ret); + PeerDetails[] ret_conv_13_arr = new PeerDetails[ret_conv_13_len]; + for (int n = 0; n < ret_conv_13_len; n++) { + long ret_conv_13 = InternalUtils.getU64ArrayElem(ret, n); + org.ldk.structs.PeerDetails ret_conv_13_hu_conv = null; if (ret_conv_13 < 0 || ret_conv_13 > 4096) { ret_conv_13_hu_conv = new org.ldk.structs.PeerDetails(null, ret_conv_13); } + if (ret_conv_13_hu_conv != null) { ret_conv_13_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_13_arr[n] = ret_conv_13_hu_conv; } bindings.free_buffer(ret); - return ret_conv_43_arr; + return ret_conv_13_arr; + } + + /** + * Returns the [`PeerDetails`] of a connected peer that has completed the initial handshake. + * + * Will return `None` if the peer is unknown or it hasn't completed the initial handshake. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public PeerDetails peer_by_node_id(byte[] their_node_id) { + long ret = bindings.PeerManager_peer_by_node_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33))); + GC.KeepAlive(this); + GC.KeepAlive(their_node_id); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PeerDetails ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.PeerDetails(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** diff --git a/c_sharp/src/org/ldk/structs/PendingHTLCRouting.cs b/c_sharp/src/org/ldk/structs/PendingHTLCRouting.cs index 3dbd49ed..b771b900 100644 --- a/c_sharp/src/org/ldk/structs/PendingHTLCRouting.cs +++ b/c_sharp/src/org/ldk/structs/PendingHTLCRouting.cs @@ -74,6 +74,13 @@ public class PendingHTLCRouting : CommonBase { * [`RecipientOnionFields::payment_metadata`]. */ public Option_CVec_u8ZZ payment_metadata; + /** + * The context of the payment included by the recipient in a blinded path, or `None` if a + * blinded path was not used. + * + * Used in part to determine the [`events::PaymentPurpose`]. + */ + public Option_PaymentContextZ payment_context; /** * CLTV expiry of the received HTLC. * @@ -109,6 +116,10 @@ public class PendingHTLCRouting : CommonBase { org.ldk.structs.Option_CVec_u8ZZ payment_metadata_hu_conv = org.ldk.structs.Option_CVec_u8ZZ.constr_from_ptr(payment_metadata); if (payment_metadata_hu_conv != null) { payment_metadata_hu_conv.ptrs_to.AddLast(this); }; this.payment_metadata = payment_metadata_hu_conv; + long payment_context = bindings.LDKPendingHTLCRouting_Receive_get_payment_context(ptr); + org.ldk.structs.Option_PaymentContextZ payment_context_hu_conv = org.ldk.structs.Option_PaymentContextZ.constr_from_ptr(payment_context); + if (payment_context_hu_conv != null) { payment_context_hu_conv.ptrs_to.AddLast(this); }; + this.payment_context = payment_context_hu_conv; this.incoming_cltv_expiry = bindings.LDKPendingHTLCRouting_Receive_get_incoming_cltv_expiry(ptr); long phantom_shared_secret = bindings.LDKPendingHTLCRouting_Receive_get_phantom_shared_secret(ptr); byte[] phantom_shared_secret_conv = InternalUtils.decodeUint8Array(phantom_shared_secret); @@ -164,6 +175,10 @@ public class PendingHTLCRouting : CommonBase { * [`RecipientOnionFields::custom_tlvs`]. */ public TwoTuple_u64CVec_u8ZZ[] custom_tlvs; + /** + * Set if this HTLC is the final hop in a multi-hop blinded path. + */ + public bool requires_blinded_error; internal PendingHTLCRouting_ReceiveKeysend(long ptr) : base(null, ptr) { long payment_data = bindings.LDKPendingHTLCRouting_ReceiveKeysend_get_payment_data(ptr); org.ldk.structs.FinalOnionHopData payment_data_hu_conv = null; if (payment_data < 0 || payment_data > 4096) { payment_data_hu_conv = new org.ldk.structs.FinalOnionHopData(null, payment_data); } @@ -188,6 +203,7 @@ public class PendingHTLCRouting : CommonBase { } bindings.free_buffer(custom_tlvs); this.custom_tlvs = custom_tlvs_conv_23_arr; + this.requires_blinded_error = bindings.LDKPendingHTLCRouting_ReceiveKeysend_get_requires_blinded_error(ptr); } } internal long clone_ptr() { @@ -212,7 +228,7 @@ public class PendingHTLCRouting : CommonBase { * Utility method to constructs a new Forward-variant PendingHTLCRouting */ public static PendingHTLCRouting forward(org.ldk.structs.OnionPacket onion_packet, long short_channel_id, org.ldk.structs.BlindedForward blinded) { - long ret = bindings.PendingHTLCRouting_forward(onion_packet == null ? 0 : onion_packet.ptr, short_channel_id, blinded == null ? 0 : blinded.ptr); + long ret = bindings.PendingHTLCRouting_forward(onion_packet.ptr, short_channel_id, blinded.ptr); GC.KeepAlive(onion_packet); GC.KeepAlive(short_channel_id); GC.KeepAlive(blinded); @@ -227,10 +243,11 @@ public class PendingHTLCRouting : CommonBase { /** * Utility method to constructs a new Receive-variant PendingHTLCRouting */ - public static PendingHTLCRouting receive(org.ldk.structs.FinalOnionHopData payment_data, org.ldk.structs.Option_CVec_u8ZZ payment_metadata, int incoming_cltv_expiry, byte[] phantom_shared_secret, TwoTuple_u64CVec_u8ZZ[] custom_tlvs, bool requires_blinded_error) { - long ret = bindings.PendingHTLCRouting_receive(payment_data == null ? 0 : payment_data.ptr, payment_metadata.ptr, incoming_cltv_expiry, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(phantom_shared_secret, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(custom_tlvs, custom_tlvs_conv_23 => custom_tlvs_conv_23 != null ? custom_tlvs_conv_23.ptr : 0)), requires_blinded_error); + public static PendingHTLCRouting receive(org.ldk.structs.FinalOnionHopData payment_data, org.ldk.structs.Option_CVec_u8ZZ payment_metadata, org.ldk.structs.Option_PaymentContextZ payment_context, int incoming_cltv_expiry, byte[] phantom_shared_secret, TwoTuple_u64CVec_u8ZZ[] custom_tlvs, bool requires_blinded_error) { + long ret = bindings.PendingHTLCRouting_receive(payment_data.ptr, payment_metadata.ptr, payment_context.ptr, incoming_cltv_expiry, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(phantom_shared_secret, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(custom_tlvs, custom_tlvs_conv_23 => custom_tlvs_conv_23.ptr)), requires_blinded_error); GC.KeepAlive(payment_data); GC.KeepAlive(payment_metadata); + GC.KeepAlive(payment_context); GC.KeepAlive(incoming_cltv_expiry); GC.KeepAlive(phantom_shared_secret); GC.KeepAlive(custom_tlvs); @@ -240,19 +257,21 @@ public class PendingHTLCRouting : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_data); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_metadata); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_context); }; return ret_hu_conv; } /** * Utility method to constructs a new ReceiveKeysend-variant PendingHTLCRouting */ - public static PendingHTLCRouting receive_keysend(org.ldk.structs.FinalOnionHopData payment_data, byte[] payment_preimage, org.ldk.structs.Option_CVec_u8ZZ payment_metadata, int incoming_cltv_expiry, TwoTuple_u64CVec_u8ZZ[] custom_tlvs) { - long ret = bindings.PendingHTLCRouting_receive_keysend(payment_data == null ? 0 : payment_data.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_preimage, 32)), payment_metadata.ptr, incoming_cltv_expiry, InternalUtils.encodeUint64Array(InternalUtils.mapArray(custom_tlvs, custom_tlvs_conv_23 => custom_tlvs_conv_23 != null ? custom_tlvs_conv_23.ptr : 0))); + public static PendingHTLCRouting receive_keysend(org.ldk.structs.FinalOnionHopData payment_data, byte[] payment_preimage, org.ldk.structs.Option_CVec_u8ZZ payment_metadata, int incoming_cltv_expiry, TwoTuple_u64CVec_u8ZZ[] custom_tlvs, bool requires_blinded_error) { + long ret = bindings.PendingHTLCRouting_receive_keysend(payment_data.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_preimage, 32)), payment_metadata.ptr, incoming_cltv_expiry, InternalUtils.encodeUint64Array(InternalUtils.mapArray(custom_tlvs, custom_tlvs_conv_23 => custom_tlvs_conv_23.ptr)), requires_blinded_error); GC.KeepAlive(payment_data); GC.KeepAlive(payment_preimage); GC.KeepAlive(payment_metadata); GC.KeepAlive(incoming_cltv_expiry); GC.KeepAlive(custom_tlvs); + GC.KeepAlive(requires_blinded_error); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.PendingHTLCRouting ret_hu_conv = org.ldk.structs.PendingHTLCRouting.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; diff --git a/c_sharp/src/org/ldk/structs/Persist.cs b/c_sharp/src/org/ldk/structs/Persist.cs index 6cbed960..8ce9e19e 100644 --- a/c_sharp/src/org/ldk/structs/Persist.cs +++ b/c_sharp/src/org/ldk/structs/Persist.cs @@ -26,7 +26,7 @@ public interface PersistInterface { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`Writeable::write`]: crate::util::ser::Writeable::write */ - ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_id, ChannelMonitor data, MonitorUpdateId update_id); + ChannelMonitorUpdateStatus persist_new_channel(OutPoint channel_funding_outpoint, ChannelMonitor data, MonitorUpdateId update_id); /**Update one channel's data. The provided [`ChannelMonitor`] has already applied the given * update. * @@ -63,7 +63,13 @@ public interface PersistInterface { * * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None */ - ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_id, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id); + ChannelMonitorUpdateStatus update_persisted_channel(OutPoint channel_funding_outpoint, ChannelMonitorUpdate update, ChannelMonitor data, MonitorUpdateId update_id); + /**Prevents the channel monitor from being loaded on startup. + * + * Archiving the data in a backup location (rather than deleting it fully) is useful for + * hedging against data loss in case of unexpected failure. + */ + void archive_persisted_channel(OutPoint channel_funding_outpoint); } /** @@ -137,28 +143,34 @@ public class Persist : CommonBase { internal LDKPersistImpl(PersistInterface arg, LDKPersistHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } private PersistInterface arg; private LDKPersistHolder impl_holder; - public ChannelMonitorUpdateStatus persist_new_channel(long _channel_id, long _data, long _update_id) { - org.ldk.structs.OutPoint _channel_id_hu_conv = null; if (_channel_id < 0 || _channel_id > 4096) { _channel_id_hu_conv = new org.ldk.structs.OutPoint(null, _channel_id); } - if (_channel_id_hu_conv != null) { _channel_id_hu_conv.ptrs_to.AddLast(this); }; + public ChannelMonitorUpdateStatus persist_new_channel(long _channel_funding_outpoint, long _data, long _update_id) { + org.ldk.structs.OutPoint _channel_funding_outpoint_hu_conv = null; if (_channel_funding_outpoint < 0 || _channel_funding_outpoint > 4096) { _channel_funding_outpoint_hu_conv = new org.ldk.structs.OutPoint(null, _channel_funding_outpoint); } + if (_channel_funding_outpoint_hu_conv != null) { _channel_funding_outpoint_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ChannelMonitor _data_hu_conv = null; if (_data < 0 || _data > 4096) { _data_hu_conv = new org.ldk.structs.ChannelMonitor(null, _data); } org.ldk.structs.MonitorUpdateId _update_id_hu_conv = null; if (_update_id < 0 || _update_id > 4096) { _update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, _update_id); } if (_update_id_hu_conv != null) { _update_id_hu_conv.ptrs_to.AddLast(this); }; - ChannelMonitorUpdateStatus ret = arg.persist_new_channel(_channel_id_hu_conv, _data_hu_conv, _update_id_hu_conv); + ChannelMonitorUpdateStatus ret = arg.persist_new_channel(_channel_funding_outpoint_hu_conv, _data_hu_conv, _update_id_hu_conv); GC.KeepAlive(arg); return ret; } - public ChannelMonitorUpdateStatus update_persisted_channel(long _channel_id, long _update, long _data, long _update_id) { - org.ldk.structs.OutPoint _channel_id_hu_conv = null; if (_channel_id < 0 || _channel_id > 4096) { _channel_id_hu_conv = new org.ldk.structs.OutPoint(null, _channel_id); } - if (_channel_id_hu_conv != null) { _channel_id_hu_conv.ptrs_to.AddLast(this); }; + public ChannelMonitorUpdateStatus update_persisted_channel(long _channel_funding_outpoint, long _update, long _data, long _update_id) { + org.ldk.structs.OutPoint _channel_funding_outpoint_hu_conv = null; if (_channel_funding_outpoint < 0 || _channel_funding_outpoint > 4096) { _channel_funding_outpoint_hu_conv = new org.ldk.structs.OutPoint(null, _channel_funding_outpoint); } + if (_channel_funding_outpoint_hu_conv != null) { _channel_funding_outpoint_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ChannelMonitorUpdate _update_hu_conv = null; if (_update < 0 || _update > 4096) { _update_hu_conv = new org.ldk.structs.ChannelMonitorUpdate(null, _update); } if (_update_hu_conv != null) { _update_hu_conv.ptrs_to.AddLast(this); }; org.ldk.structs.ChannelMonitor _data_hu_conv = null; if (_data < 0 || _data > 4096) { _data_hu_conv = new org.ldk.structs.ChannelMonitor(null, _data); } org.ldk.structs.MonitorUpdateId _update_id_hu_conv = null; if (_update_id < 0 || _update_id > 4096) { _update_id_hu_conv = new org.ldk.structs.MonitorUpdateId(null, _update_id); } if (_update_id_hu_conv != null) { _update_id_hu_conv.ptrs_to.AddLast(this); }; - ChannelMonitorUpdateStatus ret = arg.update_persisted_channel(_channel_id_hu_conv, _update_hu_conv, _data_hu_conv, _update_id_hu_conv); + ChannelMonitorUpdateStatus ret = arg.update_persisted_channel(_channel_funding_outpoint_hu_conv, _update_hu_conv, _data_hu_conv, _update_id_hu_conv); GC.KeepAlive(arg); return ret; } + public void archive_persisted_channel(long _channel_funding_outpoint) { + org.ldk.structs.OutPoint _channel_funding_outpoint_hu_conv = null; if (_channel_funding_outpoint < 0 || _channel_funding_outpoint > 4096) { _channel_funding_outpoint_hu_conv = new org.ldk.structs.OutPoint(null, _channel_funding_outpoint); } + if (_channel_funding_outpoint_hu_conv != null) { _channel_funding_outpoint_hu_conv.ptrs_to.AddLast(this); }; + arg.archive_persisted_channel(_channel_funding_outpoint_hu_conv); + GC.KeepAlive(arg); + } } /** Creates a new instance of Persist from a given implementation */ @@ -190,13 +202,13 @@ public class Persist : CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager * [`Writeable::write`]: crate::util::ser::Writeable::write */ - public ChannelMonitorUpdateStatus persist_new_channel(org.ldk.structs.OutPoint channel_id, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { - ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr); + public ChannelMonitorUpdateStatus persist_new_channel(org.ldk.structs.OutPoint channel_funding_outpoint, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { + ChannelMonitorUpdateStatus ret = bindings.Persist_persist_new_channel(this.ptr, channel_funding_outpoint.ptr, data.ptr, update_id.ptr); GC.KeepAlive(this); - GC.KeepAlive(channel_id); + GC.KeepAlive(channel_funding_outpoint); GC.KeepAlive(data); GC.KeepAlive(update_id); - if (this != null) { this.ptrs_to.AddLast(channel_id); }; + if (this != null) { this.ptrs_to.AddLast(channel_funding_outpoint); }; if (this != null) { this.ptrs_to.AddLast(data); }; if (this != null) { this.ptrs_to.AddLast(update_id); }; return ret; @@ -239,19 +251,32 @@ public class Persist : CommonBase { * * Note that update (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public ChannelMonitorUpdateStatus update_persisted_channel(org.ldk.structs.OutPoint channel_id, org.ldk.structs.ChannelMonitorUpdate update, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { - ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_id == null ? 0 : channel_id.ptr, update == null ? 0 : update.ptr, data == null ? 0 : data.ptr, update_id == null ? 0 : update_id.ptr); + public ChannelMonitorUpdateStatus update_persisted_channel(org.ldk.structs.OutPoint channel_funding_outpoint, org.ldk.structs.ChannelMonitorUpdate update, org.ldk.structs.ChannelMonitor data, org.ldk.structs.MonitorUpdateId update_id) { + ChannelMonitorUpdateStatus ret = bindings.Persist_update_persisted_channel(this.ptr, channel_funding_outpoint.ptr, update == null ? 0 : update.ptr, data.ptr, update_id.ptr); GC.KeepAlive(this); - GC.KeepAlive(channel_id); + GC.KeepAlive(channel_funding_outpoint); GC.KeepAlive(update); GC.KeepAlive(data); GC.KeepAlive(update_id); - if (this != null) { this.ptrs_to.AddLast(channel_id); }; + if (this != null) { this.ptrs_to.AddLast(channel_funding_outpoint); }; if (this != null) { this.ptrs_to.AddLast(update); }; if (this != null) { this.ptrs_to.AddLast(data); }; if (this != null) { this.ptrs_to.AddLast(update_id); }; return ret; } + /** + * Prevents the channel monitor from being loaded on startup. + * + * Archiving the data in a backup location (rather than deleting it fully) is useful for + * hedging against data loss in case of unexpected failure. + */ + public void archive_persisted_channel(org.ldk.structs.OutPoint channel_funding_outpoint) { + bindings.Persist_archive_persisted_channel(this.ptr, channel_funding_outpoint.ptr); + GC.KeepAlive(this); + GC.KeepAlive(channel_funding_outpoint); + if (this != null) { this.ptrs_to.AddLast(channel_funding_outpoint); }; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Persister.cs b/c_sharp/src/org/ldk/structs/Persister.cs index 6f707579..b28ea22b 100644 --- a/c_sharp/src/org/ldk/structs/Persister.cs +++ b/c_sharp/src/org/ldk/structs/Persister.cs @@ -11,6 +11,8 @@ namespace org { namespace ldk { namespace structs { /** An implementation of Persister */ public interface PersisterInterface { /**Persist the given ['ChannelManager'] to disk, returning an error if persistence failed. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ Result_NoneIOErrorZ persist_manager(ChannelManager channel_manager); /**Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed. @@ -23,6 +25,8 @@ public interface PersisterInterface { /** * Trait that handles persisting a [`ChannelManager`], [`NetworkGraph`], and [`WriteableScore`] to disk. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public class Persister : CommonBase { internal bindings.LDKPersister bindings_instance; @@ -42,14 +46,14 @@ public class Persister : CommonBase { org.ldk.structs.ChannelManager _channel_manager_hu_conv = null; if (_channel_manager < 0 || _channel_manager > 4096) { _channel_manager_hu_conv = new org.ldk.structs.ChannelManager(null, _channel_manager); } Result_NoneIOErrorZ ret = arg.persist_manager(_channel_manager_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long persist_graph(long _network_graph) { org.ldk.structs.NetworkGraph _network_graph_hu_conv = null; if (_network_graph < 0 || _network_graph > 4096) { _network_graph_hu_conv = new org.ldk.structs.NetworkGraph(null, _network_graph); } Result_NoneIOErrorZ ret = arg.persist_graph(_network_graph_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long persist_scorer(long _scorer) { @@ -57,7 +61,7 @@ public class Persister : CommonBase { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; Result_NoneIOErrorZ ret = arg.persist_scorer(ret_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -76,9 +80,11 @@ public class Persister : CommonBase { /** * Persist the given ['ChannelManager'] to disk, returning an error if persistence failed. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public Result_NoneIOErrorZ persist_manager(org.ldk.structs.ChannelManager channel_manager) { - long ret = bindings.Persister_persist_manager(this.ptr, channel_manager == null ? 0 : channel_manager.ptr); + long ret = bindings.Persister_persist_manager(this.ptr, channel_manager.ptr); GC.KeepAlive(this); GC.KeepAlive(channel_manager); if (ret >= 0 && ret <= 4096) { return null; } @@ -91,7 +97,7 @@ public class Persister : CommonBase { * Persist the given [`NetworkGraph`] to disk, returning an error if persistence failed. */ public Result_NoneIOErrorZ persist_graph(org.ldk.structs.NetworkGraph network_graph) { - long ret = bindings.Persister_persist_graph(this.ptr, network_graph == null ? 0 : network_graph.ptr); + long ret = bindings.Persister_persist_graph(this.ptr, network_graph.ptr); GC.KeepAlive(this); GC.KeepAlive(network_graph); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs b/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs index 1453a891..b960f847 100644 --- a/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs +++ b/c_sharp/src/org/ldk/structs/PhantomKeysManager.cs @@ -55,6 +55,19 @@ public class PhantomKeysManager : CommonBase { return ret_hu_conv; } + /** + * Constructs a new OutputSpender which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned OutputSpender must be freed before this_arg is + */ + public OutputSpender as_OutputSpender() { + long ret = bindings.PhantomKeysManager_as_OutputSpender(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + OutputSpender ret_hu_conv = new OutputSpender(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Constructs a new SignerProvider which calls the relevant methods on this_arg. * This copies the `inner` pointer in this_arg and thus the returned SignerProvider must be freed before this_arg is @@ -93,24 +106,6 @@ public class PhantomKeysManager : CommonBase { return ret_hu_conv; } - /** - * See [`KeysManager::spend_spendable_outputs`] for documentation on this method. - */ - public Result_TransactionNoneZ spend_spendable_outputs(SpendableOutputDescriptor[] descriptors, TxOut[] outputs, byte[] change_destination_script, int feerate_sat_per_1000_weight, org.ldk.structs.Option_u32Z locktime) { - long ret = bindings.PhantomKeysManager_spend_spendable_outputs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(descriptors, descriptors_conv_27 => descriptors_conv_27.ptr)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(outputs, outputs_conv_7 => outputs_conv_7.ptr)), InternalUtils.encodeUint8Array(change_destination_script), feerate_sat_per_1000_weight, locktime.ptr); - GC.KeepAlive(this); - GC.KeepAlive(descriptors); - GC.KeepAlive(outputs); - GC.KeepAlive(change_destination_script); - GC.KeepAlive(feerate_sat_per_1000_weight); - GC.KeepAlive(locktime); - if (ret >= 0 && ret <= 4096) { return null; } - Result_TransactionNoneZ ret_hu_conv = Result_TransactionNoneZ.constr_from_ptr(ret); - foreach (SpendableOutputDescriptor descriptors_conv_27 in descriptors) { if (this != null) { this.ptrs_to.AddLast(descriptors_conv_27); }; }; - if (this != null) { this.ptrs_to.AddLast(locktime); }; - return ret_hu_conv; - } - /** * See [`KeysManager::derive_channel_keys`] for documentation on this method. */ diff --git a/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs b/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs index e6587b8b..1ff36125 100644 --- a/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs +++ b/c_sharp/src/org/ldk/structs/PhantomRouteHints.cs @@ -40,7 +40,7 @@ public class PhantomRouteHints : CommonBase { * The list of channels to be included in the invoice route hints. */ public void set_channels(ChannelDetails[] val) { - bindings.PhantomRouteHints_set_channels(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_16 => val_conv_16 == null ? 0 : val_conv_16.ptr))); + bindings.PhantomRouteHints_set_channels(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_16 => val_conv_16.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (ChannelDetails val_conv_16 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_16); }; }; @@ -90,7 +90,7 @@ public class PhantomRouteHints : CommonBase { * Constructs a new PhantomRouteHints given each field */ public static PhantomRouteHints of(ChannelDetails[] channels_arg, long phantom_scid_arg, byte[] real_node_pubkey_arg) { - long ret = bindings.PhantomRouteHints_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(channels_arg, channels_arg_conv_16 => channels_arg_conv_16 == null ? 0 : channels_arg_conv_16.ptr)), phantom_scid_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(real_node_pubkey_arg, 33))); + long ret = bindings.PhantomRouteHints_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(channels_arg, channels_arg_conv_16 => channels_arg_conv_16.ptr)), phantom_scid_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(real_node_pubkey_arg, 33))); GC.KeepAlive(channels_arg); GC.KeepAlive(phantom_scid_arg); GC.KeepAlive(real_node_pubkey_arg); diff --git a/c_sharp/src/org/ldk/structs/Ping.cs b/c_sharp/src/org/ldk/structs/Ping.cs index cf5d834d..9888a26a 100644 --- a/c_sharp/src/org/ldk/structs/Ping.cs +++ b/c_sharp/src/org/ldk/structs/Ping.cs @@ -106,7 +106,7 @@ public class Ping : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Ping b) { - bool ret = bindings.Ping_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Ping_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Pong.cs b/c_sharp/src/org/ldk/structs/Pong.cs index 7d31da14..46f56734 100644 --- a/c_sharp/src/org/ldk/structs/Pong.cs +++ b/c_sharp/src/org/ldk/structs/Pong.cs @@ -87,7 +87,7 @@ public class Pong : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Pong b) { - bool ret = bindings.Pong_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Pong_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs b/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs index ad36693d..3da143ff 100644 --- a/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs +++ b/c_sharp/src/org/ldk/structs/PositiveTimestamp.cs @@ -26,7 +26,7 @@ public class PositiveTimestamp : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.PositiveTimestamp b) { - bool ret = bindings.PositiveTimestamp_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PositiveTimestamp_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/PrivateRoute.cs b/c_sharp/src/org/ldk/structs/PrivateRoute.cs index 96e69604..8c6f7f70 100644 --- a/c_sharp/src/org/ldk/structs/PrivateRoute.cs +++ b/c_sharp/src/org/ldk/structs/PrivateRoute.cs @@ -54,7 +54,7 @@ public class PrivateRoute : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.PrivateRoute b) { - bool ret = bindings.PrivateRoute_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.PrivateRoute_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -69,7 +69,7 @@ public class PrivateRoute : CommonBase { * Creates a new (partial) route from a list of hops */ public static Result_PrivateRouteCreationErrorZ of(org.ldk.structs.RouteHint hops) { - long ret = bindings.PrivateRoute_new(hops == null ? 0 : hops.ptr); + long ret = bindings.PrivateRoute_new(hops.ptr); GC.KeepAlive(hops); if (ret >= 0 && ret <= 4096) { return null; } Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs index 333e3ab4..bffdc449 100644 --- a/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScorer.cs @@ -50,7 +50,7 @@ public class ProbabilisticScorer : CommonBase { * through a network graph. */ public static ProbabilisticScorer of(org.ldk.structs.ProbabilisticScoringDecayParameters decay_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { - long ret = bindings.ProbabilisticScorer_new(decay_params == null ? 0 : decay_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr); + long ret = bindings.ProbabilisticScorer_new(decay_params.ptr, network_graph.ptr, logger.ptr); GC.KeepAlive(decay_params); GC.KeepAlive(network_graph); GC.KeepAlive(logger); @@ -79,7 +79,7 @@ public class ProbabilisticScorer : CommonBase { * channel with `scid` towards the given `target` node. */ public Option_C2Tuple_u64u64ZZ estimated_channel_liquidity_range(long scid, org.ldk.structs.NodeId target) { - long ret = bindings.ProbabilisticScorer_estimated_channel_liquidity_range(this.ptr, scid, target == null ? 0 : target.ptr); + long ret = bindings.ProbabilisticScorer_estimated_channel_liquidity_range(this.ptr, scid, target.ptr); GC.KeepAlive(this); GC.KeepAlive(scid); GC.KeepAlive(target); @@ -119,7 +119,7 @@ public class ProbabilisticScorer : CommonBase { * the scoring model, see [`Self::historical_estimated_payment_success_probability`]. */ public Option_C2Tuple_ThirtyTwoU16sThirtyTwoU16sZZ historical_estimated_channel_liquidity_probabilities(long scid, org.ldk.structs.NodeId target) { - long ret = bindings.ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(this.ptr, scid, target == null ? 0 : target.ptr); + long ret = bindings.ProbabilisticScorer_historical_estimated_channel_liquidity_probabilities(this.ptr, scid, target.ptr); GC.KeepAlive(this); GC.KeepAlive(scid); GC.KeepAlive(target); @@ -140,7 +140,7 @@ public class ProbabilisticScorer : CommonBase { * [`Self::estimated_channel_liquidity_range`]). */ public Option_f64Z historical_estimated_payment_success_probability(long scid, org.ldk.structs.NodeId target, long amount_msat, org.ldk.structs.ProbabilisticScoringFeeParameters _params) { - long ret = bindings.ProbabilisticScorer_historical_estimated_payment_success_probability(this.ptr, scid, target == null ? 0 : target.ptr, amount_msat, _params == null ? 0 : _params.ptr); + long ret = bindings.ProbabilisticScorer_historical_estimated_payment_success_probability(this.ptr, scid, target.ptr, amount_msat, _params.ptr); GC.KeepAlive(this); GC.KeepAlive(scid); GC.KeepAlive(target); @@ -208,7 +208,7 @@ public class ProbabilisticScorer : CommonBase { * Read a ProbabilisticScorer from a byte array, created by ProbabilisticScorer_write */ public static Result_ProbabilisticScorerDecodeErrorZ read(byte[] ser, org.ldk.structs.ProbabilisticScoringDecayParameters arg_a, org.ldk.structs.NetworkGraph arg_b, org.ldk.structs.Logger arg_c) { - long ret = bindings.ProbabilisticScorer_read(InternalUtils.encodeUint8Array(ser), arg_a == null ? 0 : arg_a.ptr, arg_b == null ? 0 : arg_b.ptr, arg_c.ptr); + long ret = bindings.ProbabilisticScorer_read(InternalUtils.encodeUint8Array(ser), arg_a.ptr, arg_b.ptr, arg_c.ptr); GC.KeepAlive(ser); GC.KeepAlive(arg_a); GC.KeepAlive(arg_b); diff --git a/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs b/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs index c901c71d..f22e31df 100644 --- a/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs +++ b/c_sharp/src/org/ldk/structs/ProbabilisticScoringFeeParameters.cs @@ -457,7 +457,7 @@ public class ProbabilisticScoringFeeParameters : CommonBase { * i.e it will be avoided during path finding. */ public void add_banned(org.ldk.structs.NodeId node_id) { - bindings.ProbabilisticScoringFeeParameters_add_banned(this.ptr, node_id == null ? 0 : node_id.ptr); + bindings.ProbabilisticScoringFeeParameters_add_banned(this.ptr, node_id.ptr); GC.KeepAlive(this); GC.KeepAlive(node_id); if (this != null) { this.ptrs_to.AddLast(node_id); }; @@ -468,7 +468,7 @@ public class ProbabilisticScoringFeeParameters : CommonBase { * they will be avoided during path finding. */ public void add_banned_from_list(NodeId[] node_ids) { - bindings.ProbabilisticScoringFeeParameters_add_banned_from_list(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(node_ids, node_ids_conv_8 => node_ids_conv_8 == null ? 0 : node_ids_conv_8.ptr))); + bindings.ProbabilisticScoringFeeParameters_add_banned_from_list(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(node_ids, node_ids_conv_8 => node_ids_conv_8.ptr))); GC.KeepAlive(this); GC.KeepAlive(node_ids); foreach (NodeId node_ids_conv_8 in node_ids) { if (this != null) { this.ptrs_to.AddLast(node_ids_conv_8); }; }; @@ -478,7 +478,7 @@ public class ProbabilisticScoringFeeParameters : CommonBase { * Removes the node with the given `node_id` from the list of nodes to avoid. */ public void remove_banned(org.ldk.structs.NodeId node_id) { - bindings.ProbabilisticScoringFeeParameters_remove_banned(this.ptr, node_id == null ? 0 : node_id.ptr); + bindings.ProbabilisticScoringFeeParameters_remove_banned(this.ptr, node_id.ptr); GC.KeepAlive(this); GC.KeepAlive(node_id); if (this != null) { this.ptrs_to.AddLast(node_id); }; @@ -488,7 +488,7 @@ public class ProbabilisticScoringFeeParameters : CommonBase { * Sets a manual penalty for the given node. */ public void set_manual_penalty(org.ldk.structs.NodeId node_id, long penalty) { - bindings.ProbabilisticScoringFeeParameters_set_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr, penalty); + bindings.ProbabilisticScoringFeeParameters_set_manual_penalty(this.ptr, node_id.ptr, penalty); GC.KeepAlive(this); GC.KeepAlive(node_id); GC.KeepAlive(penalty); @@ -499,7 +499,7 @@ public class ProbabilisticScoringFeeParameters : CommonBase { * Removes the node with the given `node_id` from the list of manual penalties. */ public void remove_manual_penalty(org.ldk.structs.NodeId node_id) { - bindings.ProbabilisticScoringFeeParameters_remove_manual_penalty(this.ptr, node_id == null ? 0 : node_id.ptr); + bindings.ProbabilisticScoringFeeParameters_remove_manual_penalty(this.ptr, node_id.ptr); GC.KeepAlive(this); GC.KeepAlive(node_id); if (this != null) { this.ptrs_to.AddLast(node_id); }; diff --git a/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs b/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs index 34ec6c6a..fec1e3e7 100644 --- a/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs +++ b/c_sharp/src/org/ldk/structs/ProbeSendFailure.cs @@ -89,7 +89,7 @@ public class ProbeSendFailure : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.ProbeSendFailure b) { - bool ret = bindings.ProbeSendFailure_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ProbeSendFailure_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/Quantity.cs b/c_sharp/src/org/ldk/structs/Quantity.cs index 4cda4d9b..3ebea35c 100644 --- a/c_sharp/src/org/ldk/structs/Quantity.cs +++ b/c_sharp/src/org/ldk/structs/Quantity.cs @@ -5,16 +5,43 @@ using System; namespace org { namespace ldk { namespace structs { - /** * Quantity of items supported by an [`Offer`]. */ public class Quantity : CommonBase { - internal Quantity(object _dummy, long ptr) : base(ptr) { } + protected Quantity(object _dummy, long ptr) : base(ptr) { } ~Quantity() { if (ptr != 0) { bindings.Quantity_free(ptr); } } + internal static Quantity constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKQuantity_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new Quantity_Bounded(ptr); + case 1: return new Quantity_Unbounded(ptr); + case 2: return new Quantity_One(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A Quantity of type Bounded */ + public class Quantity_Bounded : Quantity { + public long bounded; + internal Quantity_Bounded(long ptr) : base(null, ptr) { + this.bounded = bindings.LDKQuantity_Bounded_get_bounded(ptr); + } + } + /** A Quantity of type Unbounded */ + public class Quantity_Unbounded : Quantity { + internal Quantity_Unbounded(long ptr) : base(null, ptr) { + } + } + /** A Quantity of type One */ + public class Quantity_One : Quantity { + internal Quantity_One(long ptr) : base(null, ptr) { + } + } internal long clone_ptr() { long ret = bindings.Quantity_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -28,10 +55,44 @@ public class Quantity : CommonBase { long ret = bindings.Quantity_clone(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } + /** + * Utility method to constructs a new Bounded-variant Quantity + */ + public static Quantity bounded(long a) { + long ret = bindings.Quantity_bounded(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Unbounded-variant Quantity + */ + public static Quantity unbounded() { + long ret = bindings.Quantity_unbounded(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new One-variant Quantity + */ + public static Quantity one() { + long ret = bindings.Quantity_one(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/QueryChannelRange.cs b/c_sharp/src/org/ldk/structs/QueryChannelRange.cs index 869c1ac5..4b1f7f62 100644 --- a/c_sharp/src/org/ldk/structs/QueryChannelRange.cs +++ b/c_sharp/src/org/ldk/structs/QueryChannelRange.cs @@ -126,7 +126,7 @@ public class QueryChannelRange : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.QueryChannelRange b) { - bool ret = bindings.QueryChannelRange_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.QueryChannelRange_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs b/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs index 318c3ac4..3158cea4 100644 --- a/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs +++ b/c_sharp/src/org/ldk/structs/QueryShortChannelIds.cs @@ -116,7 +116,7 @@ public class QueryShortChannelIds : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.QueryShortChannelIds b) { - bool ret = bindings.QueryShortChannelIds_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.QueryShortChannelIds_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RandomBytes.cs b/c_sharp/src/org/ldk/structs/RandomBytes.cs new file mode 100644 index 00000000..dc32b621 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/RandomBytes.cs @@ -0,0 +1,44 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An implementation of [`EntropySource`] using ChaCha20. + */ +public class RandomBytes : CommonBase { + internal RandomBytes(object _dummy, long ptr) : base(ptr) { } + ~RandomBytes() { + if (ptr != 0) { bindings.RandomBytes_free(ptr); } + } + + /** + * Creates a new instance using the given seed. + */ + public static RandomBytes of(byte[] seed) { + long ret = bindings.RandomBytes_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(seed, 32))); + GC.KeepAlive(seed); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RandomBytes ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RandomBytes(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Constructs a new EntropySource which calls the relevant methods on this_arg. + * This copies the `inner` pointer in this_arg and thus the returned EntropySource must be freed before this_arg is + */ + public EntropySource as_EntropySource() { + long ret = bindings.RandomBytes_as_EntropySource(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + EntropySource ret_hu_conv = new EntropySource(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs index 3937e289..02731cf2 100644 --- a/c_sharp/src/org/ldk/structs/RapidGossipSync.cs +++ b/c_sharp/src/org/ldk/structs/RapidGossipSync.cs @@ -23,7 +23,7 @@ public class RapidGossipSync : CommonBase { * Instantiate a new [`RapidGossipSync`] instance. */ public static RapidGossipSync of(org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger) { - long ret = bindings.RapidGossipSync_new(network_graph == null ? 0 : network_graph.ptr, logger.ptr); + long ret = bindings.RapidGossipSync_new(network_graph.ptr, logger.ptr); GC.KeepAlive(network_graph); GC.KeepAlive(logger); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs b/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs index 6eab6a88..8f3d8111 100644 --- a/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/RawBolt11Invoice.cs @@ -35,7 +35,7 @@ public class RawBolt11Invoice : CommonBase { * data part */ public void set_data(org.ldk.structs.RawDataPart val) { - bindings.RawBolt11Invoice_set_data(this.ptr, val == null ? 0 : val.ptr); + bindings.RawBolt11Invoice_set_data(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -47,7 +47,7 @@ public class RawBolt11Invoice : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RawBolt11Invoice b) { - bool ret = bindings.RawBolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RawBolt11Invoice_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -217,6 +217,9 @@ public class RawBolt11Invoice : CommonBase { return ret_conv_14_arr; } + /** + * Returns `None` if no amount is set or on overflow. + */ public Option_u64Z amount_pico_btc() { long ret = bindings.RawBolt11Invoice_amount_pico_btc(this.ptr); GC.KeepAlive(this); diff --git a/c_sharp/src/org/ldk/structs/RawDataPart.cs b/c_sharp/src/org/ldk/structs/RawDataPart.cs index 681dde88..c63b214a 100644 --- a/c_sharp/src/org/ldk/structs/RawDataPart.cs +++ b/c_sharp/src/org/ldk/structs/RawDataPart.cs @@ -31,7 +31,7 @@ public class RawDataPart : CommonBase { * generation time of the invoice */ public void set_timestamp(org.ldk.structs.PositiveTimestamp val) { - bindings.RawDataPart_set_timestamp(this.ptr, val == null ? 0 : val.ptr); + bindings.RawDataPart_set_timestamp(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -43,7 +43,7 @@ public class RawDataPart : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RawDataPart b) { - bool ret = bindings.RawDataPart_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RawDataPart_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ReadOnlyNetworkGraph.cs b/c_sharp/src/org/ldk/structs/ReadOnlyNetworkGraph.cs index 0434b890..1a0a1ebd 100644 --- a/c_sharp/src/org/ldk/structs/ReadOnlyNetworkGraph.cs +++ b/c_sharp/src/org/ldk/structs/ReadOnlyNetworkGraph.cs @@ -47,7 +47,7 @@ public class ReadOnlyNetworkGraph : CommonBase, IDisposable { * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public NodeInfo node(org.ldk.structs.NodeId node_id) { - long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id == null ? 0 : node_id.ptr); + long ret = bindings.ReadOnlyNetworkGraph_node(this.ptr, node_id.ptr); GC.KeepAlive(this); GC.KeepAlive(node_id); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs b/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs index 63b088ee..bccc65e3 100644 --- a/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs +++ b/c_sharp/src/org/ldk/structs/ReceiveTlvs.cs @@ -52,7 +52,29 @@ public class ReceiveTlvs : CommonBase { * Constraints for the receiver of this payment. */ public void set_payment_constraints(org.ldk.structs.PaymentConstraints val) { - bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val == null ? 0 : val.ptr); + bindings.ReceiveTlvs_set_payment_constraints(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Context for the receiver of this payment. + */ + public PaymentContext get_payment_context() { + long ret = bindings.ReceiveTlvs_get_payment_context(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.PaymentContext ret_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Context for the receiver of this payment. + */ + public void set_payment_context(org.ldk.structs.PaymentContext val) { + bindings.ReceiveTlvs_set_payment_context(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -61,14 +83,16 @@ public class ReceiveTlvs : CommonBase { /** * Constructs a new ReceiveTlvs given each field */ - public static ReceiveTlvs of(byte[] payment_secret_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg) { - long ret = bindings.ReceiveTlvs_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_secret_arg, 32)), payment_constraints_arg == null ? 0 : payment_constraints_arg.ptr); + public static ReceiveTlvs of(byte[] payment_secret_arg, org.ldk.structs.PaymentConstraints payment_constraints_arg, org.ldk.structs.PaymentContext payment_context_arg) { + long ret = bindings.ReceiveTlvs_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_secret_arg, 32)), payment_constraints_arg.ptr, payment_context_arg.ptr); GC.KeepAlive(payment_secret_arg); GC.KeepAlive(payment_constraints_arg); + GC.KeepAlive(payment_context_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.ReceiveTlvs ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ReceiveTlvs(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_constraints_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(payment_context_arg); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs b/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs index 219c2911..cec4805f 100644 --- a/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs +++ b/c_sharp/src/org/ldk/structs/RecipientOnionFields.cs @@ -130,7 +130,7 @@ public class RecipientOnionFields : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RecipientOnionFields b) { - bool ret = bindings.RecipientOnionFields_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RecipientOnionFields_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -207,7 +207,7 @@ public class RecipientOnionFields : CommonBase { * See [`Self::custom_tlvs`] for more info. */ public Result_RecipientOnionFieldsNoneZ with_custom_tlvs(TwoTuple_u64CVec_u8ZZ[] custom_tlvs) { - long ret = bindings.RecipientOnionFields_with_custom_tlvs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(custom_tlvs, custom_tlvs_conv_23 => custom_tlvs_conv_23 != null ? custom_tlvs_conv_23.ptr : 0))); + long ret = bindings.RecipientOnionFields_with_custom_tlvs(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(custom_tlvs, custom_tlvs_conv_23 => custom_tlvs_conv_23.ptr))); GC.KeepAlive(this); GC.KeepAlive(custom_tlvs); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/Record.cs b/c_sharp/src/org/ldk/structs/Record.cs index c1cff2fa..3720b7be 100644 --- a/c_sharp/src/org/ldk/structs/Record.cs +++ b/c_sharp/src/org/ldk/structs/Record.cs @@ -69,12 +69,14 @@ public class Record : CommonBase { /** * The channel id of the channel pertaining to the logged record. May be a temporary id before * the channel has been funded. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Option_ThirtyTwoBytesZ get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.Record_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_ThirtyTwoBytesZ ret_hu_conv = org.ldk.structs.Option_ThirtyTwoBytesZ.constr_from_ptr(ret); + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -82,9 +84,11 @@ public class Record : CommonBase { /** * The channel id of the channel pertaining to the logged record. May be a temporary id before * the channel has been funded. + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public void set_channel_id(org.ldk.structs.Option_ThirtyTwoBytesZ val) { - bindings.Record_set_channel_id(this.ptr, val.ptr); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.Record_set_channel_id(this.ptr, val == null ? 0 : val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -172,9 +176,10 @@ public class Record : CommonBase { * Constructs a new Record given each field * * Note that peer_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Record of(Level level_arg, byte[] peer_id_arg, org.ldk.structs.Option_ThirtyTwoBytesZ channel_id_arg, string args_arg, string module_path_arg, string file_arg, int line_arg) { - long ret = bindings.Record_new(level_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_id_arg, 33)), channel_id_arg.ptr, InternalUtils.encodeString(args_arg), InternalUtils.encodeString(module_path_arg), InternalUtils.encodeString(file_arg), line_arg); + public static Record of(Level level_arg, byte[] peer_id_arg, org.ldk.structs.ChannelId channel_id_arg, string args_arg, string module_path_arg, string file_arg, int line_arg) { + long ret = bindings.Record_new(level_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(peer_id_arg, 33)), channel_id_arg == null ? 0 : channel_id_arg.ptr, InternalUtils.encodeString(args_arg), InternalUtils.encodeString(module_path_arg), InternalUtils.encodeString(file_arg), line_arg); GC.KeepAlive(level_arg); GC.KeepAlive(peer_id_arg); GC.KeepAlive(channel_id_arg); diff --git a/c_sharp/src/org/ldk/structs/Refund.cs b/c_sharp/src/org/ldk/structs/Refund.cs index d83b0c34..218d31e5 100644 --- a/c_sharp/src/org/ldk/structs/Refund.cs +++ b/c_sharp/src/org/ldk/structs/Refund.cs @@ -209,6 +209,18 @@ public class Refund : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the Refund. + */ + public long hash() { + long ret = bindings.Refund_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Serialize the Refund object into a byte array which can be read by Refund_read */ diff --git a/c_sharp/src/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.cs b/c_sharp/src/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.cs new file mode 100644 index 00000000..1aae4506 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/RefundMaybeWithDerivedMetadataBuilder.cs @@ -0,0 +1,202 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * Builds a [`Refund`] for the \"offer for money\" flow. + * + * See [module-level documentation] for usage. + * + * [module-level documentation]: self + */ +public class RefundMaybeWithDerivedMetadataBuilder : CommonBase { + internal RefundMaybeWithDerivedMetadataBuilder(object _dummy, long ptr) : base(ptr) { } + ~RefundMaybeWithDerivedMetadataBuilder() { + if (ptr != 0) { bindings.RefundMaybeWithDerivedMetadataBuilder_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the RefundMaybeWithDerivedMetadataBuilder + */ + public RefundMaybeWithDerivedMetadataBuilder clone() { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.RefundMaybeWithDerivedMetadataBuilder ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RefundMaybeWithDerivedMetadataBuilder(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new builder for a refund using the [`Refund::payer_id`] for the public node id to + * send to if no [`Refund::paths`] are set. Otherwise, it may be a transient pubkey. + * + * Additionally, sets the required (empty) [`Refund::description`], [`Refund::payer_metadata`], + * and [`Refund::amount_msats`]. + * + * # Note + * + * If constructing a [`Refund`] for use with a [`ChannelManager`], use + * [`ChannelManager::create_refund_builder`] instead of [`RefundBuilder::new`]. + * + * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager + * [`ChannelManager::create_refund_builder`]: crate::ln::channelmanager::ChannelManager::create_refund_builder + */ + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ of(byte[] metadata, byte[] payer_id, long amount_msats) { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_new(InternalUtils.encodeUint8Array(metadata), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer_id, 33)), amount_msats); + GC.KeepAlive(metadata); + GC.KeepAlive(payer_id); + GC.KeepAlive(amount_msats); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Similar to [`RefundBuilder::new`] except, if [`RefundBuilder::path`] is called, the payer id + * is derived from the given [`ExpandedKey`] and nonce. This provides sender privacy by using a + * different payer id for each refund, assuming a different nonce is used. Otherwise, the + * provided `node_id` is used for the payer id. + * + * Also, sets the metadata when [`RefundBuilder::build`] is called such that it can be used to + * verify that an [`InvoiceRequest`] was produced for the refund given an [`ExpandedKey`]. + * + * The `payment_id` is encrypted in the metadata and should be unique. This ensures that only + * one invoice will be paid for the refund and that payments can be uniquely identified. + * + * [`InvoiceRequest`]: crate::offers::invoice_request::InvoiceRequest + * [`ExpandedKey`]: crate::ln::inbound_payment::ExpandedKey + */ + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ deriving_payer_id(byte[] node_id, org.ldk.structs.ExpandedKey expanded_key, org.ldk.structs.EntropySource entropy_source, long amount_msats, byte[] payment_id) { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_deriving_payer_id(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(node_id, 33)), expanded_key.ptr, entropy_source.ptr, amount_msats, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_id, 32))); + GC.KeepAlive(node_id); + GC.KeepAlive(expanded_key); + GC.KeepAlive(entropy_source); + GC.KeepAlive(amount_msats); + GC.KeepAlive(payment_id); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(expanded_key); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + return ret_hu_conv; + } + + /** + * Sets the [`Refund::description`]. + * + * Successive calls to this method will override the previous setting. + */ + public void description(string description) { + bindings.RefundMaybeWithDerivedMetadataBuilder_description(this.ptr, InternalUtils.encodeString(description)); + GC.KeepAlive(this); + GC.KeepAlive(description); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Refund::absolute_expiry`] as seconds since the Unix epoch. Any expiry that has + * already passed is valid and can be checked for using [`Refund::is_expired`]. + * + * Successive calls to this method will override the previous setting. + */ + public void absolute_expiry(long absolute_expiry) { + bindings.RefundMaybeWithDerivedMetadataBuilder_absolute_expiry(this.ptr, absolute_expiry); + GC.KeepAlive(this); + GC.KeepAlive(absolute_expiry); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Refund::issuer`]. + * + * Successive calls to this method will override the previous setting. + */ + public void issuer(string issuer) { + bindings.RefundMaybeWithDerivedMetadataBuilder_issuer(this.ptr, InternalUtils.encodeString(issuer)); + GC.KeepAlive(this); + GC.KeepAlive(issuer); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Adds a blinded path to [`Refund::paths`]. Must include at least one path if only connected + * by private channels or if [`Refund::payer_id`] is not a public node id. + * + * Successive calls to this method will add another blinded path. Caller is responsible for not + * adding duplicate paths. + */ + public void path(org.ldk.structs.BlindedPath path) { + bindings.RefundMaybeWithDerivedMetadataBuilder_path(this.ptr, path.ptr); + GC.KeepAlive(this); + GC.KeepAlive(path); + if (this != null) { this.ptrs_to.AddLast(path); }; + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Refund::chain`] of the given [`Network`] for paying an invoice. If not + * called, [`Network::Bitcoin`] is assumed. + * + * Successive calls to this method will override the previous setting. + */ + public void chain(Network network) { + bindings.RefundMaybeWithDerivedMetadataBuilder_chain(this.ptr, network); + GC.KeepAlive(this); + GC.KeepAlive(network); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets [`Refund::quantity`] of items. This is purely for informational purposes. It is useful + * when the refund pertains to a [`Bolt12Invoice`] that paid for more than one item from an + * [`Offer`] as specified by [`InvoiceRequest::quantity`]. + * + * Successive calls to this method will override the previous setting. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + * [`InvoiceRequest::quantity`]: crate::offers::invoice_request::InvoiceRequest::quantity + * [`Offer`]: crate::offers::offer::Offer + */ + public void quantity(long quantity) { + bindings.RefundMaybeWithDerivedMetadataBuilder_quantity(this.ptr, quantity); + GC.KeepAlive(this); + GC.KeepAlive(quantity); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Sets the [`Refund::payer_note`]. + * + * Successive calls to this method will override the previous setting. + */ + public void payer_note(string payer_note) { + bindings.RefundMaybeWithDerivedMetadataBuilder_payer_note(this.ptr, InternalUtils.encodeString(payer_note)); + GC.KeepAlive(this); + GC.KeepAlive(payer_note); + if (this != null) { this.ptrs_to.AddLast(this); }; + } + + /** + * Builds a [`Refund`] after checking for valid semantics. + */ + public Result_RefundBolt12SemanticErrorZ build() { + long ret = bindings.RefundMaybeWithDerivedMetadataBuilder_build(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12SemanticErrorZ ret_hu_conv = Result_RefundBolt12SemanticErrorZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs b/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs index b1f8f09e..3dafe2ef 100644 --- a/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs +++ b/c_sharp/src/org/ldk/structs/ReplyChannelRange.cs @@ -173,7 +173,7 @@ public class ReplyChannelRange : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ReplyChannelRange b) { - bool ret = bindings.ReplyChannelRange_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ReplyChannelRange_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs b/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs index 88dd390b..d2759630 100644 --- a/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs +++ b/c_sharp/src/org/ldk/structs/ReplyShortChannelIdsEnd.cs @@ -109,7 +109,7 @@ public class ReplyShortChannelIdsEnd : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ReplyShortChannelIdsEnd b) { - bool ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ReplyShortChannelIdsEnd_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs index bc5f7f1c..1009ab38 100644 --- a/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AcceptChannelDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_AcceptChannelDecodeErrorZ : CommonBase { * Creates a new CResult_AcceptChannelDecodeErrorZ in the success state. */ public static Result_AcceptChannelDecodeErrorZ ok(org.ldk.structs.AcceptChannel o) { - long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_AcceptChannelDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelDecodeErrorZ ret_hu_conv = Result_AcceptChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs index eed4788c..9adb37a2 100644 --- a/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AcceptChannelV2DecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_AcceptChannelV2DecodeErrorZ : CommonBase { * Creates a new CResult_AcceptChannelV2DecodeErrorZ in the success state. */ public static Result_AcceptChannelV2DecodeErrorZ ok(org.ldk.structs.AcceptChannelV2 o) { - long ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_AcceptChannelV2DecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AcceptChannelV2DecodeErrorZ ret_hu_conv = Result_AcceptChannelV2DecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs index 0f4f932f..ff6be21d 100644 --- a/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_AnnouncementSignaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_AnnouncementSignaturesDecodeErrorZ : CommonBase { * Creates a new CResult_AnnouncementSignaturesDecodeErrorZ in the success state. */ public static Result_AnnouncementSignaturesDecodeErrorZ ok(org.ldk.structs.AnnouncementSignatures o) { - long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_AnnouncementSignaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_AnnouncementSignaturesDecodeErrorZ ret_hu_conv = Result_AnnouncementSignaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs new file mode 100644 index 00000000..1a63cd01 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_BestBlockDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_BestBlockDecodeErrorZ : CommonBase { + Result_BestBlockDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_BestBlockDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_BestBlockDecodeErrorZ_free(ptr); } + } + + internal static Result_BestBlockDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_BestBlockDecodeErrorZ_is_ok(ptr)) { + return new Result_BestBlockDecodeErrorZ_OK(null, ptr); + } else { + return new Result_BestBlockDecodeErrorZ_Err(null, ptr); + } + } + public class Result_BestBlockDecodeErrorZ_OK : Result_BestBlockDecodeErrorZ { + public readonly BestBlock res; + internal Result_BestBlockDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_BestBlockDecodeErrorZ_get_ok(ptr); + org.ldk.structs.BestBlock res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.BestBlock(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_BestBlockDecodeErrorZ_Err : Result_BestBlockDecodeErrorZ { + public readonly DecodeError err; + internal Result_BestBlockDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_BestBlockDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_BestBlockDecodeErrorZ in the success state. + */ + public static Result_BestBlockDecodeErrorZ ok(org.ldk.structs.BestBlock o) { + long ret = bindings.CResult_BestBlockDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BestBlockDecodeErrorZ ret_hu_conv = Result_BestBlockDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_BestBlockDecodeErrorZ in the error state. + */ + public static Result_BestBlockDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_BestBlockDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BestBlockDecodeErrorZ ret_hu_conv = Result_BestBlockDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_BestBlockDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_BestBlockDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_BestBlockDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_BestBlockDecodeErrorZ clone() { + long ret = bindings.CResult_BestBlockDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_BestBlockDecodeErrorZ ret_hu_conv = Result_BestBlockDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs index 1955fdae..3381ec30 100644 --- a/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BigSizeDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BigSizeDecodeErrorZ : CommonBase { * Creates a new CResult_BigSizeDecodeErrorZ in the success state. */ public static Result_BigSizeDecodeErrorZ ok(org.ldk.structs.BigSize o) { - long ret = bindings.CResult_BigSizeDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BigSizeDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BigSizeDecodeErrorZ ret_hu_conv = Result_BigSizeDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs index b02ccefc..ea0e13bd 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedForwardDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BlindedForwardDecodeErrorZ : CommonBase { * Creates a new CResult_BlindedForwardDecodeErrorZ in the success state. */ public static Result_BlindedForwardDecodeErrorZ ok(org.ldk.structs.BlindedForward o) { - long ret = bindings.CResult_BlindedForwardDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedForwardDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedForwardDecodeErrorZ ret_hu_conv = Result_BlindedForwardDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs index ca6011dc..6affe112 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedHopDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BlindedHopDecodeErrorZ : CommonBase { * Creates a new CResult_BlindedHopDecodeErrorZ in the success state. */ public static Result_BlindedHopDecodeErrorZ ok(org.ldk.structs.BlindedHop o) { - long ret = bindings.CResult_BlindedHopDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedHopDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopDecodeErrorZ ret_hu_conv = Result_BlindedHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs index e64b1bd8..8cc73f14 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedHopFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BlindedHopFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_BlindedHopFeaturesDecodeErrorZ in the success state. */ public static Result_BlindedHopFeaturesDecodeErrorZ ok(org.ldk.structs.BlindedHopFeatures o) { - long ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedHopFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedHopFeaturesDecodeErrorZ ret_hu_conv = Result_BlindedHopFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs index 2c7e344d..7932b6b6 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPathDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BlindedPathDecodeErrorZ : CommonBase { * Creates a new CResult_BlindedPathDecodeErrorZ in the success state. */ public static Result_BlindedPathDecodeErrorZ ok(org.ldk.structs.BlindedPath o) { - long ret = bindings.CResult_BlindedPathDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedPathDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPathDecodeErrorZ ret_hu_conv = Result_BlindedPathDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs index cee1a2cf..fdc90701 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPathNoneZ.cs @@ -37,7 +37,7 @@ public class Result_BlindedPathNoneZ : CommonBase { * Creates a new CResult_BlindedPathNoneZ in the success state. */ public static Result_BlindedPathNoneZ ok(org.ldk.structs.BlindedPath o) { - long ret = bindings.CResult_BlindedPathNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedPathNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPathNoneZ ret_hu_conv = Result_BlindedPathNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs index c0f05658..6e4b58e3 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedPayInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BlindedPayInfoDecodeErrorZ : CommonBase { * Creates a new CResult_BlindedPayInfoDecodeErrorZ in the success state. */ public static Result_BlindedPayInfoDecodeErrorZ ok(org.ldk.structs.BlindedPayInfo o) { - long ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedPayInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedPayInfoDecodeErrorZ ret_hu_conv = Result_BlindedPayInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs index 9fbe083c..0bfc6ebb 100644 --- a/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BlindedTailDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BlindedTailDecodeErrorZ : CommonBase { * Creates a new CResult_BlindedTailDecodeErrorZ in the success state. */ public static Result_BlindedTailDecodeErrorZ ok(org.ldk.structs.BlindedTail o) { - long ret = bindings.CResult_BlindedTailDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BlindedTailDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BlindedTailDecodeErrorZ ret_hu_conv = Result_BlindedTailDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs index 8f5176ff..c2ce8a54 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceBolt11SemanticErrorZ.cs @@ -39,7 +39,7 @@ public class Result_Bolt11InvoiceBolt11SemanticErrorZ : CommonBase { * Creates a new CResult_Bolt11InvoiceBolt11SemanticErrorZ in the success state. */ public static Result_Bolt11InvoiceBolt11SemanticErrorZ ok(org.ldk.structs.Bolt11Invoice o) { - long ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_Bolt11InvoiceBolt11SemanticErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceBolt11SemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceBolt11SemanticErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs index 2a126e37..f7f65454 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_Bolt11InvoiceFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_Bolt11InvoiceFeaturesDecodeErrorZ in the success state. */ public static Result_Bolt11InvoiceFeaturesDecodeErrorZ ok(org.ldk.structs.Bolt11InvoiceFeatures o) { - long ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_Bolt11InvoiceFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt11InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs index b365f857..9e464393 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceParseOrSemanticErrorZ.cs @@ -42,7 +42,7 @@ public class Result_Bolt11InvoiceParseOrSemanticErrorZ : CommonBase { * Creates a new CResult_Bolt11InvoiceParseOrSemanticErrorZ in the success state. */ public static Result_Bolt11InvoiceParseOrSemanticErrorZ ok(org.ldk.structs.Bolt11Invoice o) { - long ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_Bolt11InvoiceParseOrSemanticErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceParseOrSemanticErrorZ ret_hu_conv = Result_Bolt11InvoiceParseOrSemanticErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs index 23615193..26d6a249 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt11InvoiceSignOrCreationErrorZ.cs @@ -42,7 +42,7 @@ public class Result_Bolt11InvoiceSignOrCreationErrorZ : CommonBase { * Creates a new CResult_Bolt11InvoiceSignOrCreationErrorZ in the success state. */ public static Result_Bolt11InvoiceSignOrCreationErrorZ ok(org.ldk.structs.Bolt11Invoice o) { - long ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_Bolt11InvoiceSignOrCreationErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt11InvoiceSignOrCreationErrorZ ret_hu_conv = Result_Bolt11InvoiceSignOrCreationErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..7dfe984d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt12InvoiceBolt12SemanticErrorZ : CommonBase { + Result_Bolt12InvoiceBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt12InvoiceBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_Bolt12InvoiceBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_Bolt12InvoiceBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_Bolt12InvoiceBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_Bolt12InvoiceBolt12SemanticErrorZ_OK : Result_Bolt12InvoiceBolt12SemanticErrorZ { + public readonly Bolt12Invoice res; + internal Result_Bolt12InvoiceBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.Bolt12Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt12Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt12InvoiceBolt12SemanticErrorZ_Err : Result_Bolt12InvoiceBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_Bolt12InvoiceBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the success state. + */ + public static Result_Bolt12InvoiceBolt12SemanticErrorZ ok(org.ldk.structs.Bolt12Invoice o) { + long ret = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_Bolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ in the error state. + */ + public static Result_Bolt12InvoiceBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_Bolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt12InvoiceBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_Bolt12InvoiceBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_Bolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs index a0fdddd8..1501b052 100644 --- a/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12InvoiceFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_Bolt12InvoiceFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_Bolt12InvoiceFeaturesDecodeErrorZ in the success state. */ public static Result_Bolt12InvoiceFeaturesDecodeErrorZ ok(org.ldk.structs.Bolt12InvoiceFeatures o) { - long ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_Bolt12InvoiceFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_Bolt12InvoiceFeaturesDecodeErrorZ ret_hu_conv = Result_Bolt12InvoiceFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs new file mode 100644 index 00000000..8d99376f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12OfferContextDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt12OfferContextDecodeErrorZ : CommonBase { + Result_Bolt12OfferContextDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt12OfferContextDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt12OfferContextDecodeErrorZ_free(ptr); } + } + + internal static Result_Bolt12OfferContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt12OfferContextDecodeErrorZ_is_ok(ptr)) { + return new Result_Bolt12OfferContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_Bolt12OfferContextDecodeErrorZ_Err(null, ptr); + } + } + public class Result_Bolt12OfferContextDecodeErrorZ_OK : Result_Bolt12OfferContextDecodeErrorZ { + public readonly Bolt12OfferContext res; + internal Result_Bolt12OfferContextDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt12OfferContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Bolt12OfferContext res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt12OfferContext(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt12OfferContextDecodeErrorZ_Err : Result_Bolt12OfferContextDecodeErrorZ { + public readonly DecodeError err; + internal Result_Bolt12OfferContextDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt12OfferContextDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the success state. + */ + public static Result_Bolt12OfferContextDecodeErrorZ ok(org.ldk.structs.Bolt12OfferContext o) { + long ret = bindings.CResult_Bolt12OfferContextDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12OfferContextDecodeErrorZ ret_hu_conv = Result_Bolt12OfferContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt12OfferContextDecodeErrorZ in the error state. + */ + public static Result_Bolt12OfferContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_Bolt12OfferContextDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12OfferContextDecodeErrorZ ret_hu_conv = Result_Bolt12OfferContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt12OfferContextDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt12OfferContextDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt12OfferContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt12OfferContextDecodeErrorZ clone() { + long ret = bindings.CResult_Bolt12OfferContextDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12OfferContextDecodeErrorZ ret_hu_conv = Result_Bolt12OfferContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs new file mode 100644 index 00000000..dc91b8d3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_Bolt12RefundContextDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_Bolt12RefundContextDecodeErrorZ : CommonBase { + Result_Bolt12RefundContextDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_Bolt12RefundContextDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_Bolt12RefundContextDecodeErrorZ_free(ptr); } + } + + internal static Result_Bolt12RefundContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_Bolt12RefundContextDecodeErrorZ_is_ok(ptr)) { + return new Result_Bolt12RefundContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_Bolt12RefundContextDecodeErrorZ_Err(null, ptr); + } + } + public class Result_Bolt12RefundContextDecodeErrorZ_OK : Result_Bolt12RefundContextDecodeErrorZ { + public readonly Bolt12RefundContext res; + internal Result_Bolt12RefundContextDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_Bolt12RefundContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.Bolt12RefundContext res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Bolt12RefundContext(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_Bolt12RefundContextDecodeErrorZ_Err : Result_Bolt12RefundContextDecodeErrorZ { + public readonly DecodeError err; + internal Result_Bolt12RefundContextDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_Bolt12RefundContextDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the success state. + */ + public static Result_Bolt12RefundContextDecodeErrorZ ok(org.ldk.structs.Bolt12RefundContext o) { + long ret = bindings.CResult_Bolt12RefundContextDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12RefundContextDecodeErrorZ ret_hu_conv = Result_Bolt12RefundContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_Bolt12RefundContextDecodeErrorZ in the error state. + */ + public static Result_Bolt12RefundContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_Bolt12RefundContextDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12RefundContextDecodeErrorZ ret_hu_conv = Result_Bolt12RefundContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_Bolt12RefundContextDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_Bolt12RefundContextDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_Bolt12RefundContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_Bolt12RefundContextDecodeErrorZ clone() { + long ret = bindings.CResult_Bolt12RefundContextDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_Bolt12RefundContextDecodeErrorZ ret_hu_conv = Result_Bolt12RefundContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs index e5682750..67ea9ab2 100644 --- a/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_BuiltCommitmentTransactionDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_BuiltCommitmentTransactionDecodeErrorZ : CommonBase { * Creates a new CResult_BuiltCommitmentTransactionDecodeErrorZ in the success state. */ public static Result_BuiltCommitmentTransactionDecodeErrorZ ok(org.ldk.structs.BuiltCommitmentTransaction o) { - long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_BuiltCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_BuiltCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs new file mode 100644 index 00000000..23d3f310 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.cs @@ -0,0 +1,74 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ : CommonBase { + Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_free(ptr); } + } + + internal static Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(ptr)) { + return new Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_OK(null, ptr); + } else { + return new Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_Err(null, ptr); + } + } + public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_OK : Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ { + public readonly TwoTuple_BestBlockOutputSweeperZ res; + internal Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_ok(ptr); + TwoTuple_BestBlockOutputSweeperZ res_hu_conv = new TwoTuple_BestBlockOutputSweeperZ(null, res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_Err : Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ { + public readonly DecodeError err; + internal Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the success state. + */ + public static Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ok(org.ldk.structs.TwoTuple_BestBlockOutputSweeperZ o) { + long ret = bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ in the error state. + */ + public static Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs index 05963425..35b8b5f1 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.cs @@ -37,7 +37,7 @@ public class Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ : CommonBase { * Creates a new CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ in the success state. */ public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ok(org.ldk.structs.TwoTuple_BlindedPayInfoBlindedPathZ o) { - long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_BlindedPayInfoBlindedPathZNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_CVec_u8Zu64ZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_CVec_u8Zu64ZNoneZ.cs index 10f80183..7417b51a 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_CVec_u8Zu64ZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_CVec_u8Zu64ZNoneZ.cs @@ -37,7 +37,7 @@ public class Result_C2Tuple_CVec_u8Zu64ZNoneZ : CommonBase { * Creates a new CResult_C2Tuple_CVec_u8Zu64ZNoneZ in the success state. */ public static Result_C2Tuple_CVec_u8Zu64ZNoneZ ok(org.ldk.structs.TwoTuple_CVec_u8Zu64Z o) { - long ret = bindings.CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_CVec_u8Zu64ZNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_CVec_u8Zu64ZNoneZ ret_hu_conv = Result_C2Tuple_CVec_u8Zu64ZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.cs index 495b5fb6..752f800f 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.cs @@ -37,7 +37,7 @@ public class Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ : CommonBas * Creates a new CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ in the success state. */ public static Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ok(org.ldk.structs.TwoTuple_ECDSASignatureCVec_ECDSASignatureZZ o) { - long ret = bindings.CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ ret_hu_conv = Result_C2Tuple_ECDSASignatureCVec_ECDSASignatureZZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.cs index 02c6859d..627f6344 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ : CommonBa * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ in the success state. */ public static Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesChannelManagerZ o) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.cs index 618c7ebb..3582541d 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ : CommonBa * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ in the success state. */ public static Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesChannelMonitorZ o) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelMonitorZDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.cs index ebf7da47..06f5d009 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.cs @@ -39,7 +39,7 @@ public class Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ : CommonBase { * Creates a new CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ in the success state. */ public static Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesChannelMonitorZ o) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesChannelMonitorZIOErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.cs index 4d16bf45..6a89035a 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.cs @@ -37,7 +37,7 @@ public class Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ : CommonBase { * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ in the success state. */ public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ o) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.cs index d929e30a..ce21d578 100644 --- a/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.cs @@ -42,7 +42,7 @@ public class Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ : C * Creates a new CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ in the success state. */ public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ok(org.ldk.structs.TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ o) { - long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ ret_hu_conv = Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZPaymentSendFailureZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.cs index 5cc240dc..b8ab9339 100644 --- a/c_sharp/src/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.cs @@ -42,7 +42,7 @@ public class Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSe * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ in the success state. */ public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ok(org.ldk.structs.ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ o) { - long ret = bindings.CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); @@ -70,5 +70,23 @@ public class Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSe return ret; } + internal long clone_ptr() { + long ret = bindings.CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ clone() { + long ret = bindings.CResult_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.cs index 9fdb1a2f..7be21311 100644 --- a/c_sharp/src/org/ldk/structs/Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.cs @@ -37,7 +37,7 @@ public class Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNo * Creates a new CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ in the success state. */ public static Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ ok(org.ldk.structs.ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ o) { - long ret = bindings.CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o != null ? o.ptr : 0); + long ret = bindings.CResult_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ ret_hu_conv = Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs index 9adab423..2e7e899e 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_BlindedPathZNoneZ.cs @@ -44,7 +44,7 @@ public class Result_CVec_BlindedPathZNoneZ : CommonBase { * Creates a new CResult_CVec_BlindedPathZNoneZ in the success state. */ public static Result_CVec_BlindedPathZNoneZ ok(BlindedPath[] o) { - long ret = bindings.CResult_CVec_BlindedPathZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_13 => o_conv_13 == null ? 0 : o_conv_13.ptr))); + long ret = bindings.CResult_CVec_BlindedPathZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_13 => o_conv_13.ptr))); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_BlindedPathZNoneZ ret_hu_conv = Result_CVec_BlindedPathZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.cs index 9c4c16ef..cc8501a7 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.cs @@ -44,7 +44,7 @@ public class Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ : CommonBase { * Creates a new CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ in the success state. */ public static Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ok(TwoTuple_BlindedPayInfoBlindedPathZ[] o) { - long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_37 => o_conv_37 != null ? o_conv_37.ptr : 0))); + long ret = bindings.CResult_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_37 => o_conv_37.ptr))); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret_hu_conv = Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.cs index c7f7aa21..0c05204a 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.cs @@ -46,7 +46,7 @@ public class Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ : Common * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ in the success state. */ public static Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ ok(TwoTuple_ThirtyTwoBytesChannelMonitorZ[] o) { - long ret = bindings.CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_40 => o_conv_40 != null ? o_conv_40.ptr : 0))); + long ret = bindings.CResult_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_40 => o_conv_40.ptr))); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesChannelMonitorZZIOErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.cs index 666af7e8..27308203 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.cs @@ -49,7 +49,7 @@ public class Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ * Creates a new CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ in the success state. */ public static Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ok(TwoTuple_ThirtyTwoBytesThirtyTwoBytesZ[] o) { - long ret = bindings.CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_40 => o_conv_40 != null ? o_conv_40.ptr : 0))); + long ret = bindings.CResult_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_40 => o_conv_40.ptr))); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ ret_hu_conv = Result_CVec_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZZProbeSendFailureZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs index 636895d8..c3d60e0a 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_UtxoZNoneZ.cs @@ -44,7 +44,7 @@ public class Result_CVec_UtxoZNoneZ : CommonBase { * Creates a new CResult_CVec_UtxoZNoneZ in the success state. */ public static Result_CVec_UtxoZNoneZ ok(Utxo[] o) { - long ret = bindings.CResult_CVec_UtxoZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_6 => o_conv_6 == null ? 0 : o_conv_6.ptr))); + long ret = bindings.CResult_CVec_UtxoZNoneZ_ok(InternalUtils.encodeUint64Array(InternalUtils.mapArray(o, o_conv_6 => o_conv_6.ptr))); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_UtxoZNoneZ ret_hu_conv = Result_CVec_UtxoZNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.cs index 26a9bc8f..c5b1cf3e 100644 --- a/c_sharp/src/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CVec_u8ZPeerHandleErrorZ.cs @@ -52,7 +52,7 @@ public class Result_CVec_u8ZPeerHandleErrorZ : CommonBase { * Creates a new CResult_CVec_u8ZPeerHandleErrorZ in the error state. */ public static Result_CVec_u8ZPeerHandleErrorZ err(org.ldk.structs.PeerHandleError e) { - long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_CVec_u8ZPeerHandleErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_CVec_u8ZPeerHandleErrorZ ret_hu_conv = Result_CVec_u8ZPeerHandleErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs index 56a10918..f8f2007a 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelAnnouncementDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelAnnouncementDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelAnnouncementDecodeErrorZ in the success state. */ public static Result_ChannelAnnouncementDecodeErrorZ ok(org.ldk.structs.ChannelAnnouncement o) { - long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelAnnouncementDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_ChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs index 7db5fcb0..146a8fa0 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelConfigDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelConfigDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelConfigDecodeErrorZ in the success state. */ public static Result_ChannelConfigDecodeErrorZ ok(org.ldk.structs.ChannelConfig o) { - long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelConfigDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelConfigDecodeErrorZ ret_hu_conv = Result_ChannelConfigDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs index c9ef9b72..7f0af086 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelCounterpartyDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelCounterpartyDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelCounterpartyDecodeErrorZ in the success state. */ public static Result_ChannelCounterpartyDecodeErrorZ ok(org.ldk.structs.ChannelCounterparty o) { - long ret = bindings.CResult_ChannelCounterpartyDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelCounterpartyDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelCounterpartyDecodeErrorZ ret_hu_conv = Result_ChannelCounterpartyDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs index 63e2dcda..58c0f193 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelDerivationParametersDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelDerivationParametersDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelDerivationParametersDecodeErrorZ in the success state. */ public static Result_ChannelDerivationParametersDecodeErrorZ ok(org.ldk.structs.ChannelDerivationParameters o) { - long ret = bindings.CResult_ChannelDerivationParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelDerivationParametersDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDerivationParametersDecodeErrorZ ret_hu_conv = Result_ChannelDerivationParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs index 0ef33832..715ed0c4 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelDetailsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelDetailsDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelDetailsDecodeErrorZ in the success state. */ public static Result_ChannelDetailsDecodeErrorZ ok(org.ldk.structs.ChannelDetails o) { - long ret = bindings.CResult_ChannelDetailsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelDetailsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelDetailsDecodeErrorZ ret_hu_conv = Result_ChannelDetailsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs index 38d56078..07b2d0d2 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelFeaturesDecodeErrorZ in the success state. */ public static Result_ChannelFeaturesDecodeErrorZ ok(org.ldk.structs.ChannelFeatures o) { - long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs new file mode 100644 index 00000000..dc4db8de --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ChannelIdAPIErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_ChannelIdAPIErrorZ : CommonBase { + Result_ChannelIdAPIErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ChannelIdAPIErrorZ() { + if (ptr != 0) { bindings.CResult_ChannelIdAPIErrorZ_free(ptr); } + } + + internal static Result_ChannelIdAPIErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ChannelIdAPIErrorZ_is_ok(ptr)) { + return new Result_ChannelIdAPIErrorZ_OK(null, ptr); + } else { + return new Result_ChannelIdAPIErrorZ_Err(null, ptr); + } + } + public class Result_ChannelIdAPIErrorZ_OK : Result_ChannelIdAPIErrorZ { + public readonly ChannelId res; + internal Result_ChannelIdAPIErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_ChannelIdAPIErrorZ_get_ok(ptr); + org.ldk.structs.ChannelId res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelId(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_ChannelIdAPIErrorZ_Err : Result_ChannelIdAPIErrorZ { + public readonly APIError err; + internal Result_ChannelIdAPIErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_ChannelIdAPIErrorZ_get_err(ptr); + org.ldk.structs.APIError err_hu_conv = org.ldk.structs.APIError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ChannelIdAPIErrorZ in the success state. + */ + public static Result_ChannelIdAPIErrorZ ok(org.ldk.structs.ChannelId o) { + long ret = bindings.CResult_ChannelIdAPIErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelIdAPIErrorZ in the error state. + */ + public static Result_ChannelIdAPIErrorZ err(org.ldk.structs.APIError e) { + long ret = bindings.CResult_ChannelIdAPIErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_ChannelIdAPIErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ChannelIdAPIErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ChannelIdAPIErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelIdAPIErrorZ clone() { + long ret = bindings.CResult_ChannelIdAPIErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdAPIErrorZ ret_hu_conv = Result_ChannelIdAPIErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs new file mode 100644 index 00000000..4ec32de9 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_ChannelIdDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_ChannelIdDecodeErrorZ : CommonBase { + Result_ChannelIdDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_ChannelIdDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_ChannelIdDecodeErrorZ_free(ptr); } + } + + internal static Result_ChannelIdDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_ChannelIdDecodeErrorZ_is_ok(ptr)) { + return new Result_ChannelIdDecodeErrorZ_OK(null, ptr); + } else { + return new Result_ChannelIdDecodeErrorZ_Err(null, ptr); + } + } + public class Result_ChannelIdDecodeErrorZ_OK : Result_ChannelIdDecodeErrorZ { + public readonly ChannelId res; + internal Result_ChannelIdDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_ChannelIdDecodeErrorZ_get_ok(ptr); + org.ldk.structs.ChannelId res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.ChannelId(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_ChannelIdDecodeErrorZ_Err : Result_ChannelIdDecodeErrorZ { + public readonly DecodeError err; + internal Result_ChannelIdDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_ChannelIdDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_ChannelIdDecodeErrorZ in the success state. + */ + public static Result_ChannelIdDecodeErrorZ ok(org.ldk.structs.ChannelId o) { + long ret = bindings.CResult_ChannelIdDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdDecodeErrorZ ret_hu_conv = Result_ChannelIdDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_ChannelIdDecodeErrorZ in the error state. + */ + public static Result_ChannelIdDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_ChannelIdDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdDecodeErrorZ ret_hu_conv = Result_ChannelIdDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_ChannelIdDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_ChannelIdDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_ChannelIdDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_ChannelIdDecodeErrorZ clone() { + long ret = bindings.CResult_ChannelIdDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_ChannelIdDecodeErrorZ ret_hu_conv = Result_ChannelIdDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs index ae5a6f5a..d25c231a 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelInfoDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelInfoDecodeErrorZ in the success state. */ public static Result_ChannelInfoDecodeErrorZ ok(org.ldk.structs.ChannelInfo o) { - long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelInfoDecodeErrorZ ret_hu_conv = Result_ChannelInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs index 5aa6567e..80316e3f 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelMonitorUpdateDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelMonitorUpdateDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelMonitorUpdateDecodeErrorZ in the success state. */ public static Result_ChannelMonitorUpdateDecodeErrorZ ok(org.ldk.structs.ChannelMonitorUpdate o) { - long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelMonitorUpdateDecodeErrorZ ret_hu_conv = Result_ChannelMonitorUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs index fca2aeaa..0208a7a8 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelPublicKeysDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelPublicKeysDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelPublicKeysDecodeErrorZ in the success state. */ public static Result_ChannelPublicKeysDecodeErrorZ ok(org.ldk.structs.ChannelPublicKeys o) { - long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelPublicKeysDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelPublicKeysDecodeErrorZ ret_hu_conv = Result_ChannelPublicKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs index 7161b609..0bbd1bc9 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelReadyDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelReadyDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelReadyDecodeErrorZ in the success state. */ public static Result_ChannelReadyDecodeErrorZ ok(org.ldk.structs.ChannelReady o) { - long ret = bindings.CResult_ChannelReadyDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelReadyDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReadyDecodeErrorZ ret_hu_conv = Result_ChannelReadyDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs index 8483f19a..0632b14e 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelReestablishDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelReestablishDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelReestablishDecodeErrorZ in the success state. */ public static Result_ChannelReestablishDecodeErrorZ ok(org.ldk.structs.ChannelReestablish o) { - long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelReestablishDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelReestablishDecodeErrorZ ret_hu_conv = Result_ChannelReestablishDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs index 742f0805..d0d82ee8 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelTransactionParametersDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelTransactionParametersDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelTransactionParametersDecodeErrorZ in the success state. */ public static Result_ChannelTransactionParametersDecodeErrorZ ok(org.ldk.structs.ChannelTransactionParameters o) { - long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelTransactionParametersDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_ChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs index ee3b53fa..d68db307 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelTypeFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelTypeFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelTypeFeaturesDecodeErrorZ in the success state. */ public static Result_ChannelTypeFeaturesDecodeErrorZ ok(org.ldk.structs.ChannelTypeFeatures o) { - long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelTypeFeaturesDecodeErrorZ ret_hu_conv = Result_ChannelTypeFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs index 61c6400c..906676d1 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelUpdateDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelUpdateDecodeErrorZ in the success state. */ public static Result_ChannelUpdateDecodeErrorZ ok(org.ldk.structs.ChannelUpdate o) { - long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelUpdateDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateDecodeErrorZ ret_hu_conv = Result_ChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs index e7af0a52..9407eb56 100644 --- a/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ChannelUpdateInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ChannelUpdateInfoDecodeErrorZ : CommonBase { * Creates a new CResult_ChannelUpdateInfoDecodeErrorZ in the success state. */ public static Result_ChannelUpdateInfoDecodeErrorZ ok(org.ldk.structs.ChannelUpdateInfo o) { - long ret = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ChannelUpdateInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ChannelUpdateInfoDecodeErrorZ ret_hu_conv = Result_ChannelUpdateInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs index 4e3cf9af..79f8ff04 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClaimedHTLCDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ClaimedHTLCDecodeErrorZ : CommonBase { * Creates a new CResult_ClaimedHTLCDecodeErrorZ in the success state. */ public static Result_ClaimedHTLCDecodeErrorZ ok(org.ldk.structs.ClaimedHTLC o) { - long ret = bindings.CResult_ClaimedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ClaimedHTLCDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClaimedHTLCDecodeErrorZ ret_hu_conv = Result_ClaimedHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs index 79c19a57..dc96f366 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClosingSignedDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ClosingSignedDecodeErrorZ : CommonBase { * Creates a new CResult_ClosingSignedDecodeErrorZ in the success state. */ public static Result_ClosingSignedDecodeErrorZ ok(org.ldk.structs.ClosingSigned o) { - long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ClosingSignedDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedDecodeErrorZ ret_hu_conv = Result_ClosingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs index 5c7d6b5f..fd43cd58 100644 --- a/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ClosingSignedFeeRangeDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ClosingSignedFeeRangeDecodeErrorZ : CommonBase { * Creates a new CResult_ClosingSignedFeeRangeDecodeErrorZ in the success state. */ public static Result_ClosingSignedFeeRangeDecodeErrorZ ok(org.ldk.structs.ClosingSignedFeeRange o) { - long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ClosingSignedFeeRangeDecodeErrorZ ret_hu_conv = Result_ClosingSignedFeeRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs index 63b813a1..7564078b 100644 --- a/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CoinSelectionNoneZ.cs @@ -37,7 +37,7 @@ public class Result_CoinSelectionNoneZ : CommonBase { * Creates a new CResult_CoinSelectionNoneZ in the success state. */ public static Result_CoinSelectionNoneZ ok(org.ldk.structs.CoinSelection o) { - long ret = bindings.CResult_CoinSelectionNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_CoinSelectionNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CoinSelectionNoneZ ret_hu_conv = Result_CoinSelectionNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs index 2f8920ae..e281fd18 100644 --- a/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentSignedDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_CommitmentSignedDecodeErrorZ : CommonBase { * Creates a new CResult_CommitmentSignedDecodeErrorZ in the success state. */ public static Result_CommitmentSignedDecodeErrorZ ok(org.ldk.structs.CommitmentSigned o) { - long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_CommitmentSignedDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentSignedDecodeErrorZ ret_hu_conv = Result_CommitmentSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs index fa414c48..d3dae238 100644 --- a/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CommitmentTransactionDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_CommitmentTransactionDecodeErrorZ : CommonBase { * Creates a new CResult_CommitmentTransactionDecodeErrorZ in the success state. */ public static Result_CommitmentTransactionDecodeErrorZ ok(org.ldk.structs.CommitmentTransaction o) { - long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_CommitmentTransactionDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CommitmentTransactionDecodeErrorZ ret_hu_conv = Result_CommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs index 9116a4d4..72f78bbe 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyChannelTransactionParametersDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_CounterpartyChannelTransactionParametersDecodeErrorZ : Commo * Creates a new CResult_CounterpartyChannelTransactionParametersDecodeErrorZ in the success state. */ public static Result_CounterpartyChannelTransactionParametersDecodeErrorZ ok(org.ldk.structs.CounterpartyChannelTransactionParameters o) { - long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyChannelTransactionParametersDecodeErrorZ ret_hu_conv = Result_CounterpartyChannelTransactionParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs index 117c31ee..7b1edace 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyCommitmentSecretsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_CounterpartyCommitmentSecretsDecodeErrorZ : CommonBase { * Creates a new CResult_CounterpartyCommitmentSecretsDecodeErrorZ in the success state. */ public static Result_CounterpartyCommitmentSecretsDecodeErrorZ ok(org.ldk.structs.CounterpartyCommitmentSecrets o) { - long ret = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyCommitmentSecretsDecodeErrorZ ret_hu_conv = Result_CounterpartyCommitmentSecretsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs index b3c3b723..a21839e7 100644 --- a/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_CounterpartyForwardingInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_CounterpartyForwardingInfoDecodeErrorZ : CommonBase { * Creates a new CResult_CounterpartyForwardingInfoDecodeErrorZ in the success state. */ public static Result_CounterpartyForwardingInfoDecodeErrorZ ok(org.ldk.structs.CounterpartyForwardingInfo o) { - long ret = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_CounterpartyForwardingInfoDecodeErrorZ ret_hu_conv = Result_CounterpartyForwardingInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs index 1ff0bea0..47049152 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentBasepointDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_DelayedPaymentBasepointDecodeErrorZ : CommonBase { * Creates a new CResult_DelayedPaymentBasepointDecodeErrorZ in the success state. */ public static Result_DelayedPaymentBasepointDecodeErrorZ ok(org.ldk.structs.DelayedPaymentBasepoint o) { - long ret = bindings.CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_DelayedPaymentBasepointDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentBasepointDecodeErrorZ ret_hu_conv = Result_DelayedPaymentBasepointDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs index 4fbf372b..2e5355a7 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentKeyDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_DelayedPaymentKeyDecodeErrorZ : CommonBase { * Creates a new CResult_DelayedPaymentKeyDecodeErrorZ in the success state. */ public static Result_DelayedPaymentKeyDecodeErrorZ ok(org.ldk.structs.DelayedPaymentKey o) { - long ret = bindings.CResult_DelayedPaymentKeyDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_DelayedPaymentKeyDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentKeyDecodeErrorZ ret_hu_conv = Result_DelayedPaymentKeyDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs index 005af440..36570ac4 100644 --- a/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DelayedPaymentOutputDescriptorDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_DelayedPaymentOutputDescriptorDecodeErrorZ : CommonBase { * Creates a new CResult_DelayedPaymentOutputDescriptorDecodeErrorZ in the success state. */ public static Result_DelayedPaymentOutputDescriptorDecodeErrorZ ok(org.ldk.structs.DelayedPaymentOutputDescriptor o) { - long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DelayedPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_DelayedPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs index e3604b57..d3496ff8 100644 --- a/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_DescriptionCreationErrorZ.cs @@ -39,7 +39,7 @@ public class Result_DescriptionCreationErrorZ : CommonBase { * Creates a new CResult_DescriptionCreationErrorZ in the success state. */ public static Result_DescriptionCreationErrorZ ok(org.ldk.structs.Description o) { - long ret = bindings.CResult_DescriptionCreationErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_DescriptionCreationErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_DescriptionCreationErrorZ ret_hu_conv = Result_DescriptionCreationErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs index 51bbe928..aedf8291 100644 --- a/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ErrorMessageDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ErrorMessageDecodeErrorZ : CommonBase { * Creates a new CResult_ErrorMessageDecodeErrorZ in the success state. */ public static Result_ErrorMessageDecodeErrorZ ok(org.ldk.structs.ErrorMessage o) { - long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ErrorMessageDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ErrorMessageDecodeErrorZ ret_hu_conv = Result_ErrorMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs index 1a89d679..8bce2530 100644 --- a/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FinalOnionHopDataDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_FinalOnionHopDataDecodeErrorZ : CommonBase { * Creates a new CResult_FinalOnionHopDataDecodeErrorZ in the success state. */ public static Result_FinalOnionHopDataDecodeErrorZ ok(org.ldk.structs.FinalOnionHopData o) { - long ret = bindings.CResult_FinalOnionHopDataDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_FinalOnionHopDataDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FinalOnionHopDataDecodeErrorZ ret_hu_conv = Result_FinalOnionHopDataDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs index 6cd6b40f..84c522a8 100644 --- a/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FixedPenaltyScorerDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_FixedPenaltyScorerDecodeErrorZ : CommonBase { * Creates a new CResult_FixedPenaltyScorerDecodeErrorZ in the success state. */ public static Result_FixedPenaltyScorerDecodeErrorZ ok(org.ldk.structs.FixedPenaltyScorer o) { - long ret = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_FixedPenaltyScorerDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FixedPenaltyScorerDecodeErrorZ ret_hu_conv = Result_FixedPenaltyScorerDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs index 787006aa..20411eeb 100644 --- a/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FundingCreatedDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_FundingCreatedDecodeErrorZ : CommonBase { * Creates a new CResult_FundingCreatedDecodeErrorZ in the success state. */ public static Result_FundingCreatedDecodeErrorZ ok(org.ldk.structs.FundingCreated o) { - long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_FundingCreatedDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingCreatedDecodeErrorZ ret_hu_conv = Result_FundingCreatedDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs index 55ceac75..e32fac25 100644 --- a/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_FundingSignedDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_FundingSignedDecodeErrorZ : CommonBase { * Creates a new CResult_FundingSignedDecodeErrorZ in the success state. */ public static Result_FundingSignedDecodeErrorZ ok(org.ldk.structs.FundingSigned o) { - long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_FundingSignedDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_FundingSignedDecodeErrorZ ret_hu_conv = Result_FundingSignedDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs index 9682ff58..4a580887 100644 --- a/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_GossipTimestampFilterDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_GossipTimestampFilterDecodeErrorZ : CommonBase { * Creates a new CResult_GossipTimestampFilterDecodeErrorZ in the success state. */ public static Result_GossipTimestampFilterDecodeErrorZ ok(org.ldk.structs.GossipTimestampFilter o) { - long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_GossipTimestampFilterDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_GossipTimestampFilterDecodeErrorZ ret_hu_conv = Result_GossipTimestampFilterDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs index c946833d..34f1b855 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCDescriptorDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HTLCDescriptorDecodeErrorZ : CommonBase { * Creates a new CResult_HTLCDescriptorDecodeErrorZ in the success state. */ public static Result_HTLCDescriptorDecodeErrorZ ok(org.ldk.structs.HTLCDescriptor o) { - long ret = bindings.CResult_HTLCDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HTLCDescriptorDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCDescriptorDecodeErrorZ ret_hu_conv = Result_HTLCDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs index 369191e0..501a8fba 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCOutputInCommitmentDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HTLCOutputInCommitmentDecodeErrorZ : CommonBase { * Creates a new CResult_HTLCOutputInCommitmentDecodeErrorZ in the success state. */ public static Result_HTLCOutputInCommitmentDecodeErrorZ ok(org.ldk.structs.HTLCOutputInCommitment o) { - long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCOutputInCommitmentDecodeErrorZ ret_hu_conv = Result_HTLCOutputInCommitmentDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs index 94fac24e..3ef6aa6a 100644 --- a/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HTLCUpdateDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HTLCUpdateDecodeErrorZ : CommonBase { * Creates a new CResult_HTLCUpdateDecodeErrorZ in the success state. */ public static Result_HTLCUpdateDecodeErrorZ ok(org.ldk.structs.HTLCUpdate o) { - long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HTLCUpdateDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HTLCUpdateDecodeErrorZ ret_hu_conv = Result_HTLCUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs index 13cbf083..e37b5e44 100644 --- a/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HolderCommitmentTransactionDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HolderCommitmentTransactionDecodeErrorZ : CommonBase { * Creates a new CResult_HolderCommitmentTransactionDecodeErrorZ in the success state. */ public static Result_HolderCommitmentTransactionDecodeErrorZ ok(org.ldk.structs.HolderCommitmentTransaction o) { - long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HolderCommitmentTransactionDecodeErrorZ ret_hu_conv = Result_HolderCommitmentTransactionDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs index 2fd97360..c7e34cfc 100644 --- a/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HostnameDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HostnameDecodeErrorZ : CommonBase { * Creates a new CResult_HostnameDecodeErrorZ in the success state. */ public static Result_HostnameDecodeErrorZ ok(org.ldk.structs.Hostname o) { - long ret = bindings.CResult_HostnameDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HostnameDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HostnameDecodeErrorZ ret_hu_conv = Result_HostnameDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs index eb9a6fdd..7e4886d6 100644 --- a/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HtlcBasepointDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HtlcBasepointDecodeErrorZ : CommonBase { * Creates a new CResult_HtlcBasepointDecodeErrorZ in the success state. */ public static Result_HtlcBasepointDecodeErrorZ ok(org.ldk.structs.HtlcBasepoint o) { - long ret = bindings.CResult_HtlcBasepointDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HtlcBasepointDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcBasepointDecodeErrorZ ret_hu_conv = Result_HtlcBasepointDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs index 6a44b286..7037bc7f 100644 --- a/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_HtlcKeyDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_HtlcKeyDecodeErrorZ : CommonBase { * Creates a new CResult_HtlcKeyDecodeErrorZ in the success state. */ public static Result_HtlcKeyDecodeErrorZ ok(org.ldk.structs.HtlcKey o) { - long ret = bindings.CResult_HtlcKeyDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_HtlcKeyDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_HtlcKeyDecodeErrorZ ret_hu_conv = Result_HtlcKeyDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs index 76e0dc10..09681eab 100644 --- a/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InFlightHtlcsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_InFlightHtlcsDecodeErrorZ : CommonBase { * Creates a new CResult_InFlightHtlcsDecodeErrorZ in the success state. */ public static Result_InFlightHtlcsDecodeErrorZ ok(org.ldk.structs.InFlightHtlcs o) { - long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_InFlightHtlcsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InFlightHtlcsDecodeErrorZ ret_hu_conv = Result_InFlightHtlcsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs index ce2ae5f0..0fdca818 100644 --- a/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InMemorySignerDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_InMemorySignerDecodeErrorZ : CommonBase { * Creates a new CResult_InMemorySignerDecodeErrorZ in the success state. */ public static Result_InMemorySignerDecodeErrorZ ok(org.ldk.structs.InMemorySigner o) { - long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_InMemorySignerDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InMemorySignerDecodeErrorZ ret_hu_conv = Result_InMemorySignerDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs index d35f26d2..f0e3abc5 100644 --- a/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InitDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_InitDecodeErrorZ : CommonBase { * Creates a new CResult_InitDecodeErrorZ in the success state. */ public static Result_InitDecodeErrorZ ok(org.ldk.structs.Init o) { - long ret = bindings.CResult_InitDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_InitDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InitDecodeErrorZ ret_hu_conv = Result_InitDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs index ae3e3eeb..18bd0b75 100644 --- a/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InitFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_InitFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_InitFeaturesDecodeErrorZ in the success state. */ public static Result_InitFeaturesDecodeErrorZ ok(org.ldk.structs.InitFeatures o) { - long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_InitFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InitFeaturesDecodeErrorZ ret_hu_conv = Result_InitFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs index 8b967f0e..96667d99 100644 --- a/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceErrorDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_InvoiceErrorDecodeErrorZ : CommonBase { * Creates a new CResult_InvoiceErrorDecodeErrorZ in the success state. */ public static Result_InvoiceErrorDecodeErrorZ ok(org.ldk.structs.InvoiceError o) { - long ret = bindings.CResult_InvoiceErrorDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_InvoiceErrorDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_InvoiceErrorDecodeErrorZ ret_hu_conv = Result_InvoiceErrorDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..f24d56d7 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceRequestBolt12SemanticErrorZ : CommonBase { + Result_InvoiceRequestBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceRequestBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_InvoiceRequestBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceRequestBolt12SemanticErrorZ_OK : Result_InvoiceRequestBolt12SemanticErrorZ { + public readonly InvoiceRequest res; + internal Result_InvoiceRequestBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequest res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequest(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceRequestBolt12SemanticErrorZ_Err : Result_InvoiceRequestBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_InvoiceRequestBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the success state. + */ + public static Result_InvoiceRequestBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequest o) { + long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ in the error state. + */ + public static Result_InvoiceRequestBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_InvoiceRequestBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InvoiceRequestBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_InvoiceRequestBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs new file mode 100644 index 00000000..cf99b087 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestFieldsDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceRequestFieldsDecodeErrorZ : CommonBase { + Result_InvoiceRequestFieldsDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceRequestFieldsDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_free(ptr); } + } + + internal static Result_InvoiceRequestFieldsDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestFieldsDecodeErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestFieldsDecodeErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceRequestFieldsDecodeErrorZ_OK : Result_InvoiceRequestFieldsDecodeErrorZ { + public readonly InvoiceRequestFields res; + internal Result_InvoiceRequestFieldsDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequestFields res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestFields(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceRequestFieldsDecodeErrorZ_Err : Result_InvoiceRequestFieldsDecodeErrorZ { + public readonly DecodeError err; + internal Result_InvoiceRequestFieldsDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the success state. + */ + public static Result_InvoiceRequestFieldsDecodeErrorZ ok(org.ldk.structs.InvoiceRequestFields o) { + long ret = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFieldsDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFieldsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ in the error state. + */ + public static Result_InvoiceRequestFieldsDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFieldsDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFieldsDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_InvoiceRequestFieldsDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_InvoiceRequestFieldsDecodeErrorZ clone() { + long ret = bindings.CResult_InvoiceRequestFieldsDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestFieldsDecodeErrorZ ret_hu_conv = Result_InvoiceRequestFieldsDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..e121eef5 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.cs @@ -0,0 +1,79 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ : CommonBase { + Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_OK : Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ { + public readonly InvoiceRequestWithDerivedPayerIdBuilder res; + internal Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequestWithDerivedPayerIdBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestWithDerivedPayerIdBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_Err : Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequestWithDerivedPayerIdBuilder o) { + long ret = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceRequestWithDerivedPayerIdBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..92cccd1e --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.cs @@ -0,0 +1,79 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ : CommonBase { + Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_OK : Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ { + public readonly InvoiceRequestWithExplicitPayerIdBuilder res; + internal Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceRequestWithExplicitPayerIdBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceRequestWithExplicitPayerIdBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_Err : Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceRequestWithExplicitPayerIdBuilder o) { + long ret = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceRequestWithExplicitPayerIdBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..e3adfbb7 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.cs @@ -0,0 +1,79 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ : CommonBase { + Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_OK : Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ { + public readonly InvoiceWithDerivedSigningPubkeyBuilder res; + internal Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceWithDerivedSigningPubkeyBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceWithDerivedSigningPubkeyBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_Err : Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceWithDerivedSigningPubkeyBuilder o) { + long ret = bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..74488f5b --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.cs @@ -0,0 +1,79 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ : CommonBase { + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_OK : Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ { + public readonly InvoiceWithExplicitSigningPubkeyBuilder res; + internal Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.InvoiceWithExplicitSigningPubkeyBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.InvoiceWithExplicitSigningPubkeyBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_Err : Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ok(org.ldk.structs.InvoiceWithExplicitSigningPubkeyBuilder o) { + long ret = bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, o is reset to null and is now a dummy object. + o.ptr = 0;; + return ret_hu_conv; + } + + /** + * Creates a new CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_LockedChannelMonitorNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_LockedChannelMonitorNoneZ.cs index 915c346c..d892faad 100644 --- a/c_sharp/src/org/ldk/structs/Result_LockedChannelMonitorNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_LockedChannelMonitorNoneZ.cs @@ -37,7 +37,7 @@ public class Result_LockedChannelMonitorNoneZ : CommonBase { * Creates a new CResult_LockedChannelMonitorNoneZ in the success state. */ public static Result_LockedChannelMonitorNoneZ ok(org.ldk.structs.LockedChannelMonitor o) { - long ret = bindings.CResult_LockedChannelMonitorNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_LockedChannelMonitorNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_LockedChannelMonitorNoneZ ret_hu_conv = Result_LockedChannelMonitorNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs index 93edb417..c6358766 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAliasDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_NodeAliasDecodeErrorZ : CommonBase { * Creates a new CResult_NodeAliasDecodeErrorZ in the success state. */ public static Result_NodeAliasDecodeErrorZ ok(org.ldk.structs.NodeAlias o) { - long ret = bindings.CResult_NodeAliasDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_NodeAliasDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAliasDecodeErrorZ ret_hu_conv = Result_NodeAliasDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs index 665e8e36..c17dff49 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_NodeAnnouncementDecodeErrorZ : CommonBase { * Creates a new CResult_NodeAnnouncementDecodeErrorZ in the success state. */ public static Result_NodeAnnouncementDecodeErrorZ ok(org.ldk.structs.NodeAnnouncement o) { - long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_NodeAnnouncementDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs index cb2c2245..d9214823 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeAnnouncementInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_NodeAnnouncementInfoDecodeErrorZ : CommonBase { * Creates a new CResult_NodeAnnouncementInfoDecodeErrorZ in the success state. */ public static Result_NodeAnnouncementInfoDecodeErrorZ ok(org.ldk.structs.NodeAnnouncementInfo o) { - long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeAnnouncementInfoDecodeErrorZ ret_hu_conv = Result_NodeAnnouncementInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs index 8d756c32..f7eba84f 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeFeaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_NodeFeaturesDecodeErrorZ : CommonBase { * Creates a new CResult_NodeFeaturesDecodeErrorZ in the success state. */ public static Result_NodeFeaturesDecodeErrorZ ok(org.ldk.structs.NodeFeatures o) { - long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_NodeFeaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeFeaturesDecodeErrorZ ret_hu_conv = Result_NodeFeaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs index e4a5a918..0d1f6e9c 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeIdDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_NodeIdDecodeErrorZ : CommonBase { * Creates a new CResult_NodeIdDecodeErrorZ in the success state. */ public static Result_NodeIdDecodeErrorZ ok(org.ldk.structs.NodeId o) { - long ret = bindings.CResult_NodeIdDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_NodeIdDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeIdDecodeErrorZ ret_hu_conv = Result_NodeIdDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs index 61cfdcc3..7474a7da 100644 --- a/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NodeInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_NodeInfoDecodeErrorZ : CommonBase { * Creates a new CResult_NodeInfoDecodeErrorZ in the success state. */ public static Result_NodeInfoDecodeErrorZ ok(org.ldk.structs.NodeInfo o) { - long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_NodeInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_NodeInfoDecodeErrorZ ret_hu_conv = Result_NodeInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs index 68b47434..a69057fb 100644 --- a/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NoneLightningErrorZ.cs @@ -47,7 +47,7 @@ public class Result_NoneLightningErrorZ : CommonBase { * Creates a new CResult_NoneLightningErrorZ in the error state. */ public static Result_NoneLightningErrorZ err(org.ldk.structs.LightningError e) { - long ret = bindings.CResult_NoneLightningErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_NoneLightningErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs index c1efa8e8..41960438 100644 --- a/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_NonePeerHandleErrorZ.cs @@ -47,7 +47,7 @@ public class Result_NonePeerHandleErrorZ : CommonBase { * Creates a new CResult_NonePeerHandleErrorZ in the error state. */ public static Result_NonePeerHandleErrorZ err(org.ldk.structs.PeerHandleError e) { - long ret = bindings.CResult_NonePeerHandleErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_NonePeerHandleErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_NonePeerHandleErrorZ ret_hu_conv = Result_NonePeerHandleErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs index 778fb0c2..9a90137a 100644 --- a/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OfferBolt12ParseErrorZ.cs @@ -42,7 +42,7 @@ public class Result_OfferBolt12ParseErrorZ : CommonBase { * Creates a new CResult_OfferBolt12ParseErrorZ in the success state. */ public static Result_OfferBolt12ParseErrorZ ok(org.ldk.structs.Offer o) { - long ret = bindings.CResult_OfferBolt12ParseErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OfferBolt12ParseErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); @@ -54,7 +54,7 @@ public class Result_OfferBolt12ParseErrorZ : CommonBase { * Creates a new CResult_OfferBolt12ParseErrorZ in the error state. */ public static Result_OfferBolt12ParseErrorZ err(org.ldk.structs.Bolt12ParseError e) { - long ret = bindings.CResult_OfferBolt12ParseErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_OfferBolt12ParseErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_OfferBolt12ParseErrorZ ret_hu_conv = Result_OfferBolt12ParseErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..a0cd0655 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OfferBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OfferBolt12SemanticErrorZ : CommonBase { + Result_OfferBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OfferBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_OfferBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_OfferBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_OfferBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_OfferBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_OfferBolt12SemanticErrorZ_OK : Result_OfferBolt12SemanticErrorZ { + public readonly Offer res; + internal Result_OfferBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OfferBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.Offer res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Offer(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OfferBolt12SemanticErrorZ_Err : Result_OfferBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_OfferBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_OfferBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_OfferBolt12SemanticErrorZ in the success state. + */ + public static Result_OfferBolt12SemanticErrorZ ok(org.ldk.structs.Offer o) { + long ret = bindings.CResult_OfferBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferBolt12SemanticErrorZ in the error state. + */ + public static Result_OfferBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_OfferBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OfferBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OfferBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OfferBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_OfferBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferBolt12SemanticErrorZ ret_hu_conv = Result_OfferBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferIdDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferIdDecodeErrorZ.cs new file mode 100644 index 00000000..75dccc42 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OfferIdDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OfferIdDecodeErrorZ : CommonBase { + Result_OfferIdDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OfferIdDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OfferIdDecodeErrorZ_free(ptr); } + } + + internal static Result_OfferIdDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferIdDecodeErrorZ_is_ok(ptr)) { + return new Result_OfferIdDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OfferIdDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OfferIdDecodeErrorZ_OK : Result_OfferIdDecodeErrorZ { + public readonly OfferId res; + internal Result_OfferIdDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OfferIdDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OfferId res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OfferId(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OfferIdDecodeErrorZ_Err : Result_OfferIdDecodeErrorZ { + public readonly DecodeError err; + internal Result_OfferIdDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OfferIdDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OfferIdDecodeErrorZ in the success state. + */ + public static Result_OfferIdDecodeErrorZ ok(org.ldk.structs.OfferId o) { + long ret = bindings.CResult_OfferIdDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferIdDecodeErrorZ ret_hu_conv = Result_OfferIdDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferIdDecodeErrorZ in the error state. + */ + public static Result_OfferIdDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OfferIdDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferIdDecodeErrorZ ret_hu_conv = Result_OfferIdDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OfferIdDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OfferIdDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OfferIdDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferIdDecodeErrorZ clone() { + long ret = bindings.CResult_OfferIdDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferIdDecodeErrorZ ret_hu_conv = Result_OfferIdDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..a653b236 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ : CommonBase { + Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_OK : Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ { + public readonly OfferWithDerivedMetadataBuilder res; + internal Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.OfferWithDerivedMetadataBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OfferWithDerivedMetadataBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_Err : Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ok(org.ldk.structs.OfferWithDerivedMetadataBuilder o) { + long ret = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_OfferWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs index 8dfa807c..680124ef 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionMessageDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_OnionMessageDecodeErrorZ : CommonBase { * Creates a new CResult_OnionMessageDecodeErrorZ in the success state. */ public static Result_OnionMessageDecodeErrorZ ok(org.ldk.structs.OnionMessage o) { - long ret = bindings.CResult_OnionMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OnionMessageDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessageDecodeErrorZ ret_hu_conv = Result_OnionMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs index c435f160..7ed0a895 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionMessagePathNoneZ.cs @@ -37,7 +37,7 @@ public class Result_OnionMessagePathNoneZ : CommonBase { * Creates a new CResult_OnionMessagePathNoneZ in the success state. */ public static Result_OnionMessagePathNoneZ ok(org.ldk.structs.OnionMessagePath o) { - long ret = bindings.CResult_OnionMessagePathNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OnionMessagePathNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionMessagePathNoneZ ret_hu_conv = Result_OnionMessagePathNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs index d699ca0a..99f3eaed 100644 --- a/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OnionPacketDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_OnionPacketDecodeErrorZ : CommonBase { * Creates a new CResult_OnionPacketDecodeErrorZ in the success state. */ public static Result_OnionPacketDecodeErrorZ ok(org.ldk.structs.OnionPacket o) { - long ret = bindings.CResult_OnionPacketDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OnionPacketDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OnionPacketDecodeErrorZ ret_hu_conv = Result_OnionPacketDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs index 955e37b6..a3b6e9c0 100644 --- a/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OpenChannelDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_OpenChannelDecodeErrorZ : CommonBase { * Creates a new CResult_OpenChannelDecodeErrorZ in the success state. */ public static Result_OpenChannelDecodeErrorZ ok(org.ldk.structs.OpenChannel o) { - long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OpenChannelDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelDecodeErrorZ ret_hu_conv = Result_OpenChannelDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs index 10d7b4dc..f6814da3 100644 --- a/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OpenChannelV2DecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_OpenChannelV2DecodeErrorZ : CommonBase { * Creates a new CResult_OpenChannelV2DecodeErrorZ in the success state. */ public static Result_OpenChannelV2DecodeErrorZ ok(org.ldk.structs.OpenChannelV2 o) { - long ret = bindings.CResult_OpenChannelV2DecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OpenChannelV2DecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OpenChannelV2DecodeErrorZ ret_hu_conv = Result_OpenChannelV2DecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs index dac99c18..ae29f7e0 100644 --- a/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_OutPointDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_OutPointDecodeErrorZ : CommonBase { * Creates a new CResult_OutPointDecodeErrorZ in the success state. */ public static Result_OutPointDecodeErrorZ ok(org.ldk.structs.OutPoint o) { - long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_OutPointDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_OutPointDecodeErrorZ ret_hu_conv = Result_OutPointDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs new file mode 100644 index 00000000..ca8bcb05 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OutputSpendStatusDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OutputSpendStatusDecodeErrorZ : CommonBase { + Result_OutputSpendStatusDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OutputSpendStatusDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OutputSpendStatusDecodeErrorZ_free(ptr); } + } + + internal static Result_OutputSpendStatusDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OutputSpendStatusDecodeErrorZ_is_ok(ptr)) { + return new Result_OutputSpendStatusDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OutputSpendStatusDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OutputSpendStatusDecodeErrorZ_OK : Result_OutputSpendStatusDecodeErrorZ { + public readonly OutputSpendStatus res; + internal Result_OutputSpendStatusDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OutputSpendStatusDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OutputSpendStatus res_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OutputSpendStatusDecodeErrorZ_Err : Result_OutputSpendStatusDecodeErrorZ { + public readonly DecodeError err; + internal Result_OutputSpendStatusDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OutputSpendStatusDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the success state. + */ + public static Result_OutputSpendStatusDecodeErrorZ ok(org.ldk.structs.OutputSpendStatus o) { + long ret = bindings.CResult_OutputSpendStatusDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSpendStatusDecodeErrorZ ret_hu_conv = Result_OutputSpendStatusDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OutputSpendStatusDecodeErrorZ in the error state. + */ + public static Result_OutputSpendStatusDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OutputSpendStatusDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSpendStatusDecodeErrorZ ret_hu_conv = Result_OutputSpendStatusDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OutputSpendStatusDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_OutputSpendStatusDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_OutputSpendStatusDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_OutputSpendStatusDecodeErrorZ clone() { + long ret = bindings.CResult_OutputSpendStatusDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSpendStatusDecodeErrorZ ret_hu_conv = Result_OutputSpendStatusDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs new file mode 100644 index 00000000..bc1dcc90 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_OutputSweeperDecodeErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_OutputSweeperDecodeErrorZ : CommonBase { + Result_OutputSweeperDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_OutputSweeperDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_OutputSweeperDecodeErrorZ_free(ptr); } + } + + internal static Result_OutputSweeperDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_OutputSweeperDecodeErrorZ_is_ok(ptr)) { + return new Result_OutputSweeperDecodeErrorZ_OK(null, ptr); + } else { + return new Result_OutputSweeperDecodeErrorZ_Err(null, ptr); + } + } + public class Result_OutputSweeperDecodeErrorZ_OK : Result_OutputSweeperDecodeErrorZ { + public readonly OutputSweeper res; + internal Result_OutputSweeperDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_OutputSweeperDecodeErrorZ_get_ok(ptr); + org.ldk.structs.OutputSweeper res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.OutputSweeper(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_OutputSweeperDecodeErrorZ_Err : Result_OutputSweeperDecodeErrorZ { + public readonly DecodeError err; + internal Result_OutputSweeperDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_OutputSweeperDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_OutputSweeperDecodeErrorZ in the success state. + */ + public static Result_OutputSweeperDecodeErrorZ ok(BestBlock o_best_block, BroadcasterInterface o_broadcaster, FeeEstimator o_fee_estimator, Option_FilterZ o_chain_data_source, OutputSpender o_output_spender, ChangeDestinationSource o_change_destination_source, KVStore o_kv_store, Logger o_logger) { + long ret = bindings.CResult_OutputSweeperDecodeErrorZ_ok(bindings.OutputSweeper_new(o_best_block.ptr, o_broadcaster.ptr, o_fee_estimator.ptr, o_chain_data_source.ptr, o_output_spender.ptr, o_change_destination_source.ptr, o_kv_store.ptr, o_logger.ptr)); + GC.KeepAlive(o_best_block); + GC.KeepAlive(o_broadcaster); + GC.KeepAlive(o_fee_estimator); + GC.KeepAlive(o_chain_data_source); + GC.KeepAlive(o_output_spender); + GC.KeepAlive(o_change_destination_source); + GC.KeepAlive(o_kv_store); + GC.KeepAlive(o_logger); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSweeperDecodeErrorZ ret_hu_conv = Result_OutputSweeperDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_best_block); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_fee_estimator); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_chain_data_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_output_spender); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_change_destination_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_kv_store); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o_logger); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_OutputSweeperDecodeErrorZ in the error state. + */ + public static Result_OutputSweeperDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_OutputSweeperDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_OutputSweeperDecodeErrorZ ret_hu_conv = Result_OutputSweeperDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_OutputSweeperDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs index e56a62c5..6cdfdd88 100644 --- a/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PayeePubKeySecp256k1ErrorZ.cs @@ -39,7 +39,7 @@ public class Result_PayeePubKeySecp256k1ErrorZ : CommonBase { * Creates a new CResult_PayeePubKeySecp256k1ErrorZ in the success state. */ public static Result_PayeePubKeySecp256k1ErrorZ ok(org.ldk.structs.PayeePubKey o) { - long ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PayeePubKeySecp256k1ErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PayeePubKeySecp256k1ErrorZ ret_hu_conv = Result_PayeePubKeySecp256k1ErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs index fc1beb51..2b95c9c5 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentConstraintsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PaymentConstraintsDecodeErrorZ : CommonBase { * Creates a new CResult_PaymentConstraintsDecodeErrorZ in the success state. */ public static Result_PaymentConstraintsDecodeErrorZ ok(org.ldk.structs.PaymentConstraints o) { - long ret = bindings.CResult_PaymentConstraintsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PaymentConstraintsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentConstraintsDecodeErrorZ ret_hu_conv = Result_PaymentConstraintsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs new file mode 100644 index 00000000..6742f4a3 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_PaymentContextDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_PaymentContextDecodeErrorZ : CommonBase { + Result_PaymentContextDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_PaymentContextDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_PaymentContextDecodeErrorZ_free(ptr); } + } + + internal static Result_PaymentContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_PaymentContextDecodeErrorZ_is_ok(ptr)) { + return new Result_PaymentContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_PaymentContextDecodeErrorZ_Err(null, ptr); + } + } + public class Result_PaymentContextDecodeErrorZ_OK : Result_PaymentContextDecodeErrorZ { + public readonly PaymentContext res; + internal Result_PaymentContextDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_PaymentContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.PaymentContext res_hu_conv = org.ldk.structs.PaymentContext.constr_from_ptr(res); + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_PaymentContextDecodeErrorZ_Err : Result_PaymentContextDecodeErrorZ { + public readonly DecodeError err; + internal Result_PaymentContextDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_PaymentContextDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_PaymentContextDecodeErrorZ in the success state. + */ + public static Result_PaymentContextDecodeErrorZ ok(org.ldk.structs.PaymentContext o) { + long ret = bindings.CResult_PaymentContextDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentContextDecodeErrorZ ret_hu_conv = Result_PaymentContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_PaymentContextDecodeErrorZ in the error state. + */ + public static Result_PaymentContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_PaymentContextDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentContextDecodeErrorZ ret_hu_conv = Result_PaymentContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_PaymentContextDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_PaymentContextDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_PaymentContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PaymentContextDecodeErrorZ clone() { + long ret = bindings.CResult_PaymentContextDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PaymentContextDecodeErrorZ ret_hu_conv = Result_PaymentContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs index 4d9eb90c..1464897d 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentParametersDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PaymentParametersDecodeErrorZ : CommonBase { * Creates a new CResult_PaymentParametersDecodeErrorZ in the success state. */ public static Result_PaymentParametersDecodeErrorZ ok(org.ldk.structs.PaymentParameters o) { - long ret = bindings.CResult_PaymentParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PaymentParametersDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentParametersDecodeErrorZ ret_hu_conv = Result_PaymentParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs index fbc7f872..01e945f8 100644 --- a/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PaymentRelayDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PaymentRelayDecodeErrorZ : CommonBase { * Creates a new CResult_PaymentRelayDecodeErrorZ in the success state. */ public static Result_PaymentRelayDecodeErrorZ ok(org.ldk.structs.PaymentRelay o) { - long ret = bindings.CResult_PaymentRelayDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PaymentRelayDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PaymentRelayDecodeErrorZ ret_hu_conv = Result_PaymentRelayDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PeeledOnionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_PeeledOnionNoneZ.cs index 176dd41e..04742b4d 100644 --- a/c_sharp/src/org/ldk/structs/Result_PeeledOnionNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PeeledOnionNoneZ.cs @@ -64,5 +64,23 @@ public class Result_PeeledOnionNoneZ : CommonBase { return ret; } + internal long clone_ptr() { + long ret = bindings.CResult_PeeledOnionNoneZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_PeeledOnionNoneZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PeeledOnionNoneZ clone() { + long ret = bindings.CResult_PeeledOnionNoneZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PeeledOnionNoneZ ret_hu_conv = Result_PeeledOnionNoneZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.cs index 4601eb89..64592855 100644 --- a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PendingHTLCInfoDecodeErrorZ : CommonBase { * Creates a new CResult_PendingHTLCInfoDecodeErrorZ in the success state. */ public static Result_PendingHTLCInfoDecodeErrorZ ok(org.ldk.structs.PendingHTLCInfo o) { - long ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PendingHTLCInfoDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoDecodeErrorZ ret_hu_conv = Result_PendingHTLCInfoDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs index 5b179ad2..aaf1b9b9 100644 --- a/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PendingHTLCInfoInboundHTLCErrZ.cs @@ -42,7 +42,7 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ : CommonBase { * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the success state. */ public static Result_PendingHTLCInfoInboundHTLCErrZ ok(org.ldk.structs.PendingHTLCInfo o) { - long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret); @@ -53,15 +53,12 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ : CommonBase { /** * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ in the error state. */ - public static Result_PendingHTLCInfoInboundHTLCErrZ err(short e_err_code_arg, byte[] e_err_data_arg, string e_msg_arg) { - long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_err(bindings.InboundHTLCErr_new(e_err_code_arg, InternalUtils.encodeUint8Array(e_err_data_arg), InternalUtils.encodeString(e_msg_arg))); - GC.KeepAlive(e_err_code_arg); - GC.KeepAlive(e_err_data_arg); - GC.KeepAlive(e_msg_arg); + public static Result_PendingHTLCInfoInboundHTLCErrZ err(org.ldk.structs.InboundHTLCErr e) { + long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_err(e.ptr); + GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret); - ; - ; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; return ret_hu_conv; } @@ -74,5 +71,23 @@ public class Result_PendingHTLCInfoInboundHTLCErrZ : CommonBase { return ret; } + internal long clone_ptr() { + long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_PendingHTLCInfoInboundHTLCErrZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_PendingHTLCInfoInboundHTLCErrZ clone() { + long ret = bindings.CResult_PendingHTLCInfoInboundHTLCErrZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_PendingHTLCInfoInboundHTLCErrZ ret_hu_conv = Result_PendingHTLCInfoInboundHTLCErrZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs index 3999a2ca..6878b86f 100644 --- a/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PhantomRouteHintsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PhantomRouteHintsDecodeErrorZ : CommonBase { * Creates a new CResult_PhantomRouteHintsDecodeErrorZ in the success state. */ public static Result_PhantomRouteHintsDecodeErrorZ ok(org.ldk.structs.PhantomRouteHints o) { - long ret = bindings.CResult_PhantomRouteHintsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PhantomRouteHintsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PhantomRouteHintsDecodeErrorZ ret_hu_conv = Result_PhantomRouteHintsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs index 5fb56b9d..e0e355b3 100644 --- a/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PingDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PingDecodeErrorZ : CommonBase { * Creates a new CResult_PingDecodeErrorZ in the success state. */ public static Result_PingDecodeErrorZ ok(org.ldk.structs.Ping o) { - long ret = bindings.CResult_PingDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PingDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PingDecodeErrorZ ret_hu_conv = Result_PingDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs index 0775c310..1211fe68 100644 --- a/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PongDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_PongDecodeErrorZ : CommonBase { * Creates a new CResult_PongDecodeErrorZ in the success state. */ public static Result_PongDecodeErrorZ ok(org.ldk.structs.Pong o) { - long ret = bindings.CResult_PongDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PongDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PongDecodeErrorZ ret_hu_conv = Result_PongDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs index 7093924b..cf59f087 100644 --- a/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PositiveTimestampCreationErrorZ.cs @@ -39,7 +39,7 @@ public class Result_PositiveTimestampCreationErrorZ : CommonBase { * Creates a new CResult_PositiveTimestampCreationErrorZ in the success state. */ public static Result_PositiveTimestampCreationErrorZ ok(org.ldk.structs.PositiveTimestamp o) { - long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PositiveTimestampCreationErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PositiveTimestampCreationErrorZ ret_hu_conv = Result_PositiveTimestampCreationErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs index 929e63a7..ba1b46a1 100644 --- a/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_PrivateRouteCreationErrorZ.cs @@ -39,7 +39,7 @@ public class Result_PrivateRouteCreationErrorZ : CommonBase { * Creates a new CResult_PrivateRouteCreationErrorZ in the success state. */ public static Result_PrivateRouteCreationErrorZ ok(org.ldk.structs.PrivateRoute o) { - long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_PrivateRouteCreationErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_PrivateRouteCreationErrorZ ret_hu_conv = Result_PrivateRouteCreationErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs index 2bed5dd2..f887d547 100644 --- a/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ProbabilisticScorerDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ProbabilisticScorerDecodeErrorZ : CommonBase { * Creates a new CResult_ProbabilisticScorerDecodeErrorZ in the success state. */ public static Result_ProbabilisticScorerDecodeErrorZ ok(ProbabilisticScoringDecayParameters o_decay_params, NetworkGraph o_network_graph, Logger o_logger) { - long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_decay_params == null ? 0 : o_decay_params.ptr, o_network_graph == null ? 0 : o_network_graph.ptr, o_logger.ptr)); + long ret = bindings.CResult_ProbabilisticScorerDecodeErrorZ_ok(bindings.ProbabilisticScorer_new(o_decay_params.ptr, o_network_graph.ptr, o_logger.ptr)); GC.KeepAlive(o_decay_params); GC.KeepAlive(o_network_graph); GC.KeepAlive(o_logger); diff --git a/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs index e1186107..15726858 100644 --- a/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_QueryChannelRangeDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_QueryChannelRangeDecodeErrorZ : CommonBase { * Creates a new CResult_QueryChannelRangeDecodeErrorZ in the success state. */ public static Result_QueryChannelRangeDecodeErrorZ ok(org.ldk.structs.QueryChannelRange o) { - long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_QueryChannelRangeDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryChannelRangeDecodeErrorZ ret_hu_conv = Result_QueryChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs index 2f300397..d6979806 100644 --- a/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_QueryShortChannelIdsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_QueryShortChannelIdsDecodeErrorZ : CommonBase { * Creates a new CResult_QueryShortChannelIdsDecodeErrorZ in the success state. */ public static Result_QueryShortChannelIdsDecodeErrorZ ok(org.ldk.structs.QueryShortChannelIds o) { - long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_QueryShortChannelIdsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_QueryShortChannelIdsDecodeErrorZ ret_hu_conv = Result_QueryShortChannelIdsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs index fdc4db80..a29aed19 100644 --- a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RecipientOnionFieldsDecodeErrorZ : CommonBase { * Creates a new CResult_RecipientOnionFieldsDecodeErrorZ in the success state. */ public static Result_RecipientOnionFieldsDecodeErrorZ ok(org.ldk.structs.RecipientOnionFields o) { - long ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RecipientOnionFieldsDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsDecodeErrorZ ret_hu_conv = Result_RecipientOnionFieldsDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs index 3dfe1b76..87b0d9e2 100644 --- a/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RecipientOnionFieldsNoneZ.cs @@ -37,7 +37,7 @@ public class Result_RecipientOnionFieldsNoneZ : CommonBase { * Creates a new CResult_RecipientOnionFieldsNoneZ in the success state. */ public static Result_RecipientOnionFieldsNoneZ ok(org.ldk.structs.RecipientOnionFields o) { - long ret = bindings.CResult_RecipientOnionFieldsNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RecipientOnionFieldsNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RecipientOnionFieldsNoneZ ret_hu_conv = Result_RecipientOnionFieldsNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs index 56760a92..320ee92a 100644 --- a/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RefundBolt12ParseErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RefundBolt12ParseErrorZ : CommonBase { * Creates a new CResult_RefundBolt12ParseErrorZ in the success state. */ public static Result_RefundBolt12ParseErrorZ ok(org.ldk.structs.Refund o) { - long ret = bindings.CResult_RefundBolt12ParseErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RefundBolt12ParseErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); @@ -54,7 +54,7 @@ public class Result_RefundBolt12ParseErrorZ : CommonBase { * Creates a new CResult_RefundBolt12ParseErrorZ in the error state. */ public static Result_RefundBolt12ParseErrorZ err(org.ldk.structs.Bolt12ParseError e) { - long ret = bindings.CResult_RefundBolt12ParseErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_RefundBolt12ParseErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RefundBolt12ParseErrorZ ret_hu_conv = Result_RefundBolt12ParseErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..d926ad2d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_RefundBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_RefundBolt12SemanticErrorZ : CommonBase { + Result_RefundBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_RefundBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_RefundBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_RefundBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_RefundBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_RefundBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_RefundBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_RefundBolt12SemanticErrorZ_OK : Result_RefundBolt12SemanticErrorZ { + public readonly Refund res; + internal Result_RefundBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_RefundBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.Refund res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.Refund(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_RefundBolt12SemanticErrorZ_Err : Result_RefundBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_RefundBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_RefundBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_RefundBolt12SemanticErrorZ in the success state. + */ + public static Result_RefundBolt12SemanticErrorZ ok(org.ldk.structs.Refund o) { + long ret = bindings.CResult_RefundBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12SemanticErrorZ ret_hu_conv = Result_RefundBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_RefundBolt12SemanticErrorZ in the error state. + */ + public static Result_RefundBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_RefundBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12SemanticErrorZ ret_hu_conv = Result_RefundBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_RefundBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_RefundBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_RefundBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RefundBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_RefundBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundBolt12SemanticErrorZ ret_hu_conv = Result_RefundBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..820bf5bf --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ : CommonBase { + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_OK : Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ { + public readonly RefundMaybeWithDerivedMetadataBuilder res; + internal Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.RefundMaybeWithDerivedMetadataBuilder res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.RefundMaybeWithDerivedMetadataBuilder(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_Err : Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the success state. + */ + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ok(org.ldk.structs.RefundMaybeWithDerivedMetadataBuilder o) { + long ret = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ in the error state. + */ + public static Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ ret_hu_conv = Result_RefundMaybeWithDerivedMetadataBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs index d2bd98a7..513b5e4e 100644 --- a/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ReplyChannelRangeDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ReplyChannelRangeDecodeErrorZ : CommonBase { * Creates a new CResult_ReplyChannelRangeDecodeErrorZ in the success state. */ public static Result_ReplyChannelRangeDecodeErrorZ ok(org.ldk.structs.ReplyChannelRange o) { - long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ReplyChannelRangeDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyChannelRangeDecodeErrorZ ret_hu_conv = Result_ReplyChannelRangeDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs index 57cb7f02..59802c4c 100644 --- a/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ReplyShortChannelIdsEndDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ReplyShortChannelIdsEndDecodeErrorZ : CommonBase { * Creates a new CResult_ReplyShortChannelIdsEndDecodeErrorZ in the success state. */ public static Result_ReplyShortChannelIdsEndDecodeErrorZ ok(org.ldk.structs.ReplyShortChannelIdsEnd o) { - long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ReplyShortChannelIdsEndDecodeErrorZ ret_hu_conv = Result_ReplyShortChannelIdsEndDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs index 700113a7..ec111f90 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevocationBasepointDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RevocationBasepointDecodeErrorZ : CommonBase { * Creates a new CResult_RevocationBasepointDecodeErrorZ in the success state. */ public static Result_RevocationBasepointDecodeErrorZ ok(org.ldk.structs.RevocationBasepoint o) { - long ret = bindings.CResult_RevocationBasepointDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RevocationBasepointDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationBasepointDecodeErrorZ ret_hu_conv = Result_RevocationBasepointDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs index 8278d2f0..8b672e6a 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevocationKeyDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RevocationKeyDecodeErrorZ : CommonBase { * Creates a new CResult_RevocationKeyDecodeErrorZ in the success state. */ public static Result_RevocationKeyDecodeErrorZ ok(org.ldk.structs.RevocationKey o) { - long ret = bindings.CResult_RevocationKeyDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RevocationKeyDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevocationKeyDecodeErrorZ ret_hu_conv = Result_RevocationKeyDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs index aa178bde..9fb090dd 100644 --- a/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RevokeAndACKDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RevokeAndACKDecodeErrorZ : CommonBase { * Creates a new CResult_RevokeAndACKDecodeErrorZ in the success state. */ public static Result_RevokeAndACKDecodeErrorZ ok(org.ldk.structs.RevokeAndACK o) { - long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RevokeAndACKDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RevokeAndACKDecodeErrorZ ret_hu_conv = Result_RevokeAndACKDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs index 9a406663..548a404c 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RouteDecodeErrorZ : CommonBase { * Creates a new CResult_RouteDecodeErrorZ in the success state. */ public static Result_RouteDecodeErrorZ ok(org.ldk.structs.Route o) { - long ret = bindings.CResult_RouteDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RouteDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteDecodeErrorZ ret_hu_conv = Result_RouteDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs index 068fc557..aa7ab448 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHintDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RouteHintDecodeErrorZ : CommonBase { * Creates a new CResult_RouteHintDecodeErrorZ in the success state. */ public static Result_RouteHintDecodeErrorZ ok(org.ldk.structs.RouteHint o) { - long ret = bindings.CResult_RouteHintDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RouteHintDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintDecodeErrorZ ret_hu_conv = Result_RouteHintDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs index 99be1f7a..1dfe84a7 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHintHopDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RouteHintHopDecodeErrorZ : CommonBase { * Creates a new CResult_RouteHintHopDecodeErrorZ in the success state. */ public static Result_RouteHintHopDecodeErrorZ ok(org.ldk.structs.RouteHintHop o) { - long ret = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RouteHintHopDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHintHopDecodeErrorZ ret_hu_conv = Result_RouteHintHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs index caee5cf4..5dc79887 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteHopDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RouteHopDecodeErrorZ : CommonBase { * Creates a new CResult_RouteHopDecodeErrorZ in the success state. */ public static Result_RouteHopDecodeErrorZ ok(org.ldk.structs.RouteHop o) { - long ret = bindings.CResult_RouteHopDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RouteHopDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteHopDecodeErrorZ ret_hu_conv = Result_RouteHopDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs index e3dc6d27..52d35517 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteLightningErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RouteLightningErrorZ : CommonBase { * Creates a new CResult_RouteLightningErrorZ in the success state. */ public static Result_RouteLightningErrorZ ok(org.ldk.structs.Route o) { - long ret = bindings.CResult_RouteLightningErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RouteLightningErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); @@ -54,7 +54,7 @@ public class Result_RouteLightningErrorZ : CommonBase { * Creates a new CResult_RouteLightningErrorZ in the error state. */ public static Result_RouteLightningErrorZ err(org.ldk.structs.LightningError e) { - long ret = bindings.CResult_RouteLightningErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_RouteLightningErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteLightningErrorZ ret_hu_conv = Result_RouteLightningErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs index c7fe06d0..77380130 100644 --- a/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RouteParametersDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RouteParametersDecodeErrorZ : CommonBase { * Creates a new CResult_RouteParametersDecodeErrorZ in the success state. */ public static Result_RouteParametersDecodeErrorZ ok(org.ldk.structs.RouteParameters o) { - long ret = bindings.CResult_RouteParametersDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RouteParametersDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RouteParametersDecodeErrorZ ret_hu_conv = Result_RouteParametersDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs index 4009919a..21d1577a 100644 --- a/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_RoutingFeesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_RoutingFeesDecodeErrorZ : CommonBase { * Creates a new CResult_RoutingFeesDecodeErrorZ in the success state. */ public static Result_RoutingFeesDecodeErrorZ ok(org.ldk.structs.RoutingFees o) { - long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_RoutingFeesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_RoutingFeesDecodeErrorZ ret_hu_conv = Result_RoutingFeesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs index c608d13e..b23c46ac 100644 --- a/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SendSuccessSendErrorZ.cs @@ -71,5 +71,23 @@ public class Result_SendSuccessSendErrorZ : CommonBase { return ret; } + internal long clone_ptr() { + long ret = bindings.CResult_SendSuccessSendErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_SendSuccessSendErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_SendSuccessSendErrorZ clone() { + long ret = bindings.CResult_SendSuccessSendErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SendSuccessSendErrorZ ret_hu_conv = Result_SendSuccessSendErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs index 6624e31f..c7112702 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ShutdownDecodeErrorZ : CommonBase { * Creates a new CResult_ShutdownDecodeErrorZ in the success state. */ public static Result_ShutdownDecodeErrorZ ok(org.ldk.structs.Shutdown o) { - long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ShutdownDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownDecodeErrorZ ret_hu_conv = Result_ShutdownDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs index 27612b9a..d1791c16 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_ShutdownScriptDecodeErrorZ : CommonBase { * Creates a new CResult_ShutdownScriptDecodeErrorZ in the success state. */ public static Result_ShutdownScriptDecodeErrorZ ok(org.ldk.structs.ShutdownScript o) { - long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ShutdownScriptDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptDecodeErrorZ ret_hu_conv = Result_ShutdownScriptDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs index 4cffd040..c6c8cdb9 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptInvalidShutdownScriptZ.cs @@ -42,7 +42,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ : CommonBase { * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the success state. */ public static Result_ShutdownScriptInvalidShutdownScriptZ ok(org.ldk.structs.ShutdownScript o) { - long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); @@ -54,7 +54,7 @@ public class Result_ShutdownScriptInvalidShutdownScriptZ : CommonBase { * Creates a new CResult_ShutdownScriptInvalidShutdownScriptZ in the error state. */ public static Result_ShutdownScriptInvalidShutdownScriptZ err(org.ldk.structs.InvalidShutdownScript e) { - long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_ShutdownScriptInvalidShutdownScriptZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptInvalidShutdownScriptZ ret_hu_conv = Result_ShutdownScriptInvalidShutdownScriptZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs index e65cec4d..13e659f0 100644 --- a/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_ShutdownScriptNoneZ.cs @@ -37,7 +37,7 @@ public class Result_ShutdownScriptNoneZ : CommonBase { * Creates a new CResult_ShutdownScriptNoneZ in the success state. */ public static Result_ShutdownScriptNoneZ ok(org.ldk.structs.ShutdownScript o) { - long ret = bindings.CResult_ShutdownScriptNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_ShutdownScriptNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_ShutdownScriptNoneZ ret_hu_conv = Result_ShutdownScriptNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs index 4a811333..5377866e 100644 --- a/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.cs @@ -42,7 +42,7 @@ public class Result_SignedRawBolt11InvoiceBolt11ParseErrorZ : CommonBase { * Creates a new CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ in the success state. */ public static Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ok(org.ldk.structs.SignedRawBolt11Invoice o) { - long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_SignedRawBolt11InvoiceBolt11ParseErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SignedRawBolt11InvoiceBolt11ParseErrorZ ret_hu_conv = Result_SignedRawBolt11InvoiceBolt11ParseErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs index 2034f6b8..e3da67c7 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpliceAckDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_SpliceAckDecodeErrorZ : CommonBase { * Creates a new CResult_SpliceAckDecodeErrorZ in the success state. */ public static Result_SpliceAckDecodeErrorZ ok(org.ldk.structs.SpliceAck o) { - long ret = bindings.CResult_SpliceAckDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_SpliceAckDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceAckDecodeErrorZ ret_hu_conv = Result_SpliceAckDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs index 8d9f07b9..c7f5c790 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpliceDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_SpliceDecodeErrorZ : CommonBase { * Creates a new CResult_SpliceDecodeErrorZ in the success state. */ public static Result_SpliceDecodeErrorZ ok(org.ldk.structs.Splice o) { - long ret = bindings.CResult_SpliceDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_SpliceDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceDecodeErrorZ ret_hu_conv = Result_SpliceDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs index e8aafaaf..0aa08456 100644 --- a/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_SpliceLockedDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_SpliceLockedDecodeErrorZ : CommonBase { * Creates a new CResult_SpliceLockedDecodeErrorZ in the success state. */ public static Result_SpliceLockedDecodeErrorZ ok(org.ldk.structs.SpliceLocked o) { - long ret = bindings.CResult_SpliceLockedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_SpliceLockedDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_SpliceLockedDecodeErrorZ ret_hu_conv = Result_SpliceLockedDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs index 571cb1c0..dd98f277 100644 --- a/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_StaticPaymentOutputDescriptorDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_StaticPaymentOutputDescriptorDecodeErrorZ : CommonBase { * Creates a new CResult_StaticPaymentOutputDescriptorDecodeErrorZ in the success state. */ public static Result_StaticPaymentOutputDescriptorDecodeErrorZ ok(org.ldk.structs.StaticPaymentOutputDescriptor o) { - long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_StaticPaymentOutputDescriptorDecodeErrorZ ret_hu_conv = Result_StaticPaymentOutputDescriptorDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs index 4168537a..be1dd770 100644 --- a/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_StfuDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_StfuDecodeErrorZ : CommonBase { * Creates a new CResult_StfuDecodeErrorZ in the success state. */ public static Result_StfuDecodeErrorZ ok(org.ldk.structs.Stfu o) { - long ret = bindings.CResult_StfuDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_StfuDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_StfuDecodeErrorZ ret_hu_conv = Result_StfuDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs new file mode 100644 index 00000000..3afd7ee1 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_TrackedSpendableOutputDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_TrackedSpendableOutputDecodeErrorZ : CommonBase { + Result_TrackedSpendableOutputDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_TrackedSpendableOutputDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_TrackedSpendableOutputDecodeErrorZ_free(ptr); } + } + + internal static Result_TrackedSpendableOutputDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(ptr)) { + return new Result_TrackedSpendableOutputDecodeErrorZ_OK(null, ptr); + } else { + return new Result_TrackedSpendableOutputDecodeErrorZ_Err(null, ptr); + } + } + public class Result_TrackedSpendableOutputDecodeErrorZ_OK : Result_TrackedSpendableOutputDecodeErrorZ { + public readonly TrackedSpendableOutput res; + internal Result_TrackedSpendableOutputDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_get_ok(ptr); + org.ldk.structs.TrackedSpendableOutput res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.TrackedSpendableOutput(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_TrackedSpendableOutputDecodeErrorZ_Err : Result_TrackedSpendableOutputDecodeErrorZ { + public readonly DecodeError err; + internal Result_TrackedSpendableOutputDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the success state. + */ + public static Result_TrackedSpendableOutputDecodeErrorZ ok(org.ldk.structs.TrackedSpendableOutput o) { + long ret = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TrackedSpendableOutputDecodeErrorZ ret_hu_conv = Result_TrackedSpendableOutputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ in the error state. + */ + public static Result_TrackedSpendableOutputDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TrackedSpendableOutputDecodeErrorZ ret_hu_conv = Result_TrackedSpendableOutputDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_TrackedSpendableOutputDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_TrackedSpendableOutputDecodeErrorZ clone() { + long ret = bindings.CResult_TrackedSpendableOutputDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TrackedSpendableOutputDecodeErrorZ ret_hu_conv = Result_TrackedSpendableOutputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs index 56e43b62..7508f500 100644 --- a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TransactionU16LenLimitedDecodeErrorZ : CommonBase { * Creates a new CResult_TransactionU16LenLimitedDecodeErrorZ in the success state. */ public static Result_TransactionU16LenLimitedDecodeErrorZ ok(org.ldk.structs.TransactionU16LenLimited o) { - long ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TransactionU16LenLimitedDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedDecodeErrorZ ret_hu_conv = Result_TransactionU16LenLimitedDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs index 543245c1..5b5442ec 100644 --- a/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TransactionU16LenLimitedNoneZ.cs @@ -37,7 +37,7 @@ public class Result_TransactionU16LenLimitedNoneZ : CommonBase { * Creates a new CResult_TransactionU16LenLimitedNoneZ in the success state. */ public static Result_TransactionU16LenLimitedNoneZ ok(org.ldk.structs.TransactionU16LenLimited o) { - long ret = bindings.CResult_TransactionU16LenLimitedNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TransactionU16LenLimitedNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TransactionU16LenLimitedNoneZ ret_hu_conv = Result_TransactionU16LenLimitedNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.cs index 3906f2f9..34c3a76a 100644 --- a/c_sharp/src/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TrustedClosingTransactionNoneZ.cs @@ -37,7 +37,7 @@ public class Result_TrustedClosingTransactionNoneZ : CommonBase { * Creates a new CResult_TrustedClosingTransactionNoneZ in the success state. */ public static Result_TrustedClosingTransactionNoneZ ok(org.ldk.structs.TrustedClosingTransaction o) { - long ret = bindings.CResult_TrustedClosingTransactionNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TrustedClosingTransactionNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TrustedClosingTransactionNoneZ ret_hu_conv = Result_TrustedClosingTransactionNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.cs index 7a8dca9f..b87c33ea 100644 --- a/c_sharp/src/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TrustedCommitmentTransactionNoneZ.cs @@ -37,7 +37,7 @@ public class Result_TrustedCommitmentTransactionNoneZ : CommonBase { * Creates a new CResult_TrustedCommitmentTransactionNoneZ in the success state. */ public static Result_TrustedCommitmentTransactionNoneZ ok(org.ldk.structs.TrustedCommitmentTransaction o) { - long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TrustedCommitmentTransactionNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TrustedCommitmentTransactionNoneZ ret_hu_conv = Result_TrustedCommitmentTransactionNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs index ce64c3a6..2c25b573 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAbortDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxAbortDecodeErrorZ : CommonBase { * Creates a new CResult_TxAbortDecodeErrorZ in the success state. */ public static Result_TxAbortDecodeErrorZ ok(org.ldk.structs.TxAbort o) { - long ret = bindings.CResult_TxAbortDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxAbortDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAbortDecodeErrorZ ret_hu_conv = Result_TxAbortDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs index e7bfd344..19ff18c3 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAckRbfDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxAckRbfDecodeErrorZ : CommonBase { * Creates a new CResult_TxAckRbfDecodeErrorZ in the success state. */ public static Result_TxAckRbfDecodeErrorZ ok(org.ldk.structs.TxAckRbf o) { - long ret = bindings.CResult_TxAckRbfDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxAckRbfDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAckRbfDecodeErrorZ ret_hu_conv = Result_TxAckRbfDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs index 12b30f31..ad5ead8f 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAddInputDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxAddInputDecodeErrorZ : CommonBase { * Creates a new CResult_TxAddInputDecodeErrorZ in the success state. */ public static Result_TxAddInputDecodeErrorZ ok(org.ldk.structs.TxAddInput o) { - long ret = bindings.CResult_TxAddInputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxAddInputDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddInputDecodeErrorZ ret_hu_conv = Result_TxAddInputDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs index 90cbe9dc..0d2d4143 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxAddOutputDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxAddOutputDecodeErrorZ : CommonBase { * Creates a new CResult_TxAddOutputDecodeErrorZ in the success state. */ public static Result_TxAddOutputDecodeErrorZ ok(org.ldk.structs.TxAddOutput o) { - long ret = bindings.CResult_TxAddOutputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxAddOutputDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxAddOutputDecodeErrorZ ret_hu_conv = Result_TxAddOutputDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs index 1ed6321d..9d2e5d6d 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxCompleteDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxCompleteDecodeErrorZ : CommonBase { * Creates a new CResult_TxCompleteDecodeErrorZ in the success state. */ public static Result_TxCompleteDecodeErrorZ ok(org.ldk.structs.TxComplete o) { - long ret = bindings.CResult_TxCompleteDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxCompleteDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCompleteDecodeErrorZ ret_hu_conv = Result_TxCompleteDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs index 5d7a8153..66017604 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxCreationKeysDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxCreationKeysDecodeErrorZ : CommonBase { * Creates a new CResult_TxCreationKeysDecodeErrorZ in the success state. */ public static Result_TxCreationKeysDecodeErrorZ ok(org.ldk.structs.TxCreationKeys o) { - long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxCreationKeysDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxCreationKeysDecodeErrorZ ret_hu_conv = Result_TxCreationKeysDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs index 53010fd2..33e38697 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxInitRbfDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxInitRbfDecodeErrorZ : CommonBase { * Creates a new CResult_TxInitRbfDecodeErrorZ in the success state. */ public static Result_TxInitRbfDecodeErrorZ ok(org.ldk.structs.TxInitRbf o) { - long ret = bindings.CResult_TxInitRbfDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxInitRbfDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxInitRbfDecodeErrorZ ret_hu_conv = Result_TxInitRbfDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs index fd0c4630..3d0b4ee8 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxRemoveInputDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxRemoveInputDecodeErrorZ : CommonBase { * Creates a new CResult_TxRemoveInputDecodeErrorZ in the success state. */ public static Result_TxRemoveInputDecodeErrorZ ok(org.ldk.structs.TxRemoveInput o) { - long ret = bindings.CResult_TxRemoveInputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxRemoveInputDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveInputDecodeErrorZ ret_hu_conv = Result_TxRemoveInputDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs index 62dcffe7..f005783e 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxRemoveOutputDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxRemoveOutputDecodeErrorZ : CommonBase { * Creates a new CResult_TxRemoveOutputDecodeErrorZ in the success state. */ public static Result_TxRemoveOutputDecodeErrorZ ok(org.ldk.structs.TxRemoveOutput o) { - long ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxRemoveOutputDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxRemoveOutputDecodeErrorZ ret_hu_conv = Result_TxRemoveOutputDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs index 6f1ae9ee..db18f188 100644 --- a/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_TxSignaturesDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_TxSignaturesDecodeErrorZ : CommonBase { * Creates a new CResult_TxSignaturesDecodeErrorZ in the success state. */ public static Result_TxSignaturesDecodeErrorZ ok(org.ldk.structs.TxSignatures o) { - long ret = bindings.CResult_TxSignaturesDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_TxSignaturesDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_TxSignaturesDecodeErrorZ ret_hu_conv = Result_TxSignaturesDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs new file mode 100644 index 00000000..805857dd --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_UnknownPaymentContextDecodeErrorZ.cs @@ -0,0 +1,93 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_UnknownPaymentContextDecodeErrorZ : CommonBase { + Result_UnknownPaymentContextDecodeErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_UnknownPaymentContextDecodeErrorZ() { + if (ptr != 0) { bindings.CResult_UnknownPaymentContextDecodeErrorZ_free(ptr); } + } + + internal static Result_UnknownPaymentContextDecodeErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_UnknownPaymentContextDecodeErrorZ_is_ok(ptr)) { + return new Result_UnknownPaymentContextDecodeErrorZ_OK(null, ptr); + } else { + return new Result_UnknownPaymentContextDecodeErrorZ_Err(null, ptr); + } + } + public class Result_UnknownPaymentContextDecodeErrorZ_OK : Result_UnknownPaymentContextDecodeErrorZ { + public readonly UnknownPaymentContext res; + internal Result_UnknownPaymentContextDecodeErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_UnknownPaymentContextDecodeErrorZ_get_ok(ptr); + org.ldk.structs.UnknownPaymentContext res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_UnknownPaymentContextDecodeErrorZ_Err : Result_UnknownPaymentContextDecodeErrorZ { + public readonly DecodeError err; + internal Result_UnknownPaymentContextDecodeErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + long err = bindings.CResult_UnknownPaymentContextDecodeErrorZ_get_err(ptr); + org.ldk.structs.DecodeError err_hu_conv = org.ldk.structs.DecodeError.constr_from_ptr(err); + if (err_hu_conv != null) { err_hu_conv.ptrs_to.AddLast(this); }; + this.err = err_hu_conv; + } + } + + /** + * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the success state. + */ + public static Result_UnknownPaymentContextDecodeErrorZ ok(org.ldk.structs.UnknownPaymentContext o) { + long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnknownPaymentContextDecodeErrorZ in the error state. + */ + public static Result_UnknownPaymentContextDecodeErrorZ err(org.ldk.structs.DecodeError e) { + long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_err(e.ptr); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(e); }; + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_UnknownPaymentContextDecodeErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UnknownPaymentContextDecodeErrorZ clone() { + long ret = bindings.CResult_UnknownPaymentContextDecodeErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..a51ee9eb --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ : CommonBase { + Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ_OK : Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ { + public readonly UnsignedBolt12Invoice res; + internal Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.UnsignedBolt12Invoice res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnsignedBolt12Invoice(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ_Err : Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the success state. + */ + public static Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ ok(org.ldk.structs.UnsignedBolt12Invoice o) { + long ret = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ in the error state. + */ + public static Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_UnsignedBolt12InvoiceBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedBolt12InvoiceBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs index 56833d2e..8ee0b210 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelAnnouncementDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UnsignedChannelAnnouncementDecodeErrorZ : CommonBase { * Creates a new CResult_UnsignedChannelAnnouncementDecodeErrorZ in the success state. */ public static Result_UnsignedChannelAnnouncementDecodeErrorZ ok(org.ldk.structs.UnsignedChannelAnnouncement o) { - long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedChannelAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs index 664ec9e0..048c120d 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedChannelUpdateDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UnsignedChannelUpdateDecodeErrorZ : CommonBase { * Creates a new CResult_UnsignedChannelUpdateDecodeErrorZ in the success state. */ public static Result_UnsignedChannelUpdateDecodeErrorZ ok(org.ldk.structs.UnsignedChannelUpdate o) { - long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedChannelUpdateDecodeErrorZ ret_hu_conv = Result_UnsignedChannelUpdateDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs new file mode 100644 index 00000000..7a19769d --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.cs @@ -0,0 +1,89 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ : CommonBase { + Result_UnsignedInvoiceRequestBolt12SemanticErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_UnsignedInvoiceRequestBolt12SemanticErrorZ() { + if (ptr != 0) { bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_free(ptr); } + } + + internal static Result_UnsignedInvoiceRequestBolt12SemanticErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(ptr)) { + return new Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_OK(null, ptr); + } else { + return new Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_Err(null, ptr); + } + } + public class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_OK : Result_UnsignedInvoiceRequestBolt12SemanticErrorZ { + public readonly UnsignedInvoiceRequest res; + internal Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + long res = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_ok(ptr); + org.ldk.structs.UnsignedInvoiceRequest res_hu_conv = null; if (res < 0 || res > 4096) { res_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, res); } + if (res_hu_conv != null) { res_hu_conv.ptrs_to.AddLast(this); }; + this.res = res_hu_conv; + } + } + + public class Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_Err : Result_UnsignedInvoiceRequestBolt12SemanticErrorZ { + public readonly Bolt12SemanticError err; + internal Result_UnsignedInvoiceRequestBolt12SemanticErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the success state. + */ + public static Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ok(org.ldk.structs.UnsignedInvoiceRequest o) { + long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_ok(o.ptr); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(o); }; + return ret_hu_conv; + } + + /** + * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ in the error state. + */ + public static Result_UnsignedInvoiceRequestBolt12SemanticErrorZ err(Bolt12SemanticError e) { + long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + + internal long clone_ptr() { + long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public Result_UnsignedInvoiceRequestBolt12SemanticErrorZ clone() { + long ret = bindings.CResult_UnsignedInvoiceRequestBolt12SemanticErrorZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnsignedInvoiceRequestBolt12SemanticErrorZ ret_hu_conv = Result_UnsignedInvoiceRequestBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs index 608b212d..a1aa0e53 100644 --- a/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UnsignedNodeAnnouncementDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UnsignedNodeAnnouncementDecodeErrorZ : CommonBase { * Creates a new CResult_UnsignedNodeAnnouncementDecodeErrorZ in the success state. */ public static Result_UnsignedNodeAnnouncementDecodeErrorZ ok(org.ldk.structs.UnsignedNodeAnnouncement o) { - long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UnsignedNodeAnnouncementDecodeErrorZ ret_hu_conv = Result_UnsignedNodeAnnouncementDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs index e3f2c190..5efe4543 100644 --- a/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UntrustedStringDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UntrustedStringDecodeErrorZ : CommonBase { * Creates a new CResult_UntrustedStringDecodeErrorZ in the success state. */ public static Result_UntrustedStringDecodeErrorZ ok(org.ldk.structs.UntrustedString o) { - long ret = bindings.CResult_UntrustedStringDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UntrustedStringDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UntrustedStringDecodeErrorZ ret_hu_conv = Result_UntrustedStringDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs index 1dbd98fa..c1dbef0f 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateAddHTLCDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UpdateAddHTLCDecodeErrorZ : CommonBase { * Creates a new CResult_UpdateAddHTLCDecodeErrorZ in the success state. */ public static Result_UpdateAddHTLCDecodeErrorZ ok(org.ldk.structs.UpdateAddHTLC o) { - long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UpdateAddHTLCDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateAddHTLCDecodeErrorZ ret_hu_conv = Result_UpdateAddHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs index 0aaa9791..ec4bd624 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFailHTLCDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UpdateFailHTLCDecodeErrorZ : CommonBase { * Creates a new CResult_UpdateFailHTLCDecodeErrorZ in the success state. */ public static Result_UpdateFailHTLCDecodeErrorZ ok(org.ldk.structs.UpdateFailHTLC o) { - long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UpdateFailHTLCDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs index e9453266..4bc43bb3 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFailMalformedHTLCDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UpdateFailMalformedHTLCDecodeErrorZ : CommonBase { * Creates a new CResult_UpdateFailMalformedHTLCDecodeErrorZ in the success state. */ public static Result_UpdateFailMalformedHTLCDecodeErrorZ ok(org.ldk.structs.UpdateFailMalformedHTLC o) { - long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFailMalformedHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFailMalformedHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs index b7931952..5345c4d8 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFeeDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UpdateFeeDecodeErrorZ : CommonBase { * Creates a new CResult_UpdateFeeDecodeErrorZ in the success state. */ public static Result_UpdateFeeDecodeErrorZ ok(org.ldk.structs.UpdateFee o) { - long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UpdateFeeDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFeeDecodeErrorZ ret_hu_conv = Result_UpdateFeeDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs index d299d061..52c70d5e 100644 --- a/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_UpdateFulfillHTLCDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_UpdateFulfillHTLCDecodeErrorZ : CommonBase { * Creates a new CResult_UpdateFulfillHTLCDecodeErrorZ in the success state. */ public static Result_UpdateFulfillHTLCDecodeErrorZ ok(org.ldk.structs.UpdateFulfillHTLC o) { - long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_UpdateFulfillHTLCDecodeErrorZ ret_hu_conv = Result_UpdateFulfillHTLCDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs b/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs index b108f124..5604a78c 100644 --- a/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_VerifiedInvoiceRequestNoneZ.cs @@ -37,7 +37,7 @@ public class Result_VerifiedInvoiceRequestNoneZ : CommonBase { * Creates a new CResult_VerifiedInvoiceRequestNoneZ in the success state. */ public static Result_VerifiedInvoiceRequestNoneZ ok(org.ldk.structs.VerifiedInvoiceRequest o) { - long ret = bindings.CResult_VerifiedInvoiceRequestNoneZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_VerifiedInvoiceRequestNoneZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_VerifiedInvoiceRequestNoneZ ret_hu_conv = Result_VerifiedInvoiceRequestNoneZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs index 3d6e34bd..30e4e181 100644 --- a/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_WarningMessageDecodeErrorZ.cs @@ -42,7 +42,7 @@ public class Result_WarningMessageDecodeErrorZ : CommonBase { * Creates a new CResult_WarningMessageDecodeErrorZ in the success state. */ public static Result_WarningMessageDecodeErrorZ ok(org.ldk.structs.WarningMessage o) { - long ret = bindings.CResult_WarningMessageDecodeErrorZ_ok(o == null ? 0 : o.ptr); + long ret = bindings.CResult_WarningMessageDecodeErrorZ_ok(o.ptr); GC.KeepAlive(o); if (ret >= 0 && ret <= 4096) { return null; } Result_WarningMessageDecodeErrorZ ret_hu_conv = Result_WarningMessageDecodeErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs index ef9c4245..8ecbc7f8 100644 --- a/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_boolLightningErrorZ.cs @@ -50,7 +50,7 @@ public class Result_boolLightningErrorZ : CommonBase { * Creates a new CResult_boolLightningErrorZ in the error state. */ public static Result_boolLightningErrorZ err(org.ldk.structs.LightningError e) { - long ret = bindings.CResult_boolLightningErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_boolLightningErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_boolLightningErrorZ ret_hu_conv = Result_boolLightningErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs index 3af6cb1d..951b16fd 100644 --- a/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs +++ b/c_sharp/src/org/ldk/structs/Result_boolPeerHandleErrorZ.cs @@ -50,7 +50,7 @@ public class Result_boolPeerHandleErrorZ : CommonBase { * Creates a new CResult_boolPeerHandleErrorZ in the error state. */ public static Result_boolPeerHandleErrorZ err(org.ldk.structs.PeerHandleError e) { - long ret = bindings.CResult_boolPeerHandleErrorZ_err(e == null ? 0 : e.ptr); + long ret = bindings.CResult_boolPeerHandleErrorZ_err(e.ptr); GC.KeepAlive(e); if (ret >= 0 && ret <= 4096) { return null; } Result_boolPeerHandleErrorZ ret_hu_conv = Result_boolPeerHandleErrorZ.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/Result_u64ShortChannelIdErrorZ.cs b/c_sharp/src/org/ldk/structs/Result_u64ShortChannelIdErrorZ.cs new file mode 100644 index 00000000..d818dc63 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/Result_u64ShortChannelIdErrorZ.cs @@ -0,0 +1,67 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +public class Result_u64ShortChannelIdErrorZ : CommonBase { + Result_u64ShortChannelIdErrorZ(object _dummy, long ptr) : base(ptr) { } + ~Result_u64ShortChannelIdErrorZ() { + if (ptr != 0) { bindings.CResult_u64ShortChannelIdErrorZ_free(ptr); } + } + + internal static Result_u64ShortChannelIdErrorZ constr_from_ptr(long ptr) { + if (bindings.CResult_u64ShortChannelIdErrorZ_is_ok(ptr)) { + return new Result_u64ShortChannelIdErrorZ_OK(null, ptr); + } else { + return new Result_u64ShortChannelIdErrorZ_Err(null, ptr); + } + } + public class Result_u64ShortChannelIdErrorZ_OK : Result_u64ShortChannelIdErrorZ { + public readonly long res; + internal Result_u64ShortChannelIdErrorZ_OK(object _dummy, long ptr) : base(_dummy, ptr) { + this.res = bindings.CResult_u64ShortChannelIdErrorZ_get_ok(ptr); + } + } + + public class Result_u64ShortChannelIdErrorZ_Err : Result_u64ShortChannelIdErrorZ { + public readonly ShortChannelIdError err; + internal Result_u64ShortChannelIdErrorZ_Err(object _dummy, long ptr) : base(_dummy, ptr) { + this.err = bindings.CResult_u64ShortChannelIdErrorZ_get_err(ptr); + } + } + + /** + * Creates a new CResult_u64ShortChannelIdErrorZ in the success state. + */ + public static Result_u64ShortChannelIdErrorZ ok(long o) { + long ret = bindings.CResult_u64ShortChannelIdErrorZ_ok(o); + GC.KeepAlive(o); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u64ShortChannelIdErrorZ ret_hu_conv = Result_u64ShortChannelIdErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates a new CResult_u64ShortChannelIdErrorZ in the error state. + */ + public static Result_u64ShortChannelIdErrorZ err(ShortChannelIdError e) { + long ret = bindings.CResult_u64ShortChannelIdErrorZ_err(e); + GC.KeepAlive(e); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u64ShortChannelIdErrorZ ret_hu_conv = Result_u64ShortChannelIdErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Checks if the given object is currently in the success state + */ + public bool is_ok() { + bool ret = bindings.CResult_u64ShortChannelIdErrorZ_is_ok(this.ptr); + GC.KeepAlive(this); + return ret; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Retry.cs b/c_sharp/src/org/ldk/structs/Retry.cs index 9051ae53..b4745c37 100644 --- a/c_sharp/src/org/ldk/structs/Retry.cs +++ b/c_sharp/src/org/ldk/structs/Retry.cs @@ -85,7 +85,7 @@ public class Retry : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.Retry b) { - bool ret = bindings.Retry_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Retry_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/RevocationBasepoint.cs b/c_sharp/src/org/ldk/structs/RevocationBasepoint.cs index d2254409..3df76105 100644 --- a/c_sharp/src/org/ldk/structs/RevocationBasepoint.cs +++ b/c_sharp/src/org/ldk/structs/RevocationBasepoint.cs @@ -48,7 +48,7 @@ public class RevocationBasepoint : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RevocationBasepoint b) { - bool ret = bindings.RevocationBasepoint_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RevocationBasepoint_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RevocationKey.cs b/c_sharp/src/org/ldk/structs/RevocationKey.cs index 9fe538dc..f57166a7 100644 --- a/c_sharp/src/org/ldk/structs/RevocationKey.cs +++ b/c_sharp/src/org/ldk/structs/RevocationKey.cs @@ -54,7 +54,7 @@ public class RevocationKey : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RevocationKey b) { - bool ret = bindings.RevocationKey_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RevocationKey_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -107,7 +107,7 @@ public class RevocationKey : CommonBase { * [`chan_utils::derive_private_revocation_key`]: crate::ln::chan_utils::derive_private_revocation_key */ public static RevocationKey from_basepoint(org.ldk.structs.RevocationBasepoint countersignatory_basepoint, byte[] per_commitment_point) { - long ret = bindings.RevocationKey_from_basepoint(countersignatory_basepoint == null ? 0 : countersignatory_basepoint.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); + long ret = bindings.RevocationKey_from_basepoint(countersignatory_basepoint.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33))); GC.KeepAlive(countersignatory_basepoint); GC.KeepAlive(per_commitment_point); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/RevokeAndACK.cs b/c_sharp/src/org/ldk/structs/RevokeAndACK.cs index aa973810..e4ea40c7 100644 --- a/c_sharp/src/org/ldk/structs/RevokeAndACK.cs +++ b/c_sharp/src/org/ldk/structs/RevokeAndACK.cs @@ -20,21 +20,23 @@ public class RevokeAndACK : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.RevokeAndACK_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.RevokeAndACK_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.RevokeAndACK_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -80,14 +82,15 @@ public class RevokeAndACK : CommonBase { /** * Constructs a new RevokeAndACK given each field */ - public static RevokeAndACK of(byte[] channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) { - long ret = bindings.RevokeAndACK_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_secret_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_per_commitment_point_arg, 33))); + public static RevokeAndACK of(org.ldk.structs.ChannelId channel_id_arg, byte[] per_commitment_secret_arg, byte[] next_per_commitment_point_arg) { + long ret = bindings.RevokeAndACK_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_secret_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(next_per_commitment_point_arg, 33))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(per_commitment_secret_arg); GC.KeepAlive(next_per_commitment_point_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RevokeAndACK ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RevokeAndACK(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -127,7 +130,7 @@ public class RevokeAndACK : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RevokeAndACK b) { - bool ret = bindings.RevokeAndACK_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RevokeAndACK_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Route.cs b/c_sharp/src/org/ldk/structs/Route.cs index 666b6dfb..4e28b913 100644 --- a/c_sharp/src/org/ldk/structs/Route.cs +++ b/c_sharp/src/org/ldk/structs/Route.cs @@ -43,7 +43,7 @@ public class Route : CommonBase { * the same. */ public void set_paths(Path[] val) { - bindings.Route_set_paths(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_6 => val_conv_6 == null ? 0 : val_conv_6.ptr))); + bindings.Route_set_paths(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_6 => val_conv_6.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (Path val_conv_6 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_6); }; }; @@ -89,7 +89,7 @@ public class Route : CommonBase { * Note that route_params_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static Route of(Path[] paths_arg, org.ldk.structs.RouteParameters route_params_arg) { - long ret = bindings.Route_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(paths_arg, paths_arg_conv_6 => paths_arg_conv_6 == null ? 0 : paths_arg_conv_6.ptr)), route_params_arg == null ? 0 : route_params_arg.ptr); + long ret = bindings.Route_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(paths_arg, paths_arg_conv_6 => paths_arg_conv_6.ptr)), route_params_arg == null ? 0 : route_params_arg.ptr); GC.KeepAlive(paths_arg); GC.KeepAlive(route_params_arg); if (ret >= 0 && ret <= 4096) { return null; } @@ -136,7 +136,7 @@ public class Route : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Route b) { - bool ret = bindings.Route_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Route_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RouteHint.cs b/c_sharp/src/org/ldk/structs/RouteHint.cs index d98719d9..04597b7d 100644 --- a/c_sharp/src/org/ldk/structs/RouteHint.cs +++ b/c_sharp/src/org/ldk/structs/RouteHint.cs @@ -32,7 +32,7 @@ public class RouteHint : CommonBase { } public void set_a(RouteHintHop[] val) { - bindings.RouteHint_set_a(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_14 => val_conv_14 == null ? 0 : val_conv_14.ptr))); + bindings.RouteHint_set_a(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(val, val_conv_14 => val_conv_14.ptr))); GC.KeepAlive(this); GC.KeepAlive(val); foreach (RouteHintHop val_conv_14 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_14); }; }; @@ -42,7 +42,7 @@ public class RouteHint : CommonBase { * Constructs a new RouteHint given each field */ public static RouteHint of(RouteHintHop[] a_arg) { - long ret = bindings.RouteHint_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(a_arg, a_arg_conv_14 => a_arg_conv_14 == null ? 0 : a_arg_conv_14.ptr))); + long ret = bindings.RouteHint_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(a_arg, a_arg_conv_14 => a_arg_conv_14.ptr))); GC.KeepAlive(a_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.RouteHint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.RouteHint(null, ret); } @@ -87,7 +87,7 @@ public class RouteHint : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RouteHint b) { - bool ret = bindings.RouteHint_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RouteHint_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RouteHintHop.cs b/c_sharp/src/org/ldk/structs/RouteHintHop.cs index 74f637fa..54d00a4c 100644 --- a/c_sharp/src/org/ldk/structs/RouteHintHop.cs +++ b/c_sharp/src/org/ldk/structs/RouteHintHop.cs @@ -73,7 +73,7 @@ public class RouteHintHop : CommonBase { * The fees which must be paid to use this channel */ public void set_fees(org.ldk.structs.RoutingFees val) { - bindings.RouteHintHop_set_fees(this.ptr, val == null ? 0 : val.ptr); + bindings.RouteHintHop_set_fees(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -145,7 +145,7 @@ public class RouteHintHop : CommonBase { * Constructs a new RouteHintHop given each field */ public static RouteHintHop of(byte[] src_node_id_arg, long short_channel_id_arg, org.ldk.structs.RoutingFees fees_arg, short cltv_expiry_delta_arg, org.ldk.structs.Option_u64Z htlc_minimum_msat_arg, org.ldk.structs.Option_u64Z htlc_maximum_msat_arg) { - long ret = bindings.RouteHintHop_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(src_node_id_arg, 33)), short_channel_id_arg, fees_arg == null ? 0 : fees_arg.ptr, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); + long ret = bindings.RouteHintHop_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(src_node_id_arg, 33)), short_channel_id_arg, fees_arg.ptr, cltv_expiry_delta_arg, htlc_minimum_msat_arg.ptr, htlc_maximum_msat_arg.ptr); GC.KeepAlive(src_node_id_arg); GC.KeepAlive(short_channel_id_arg); GC.KeepAlive(fees_arg); @@ -197,7 +197,7 @@ public class RouteHintHop : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RouteHintHop b) { - bool ret = bindings.RouteHintHop_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RouteHintHop_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RouteHop.cs b/c_sharp/src/org/ldk/structs/RouteHop.cs index b15e8d41..e26de5bb 100644 --- a/c_sharp/src/org/ldk/structs/RouteHop.cs +++ b/c_sharp/src/org/ldk/structs/RouteHop.cs @@ -54,7 +54,7 @@ public class RouteHop : CommonBase { * amended to match the features present in the invoice this node generated. */ public void set_node_features(org.ldk.structs.NodeFeatures val) { - bindings.RouteHop_set_node_features(this.ptr, val == null ? 0 : val.ptr); + bindings.RouteHop_set_node_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -96,7 +96,7 @@ public class RouteHop : CommonBase { * to reach this node. */ public void set_channel_features(org.ldk.structs.ChannelFeatures val) { - bindings.RouteHop_set_channel_features(this.ptr, val == null ? 0 : val.ptr); + bindings.RouteHop_set_channel_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -194,7 +194,7 @@ public class RouteHop : CommonBase { * Constructs a new RouteHop given each field */ public static RouteHop of(byte[] pubkey_arg, org.ldk.structs.NodeFeatures node_features_arg, long short_channel_id_arg, org.ldk.structs.ChannelFeatures channel_features_arg, long fee_msat_arg, int cltv_expiry_delta_arg, bool maybe_announced_channel_arg) { - long ret = bindings.RouteHop_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey_arg, 33)), node_features_arg == null ? 0 : node_features_arg.ptr, short_channel_id_arg, channel_features_arg == null ? 0 : channel_features_arg.ptr, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_arg); + long ret = bindings.RouteHop_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey_arg, 33)), node_features_arg.ptr, short_channel_id_arg, channel_features_arg.ptr, fee_msat_arg, cltv_expiry_delta_arg, maybe_announced_channel_arg); GC.KeepAlive(pubkey_arg); GC.KeepAlive(node_features_arg); GC.KeepAlive(short_channel_id_arg); @@ -246,7 +246,7 @@ public class RouteHop : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RouteHop b) { - bool ret = bindings.RouteHop_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RouteHop_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RouteParameters.cs b/c_sharp/src/org/ldk/structs/RouteParameters.cs index de9e018a..48fb9758 100644 --- a/c_sharp/src/org/ldk/structs/RouteParameters.cs +++ b/c_sharp/src/org/ldk/structs/RouteParameters.cs @@ -33,7 +33,7 @@ public class RouteParameters : CommonBase { * The parameters of the failed payment path. */ public void set_payment_params(org.ldk.structs.PaymentParameters val) { - bindings.RouteParameters_set_payment_params(this.ptr, val == null ? 0 : val.ptr); + bindings.RouteParameters_set_payment_params(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -93,7 +93,7 @@ public class RouteParameters : CommonBase { * Constructs a new RouteParameters given each field */ public static RouteParameters of(org.ldk.structs.PaymentParameters payment_params_arg, long final_value_msat_arg, org.ldk.structs.Option_u64Z max_total_routing_fee_msat_arg) { - long ret = bindings.RouteParameters_new(payment_params_arg == null ? 0 : payment_params_arg.ptr, final_value_msat_arg, max_total_routing_fee_msat_arg.ptr); + long ret = bindings.RouteParameters_new(payment_params_arg.ptr, final_value_msat_arg, max_total_routing_fee_msat_arg.ptr); GC.KeepAlive(payment_params_arg); GC.KeepAlive(final_value_msat_arg); GC.KeepAlive(max_total_routing_fee_msat_arg); @@ -141,7 +141,7 @@ public class RouteParameters : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RouteParameters b) { - bool ret = bindings.RouteParameters_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RouteParameters_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -158,7 +158,7 @@ public class RouteParameters : CommonBase { * [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats */ public static RouteParameters from_payment_params_and_value(org.ldk.structs.PaymentParameters payment_params, long final_value_msat) { - long ret = bindings.RouteParameters_from_payment_params_and_value(payment_params == null ? 0 : payment_params.ptr, final_value_msat); + long ret = bindings.RouteParameters_from_payment_params_and_value(payment_params.ptr, final_value_msat); GC.KeepAlive(payment_params); GC.KeepAlive(final_value_msat); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/Router.cs b/c_sharp/src/org/ldk/structs/Router.cs index 4bce4122..bff09f0f 100644 --- a/c_sharp/src/org/ldk/structs/Router.cs +++ b/c_sharp/src/org/ldk/structs/Router.cs @@ -71,7 +71,7 @@ public class Router : CommonBase { if (_inflight_htlcs_hu_conv != null) { _inflight_htlcs_hu_conv.ptrs_to.AddLast(this); }; Result_RouteLightningErrorZ ret = arg.find_route(_payer_conv, _route_params_hu_conv, _first_hops_conv_16_arr, _inflight_htlcs_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long find_route_with_id(long _payer, long _route_params, long _first_hops, long _inflight_htlcs, long __payment_hash, long __payment_id) { @@ -94,7 +94,7 @@ public class Router : CommonBase { byte[] __payment_id_conv = InternalUtils.decodeUint8Array(__payment_id); Result_RouteLightningErrorZ ret = arg.find_route_with_id(_payer_conv, _route_params_hu_conv, _first_hops_conv_16_arr, _inflight_htlcs_hu_conv, __payment_hash_conv, __payment_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long create_blinded_payment_paths(long _recipient, long _first_hops, long _tlvs, long _amount_msats) { @@ -112,7 +112,7 @@ public class Router : CommonBase { if (_tlvs_hu_conv != null) { _tlvs_hu_conv.ptrs_to.AddLast(this); }; Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ ret = arg.create_blinded_payment_paths(_recipient_conv, _first_hops_conv_16_arr, _tlvs_hu_conv, _amount_msats); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -140,7 +140,7 @@ public class Router : CommonBase { * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_RouteLightningErrorZ find_route(byte[] payer, org.ldk.structs.RouteParameters route_params, ChannelDetails[] first_hops, org.ldk.structs.InFlightHtlcs inflight_htlcs) { - long ret = bindings.Router_find_route(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer, 33)), route_params == null ? 0 : route_params.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr)), inflight_htlcs == null ? 0 : inflight_htlcs.ptr); + long ret = bindings.Router_find_route(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer, 33)), route_params.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16.ptr)), inflight_htlcs.ptr); GC.KeepAlive(this); GC.KeepAlive(payer); GC.KeepAlive(route_params); @@ -166,7 +166,7 @@ public class Router : CommonBase { * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ public Result_RouteLightningErrorZ find_route_with_id(byte[] payer, org.ldk.structs.RouteParameters route_params, ChannelDetails[] first_hops, org.ldk.structs.InFlightHtlcs inflight_htlcs, byte[] _payment_hash, byte[] _payment_id) { - long ret = bindings.Router_find_route_with_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer, 33)), route_params == null ? 0 : route_params.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr)), inflight_htlcs == null ? 0 : inflight_htlcs.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(_payment_hash, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(_payment_id, 32))); + long ret = bindings.Router_find_route_with_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payer, 33)), route_params.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16.ptr)), inflight_htlcs.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(_payment_hash, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(_payment_id, 32))); GC.KeepAlive(this); GC.KeepAlive(payer); GC.KeepAlive(route_params); @@ -188,7 +188,7 @@ public class Router : CommonBase { * given in `tlvs`. */ public Result_CVec_C2Tuple_BlindedPayInfoBlindedPathZZNoneZ create_blinded_payment_paths(byte[] recipient, ChannelDetails[] first_hops, org.ldk.structs.ReceiveTlvs tlvs, long amount_msats) { - long ret = bindings.Router_create_blinded_payment_paths(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr)), tlvs == null ? 0 : tlvs.ptr, amount_msats); + long ret = bindings.Router_create_blinded_payment_paths(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(recipient, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16.ptr)), tlvs.ptr, amount_msats); GC.KeepAlive(this); GC.KeepAlive(recipient); GC.KeepAlive(first_hops); diff --git a/c_sharp/src/org/ldk/structs/RoutingFees.cs b/c_sharp/src/org/ldk/structs/RoutingFees.cs index d296f285..5cf7bbc2 100644 --- a/c_sharp/src/org/ldk/structs/RoutingFees.cs +++ b/c_sharp/src/org/ldk/structs/RoutingFees.cs @@ -72,7 +72,7 @@ public class RoutingFees : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.RoutingFees b) { - bool ret = bindings.RoutingFees_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.RoutingFees_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs b/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs index 278d0881..5b645f23 100644 --- a/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs +++ b/c_sharp/src/org/ldk/structs/RoutingMessageHandler.cs @@ -111,27 +111,27 @@ public class RoutingMessageHandler : CommonBase { org.ldk.structs.NodeAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.NodeAnnouncement(null, _msg); } Result_boolLightningErrorZ ret = arg.handle_node_announcement(_msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long handle_channel_announcement(long _msg) { org.ldk.structs.ChannelAnnouncement _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.ChannelAnnouncement(null, _msg); } Result_boolLightningErrorZ ret = arg.handle_channel_announcement(_msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long handle_channel_update(long _msg) { org.ldk.structs.ChannelUpdate _msg_hu_conv = null; if (_msg < 0 || _msg > 4096) { _msg_hu_conv = new org.ldk.structs.ChannelUpdate(null, _msg); } Result_boolLightningErrorZ ret = arg.handle_channel_update(_msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long get_next_channel_announcement(long _starting_point) { Option_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = arg.get_next_channel_announcement(_starting_point); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } @@ -148,7 +148,7 @@ public class RoutingMessageHandler : CommonBase { org.ldk.structs.Init _init_hu_conv = null; if (_init < 0 || _init > 4096) { _init_hu_conv = new org.ldk.structs.Init(null, _init); } Result_NoneNoneZ ret = arg.peer_connected(_their_node_id_conv, _init_hu_conv, _inbound); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long handle_reply_channel_range(long _their_node_id, long _msg) { @@ -157,7 +157,7 @@ public class RoutingMessageHandler : CommonBase { if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); }; Result_NoneLightningErrorZ ret = arg.handle_reply_channel_range(_their_node_id_conv, _msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long handle_reply_short_channel_ids_end(long _their_node_id, long _msg) { @@ -166,7 +166,7 @@ public class RoutingMessageHandler : CommonBase { if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); }; Result_NoneLightningErrorZ ret = arg.handle_reply_short_channel_ids_end(_their_node_id_conv, _msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long handle_query_channel_range(long _their_node_id, long _msg) { @@ -175,7 +175,7 @@ public class RoutingMessageHandler : CommonBase { if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); }; Result_NoneLightningErrorZ ret = arg.handle_query_channel_range(_their_node_id_conv, _msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long handle_query_short_channel_ids(long _their_node_id, long _msg) { @@ -184,7 +184,7 @@ public class RoutingMessageHandler : CommonBase { if (_msg_hu_conv != null) { _msg_hu_conv.ptrs_to.AddLast(this); }; Result_NoneLightningErrorZ ret = arg.handle_query_short_channel_ids(_their_node_id_conv, _msg_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public bool processing_queue_high() { @@ -195,14 +195,14 @@ public class RoutingMessageHandler : CommonBase { public long provided_node_features() { NodeFeatures ret = arg.provided_node_features(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long provided_init_features(long _their_node_id) { byte[] _their_node_id_conv = InternalUtils.decodeUint8Array(_their_node_id); InitFeatures ret = arg.provided_init_features(_their_node_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } @@ -226,7 +226,7 @@ public class RoutingMessageHandler : CommonBase { * `false` or returning an `Err` otherwise. */ public Result_boolLightningErrorZ handle_node_announcement(org.ldk.structs.NodeAnnouncement msg) { - long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_node_announcement(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -240,7 +240,7 @@ public class RoutingMessageHandler : CommonBase { * or returning an `Err` otherwise. */ public Result_boolLightningErrorZ handle_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { - long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_channel_announcement(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -254,7 +254,7 @@ public class RoutingMessageHandler : CommonBase { * `false` or returning an `Err` otherwise. */ public Result_boolLightningErrorZ handle_channel_update(org.ldk.structs.ChannelUpdate msg) { - long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_channel_update(this.ptr, msg.ptr); GC.KeepAlive(this); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } @@ -308,7 +308,7 @@ public class RoutingMessageHandler : CommonBase { * message handlers may still wish to communicate with this peer. */ public Result_NoneNoneZ peer_connected(byte[] their_node_id, org.ldk.structs.Init init, bool inbound) { - long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), init == null ? 0 : init.ptr, inbound); + long ret = bindings.RoutingMessageHandler_peer_connected(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), init.ptr, inbound); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(init); @@ -325,7 +325,7 @@ public class RoutingMessageHandler : CommonBase { * replies to a single query. */ public Result_NoneLightningErrorZ handle_reply_channel_range(byte[] their_node_id, org.ldk.structs.ReplyChannelRange msg) { - long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_reply_channel_range(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -342,7 +342,7 @@ public class RoutingMessageHandler : CommonBase { * gossip messages. */ public Result_NoneLightningErrorZ handle_reply_short_channel_ids_end(byte[] their_node_id, org.ldk.structs.ReplyShortChannelIdsEnd msg) { - long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_reply_short_channel_ids_end(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -357,7 +357,7 @@ public class RoutingMessageHandler : CommonBase { * for the requested range of blocks. */ public Result_NoneLightningErrorZ handle_query_channel_range(byte[] their_node_id, org.ldk.structs.QueryChannelRange msg) { - long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_query_channel_range(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); @@ -372,7 +372,7 @@ public class RoutingMessageHandler : CommonBase { * list of `short_channel_id`s. */ public Result_NoneLightningErrorZ handle_query_short_channel_ids(byte[] their_node_id, org.ldk.structs.QueryShortChannelIds msg) { - long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg == null ? 0 : msg.ptr); + long ret = bindings.RoutingMessageHandler_handle_query_short_channel_ids(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(their_node_id, 33)), msg.ptr); GC.KeepAlive(this); GC.KeepAlive(their_node_id); GC.KeepAlive(msg); diff --git a/c_sharp/src/org/ldk/structs/ScoreLookUp.cs b/c_sharp/src/org/ldk/structs/ScoreLookUp.cs index aefbc190..7406d650 100644 --- a/c_sharp/src/org/ldk/structs/ScoreLookUp.cs +++ b/c_sharp/src/org/ldk/structs/ScoreLookUp.cs @@ -77,7 +77,7 @@ public class ScoreLookUp : CommonBase { * Thus, implementations should be overflow-safe. */ public long channel_penalty_msat(org.ldk.structs.CandidateRouteHop candidate, org.ldk.structs.ChannelUsage usage, org.ldk.structs.ProbabilisticScoringFeeParameters score_params) { - long ret = bindings.ScoreLookUp_channel_penalty_msat(this.ptr, candidate == null ? 0 : candidate.ptr, usage == null ? 0 : usage.ptr, score_params == null ? 0 : score_params.ptr); + long ret = bindings.ScoreLookUp_channel_penalty_msat(this.ptr, candidate.ptr, usage.ptr, score_params.ptr); GC.KeepAlive(this); GC.KeepAlive(candidate); GC.KeepAlive(usage); diff --git a/c_sharp/src/org/ldk/structs/ScoreUpdate.cs b/c_sharp/src/org/ldk/structs/ScoreUpdate.cs index 5785e40d..85e59ecb 100644 --- a/c_sharp/src/org/ldk/structs/ScoreUpdate.cs +++ b/c_sharp/src/org/ldk/structs/ScoreUpdate.cs @@ -89,7 +89,7 @@ public class ScoreUpdate : CommonBase { * Handles updating channel penalties after failing to route through a channel. */ public void payment_path_failed(org.ldk.structs.Path path, long short_channel_id, long duration_since_epoch) { - bindings.ScoreUpdate_payment_path_failed(this.ptr, path == null ? 0 : path.ptr, short_channel_id, duration_since_epoch); + bindings.ScoreUpdate_payment_path_failed(this.ptr, path.ptr, short_channel_id, duration_since_epoch); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(short_channel_id); @@ -101,7 +101,7 @@ public class ScoreUpdate : CommonBase { * Handles updating channel penalties after successfully routing along a path. */ public void payment_path_successful(org.ldk.structs.Path path, long duration_since_epoch) { - bindings.ScoreUpdate_payment_path_successful(this.ptr, path == null ? 0 : path.ptr, duration_since_epoch); + bindings.ScoreUpdate_payment_path_successful(this.ptr, path.ptr, duration_since_epoch); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(duration_since_epoch); @@ -112,7 +112,7 @@ public class ScoreUpdate : CommonBase { * Handles updating channel penalties after a probe over the given path failed. */ public void probe_failed(org.ldk.structs.Path path, long short_channel_id, long duration_since_epoch) { - bindings.ScoreUpdate_probe_failed(this.ptr, path == null ? 0 : path.ptr, short_channel_id, duration_since_epoch); + bindings.ScoreUpdate_probe_failed(this.ptr, path.ptr, short_channel_id, duration_since_epoch); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(short_channel_id); @@ -124,7 +124,7 @@ public class ScoreUpdate : CommonBase { * Handles updating channel penalties after a probe over the given path succeeded. */ public void probe_successful(org.ldk.structs.Path path, long duration_since_epoch) { - bindings.ScoreUpdate_probe_successful(this.ptr, path == null ? 0 : path.ptr, duration_since_epoch); + bindings.ScoreUpdate_probe_successful(this.ptr, path.ptr, duration_since_epoch); GC.KeepAlive(this); GC.KeepAlive(path); GC.KeepAlive(duration_since_epoch); diff --git a/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs b/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs index add28b36..423181e5 100644 --- a/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs +++ b/c_sharp/src/org/ldk/structs/ScorerAccountingForInFlightHtlcs.cs @@ -24,7 +24,7 @@ public class ScorerAccountingForInFlightHtlcs : CommonBase { * Initialize a new `ScorerAccountingForInFlightHtlcs`. */ public static ScorerAccountingForInFlightHtlcs of(org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.InFlightHtlcs inflight_htlcs) { - long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs == null ? 0 : inflight_htlcs.ptr); + long ret = bindings.ScorerAccountingForInFlightHtlcs_new(scorer.ptr, inflight_htlcs.ptr); GC.KeepAlive(scorer); GC.KeepAlive(inflight_htlcs); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/SendError.cs b/c_sharp/src/org/ldk/structs/SendError.cs index c20659b3..dc9cad1b 100644 --- a/c_sharp/src/org/ldk/structs/SendError.cs +++ b/c_sharp/src/org/ldk/structs/SendError.cs @@ -27,7 +27,8 @@ public class SendError : CommonBase { case 5: return new SendError_InvalidMessage(ptr); case 6: return new SendError_BufferFull(ptr); case 7: return new SendError_GetNodeIdFailed(ptr); - case 8: return new SendError_BlindedPathAdvanceFailed(ptr); + case 8: return new SendError_UnresolvedIntroductionNode(ptr); + case 9: return new SendError_BlindedPathAdvanceFailed(ptr); default: throw new ArgumentException("Impossible enum variant"); } @@ -79,6 +80,11 @@ public class SendError : CommonBase { internal SendError_GetNodeIdFailed(long ptr) : base(null, ptr) { } } + /** A SendError of type UnresolvedIntroductionNode */ + public class SendError_UnresolvedIntroductionNode : SendError { + internal SendError_UnresolvedIntroductionNode(long ptr) : base(null, ptr) { + } + } /** A SendError of type BlindedPathAdvanceFailed */ public class SendError_BlindedPathAdvanceFailed : SendError { internal SendError_BlindedPathAdvanceFailed(long ptr) : base(null, ptr) { @@ -192,6 +198,17 @@ public class SendError : CommonBase { return ret_hu_conv; } + /** + * Utility method to constructs a new UnresolvedIntroductionNode-variant SendError + */ + public static SendError unresolved_introduction_node() { + long ret = bindings.SendError_unresolved_introduction_node(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SendError ret_hu_conv = org.ldk.structs.SendError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + /** * Utility method to constructs a new BlindedPathAdvanceFailed-variant SendError */ @@ -203,12 +220,24 @@ public class SendError : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the SendError. + */ + public long hash() { + long ret = bindings.SendError_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Checks if two SendErrors contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.SendError b) { - bool ret = bindings.SendError_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SendError_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/SendSuccess.cs b/c_sharp/src/org/ldk/structs/SendSuccess.cs index 4ddb4c96..b7e4ee9d 100644 --- a/c_sharp/src/org/ldk/structs/SendSuccess.cs +++ b/c_sharp/src/org/ldk/structs/SendSuccess.cs @@ -81,12 +81,24 @@ public class SendSuccess : CommonBase { return ret_hu_conv; } + /** + * Generates a non-cryptographic 64-bit hash of the SendSuccess. + */ + public long hash() { + long ret = bindings.SendSuccess_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } /** * Checks if two SendSuccesss contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.SendSuccess b) { - bool ret = bindings.SendSuccess_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SendSuccess_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/Sha256.cs b/c_sharp/src/org/ldk/structs/Sha256.cs index 48cbe06e..6c8a415b 100644 --- a/c_sharp/src/org/ldk/structs/Sha256.cs +++ b/c_sharp/src/org/ldk/structs/Sha256.cs @@ -51,7 +51,7 @@ public class Sha256 : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Sha256 b) { - bool ret = bindings.Sha256_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Sha256_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Shutdown.cs b/c_sharp/src/org/ldk/structs/Shutdown.cs index 142d8fdf..f9c46f70 100644 --- a/c_sharp/src/org/ldk/structs/Shutdown.cs +++ b/c_sharp/src/org/ldk/structs/Shutdown.cs @@ -20,21 +20,23 @@ public class Shutdown : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.Shutdown_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.Shutdown_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.Shutdown_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -64,13 +66,14 @@ public class Shutdown : CommonBase { /** * Constructs a new Shutdown given each field */ - public static Shutdown of(byte[] channel_id_arg, byte[] scriptpubkey_arg) { - long ret = bindings.Shutdown_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(scriptpubkey_arg)); + public static Shutdown of(org.ldk.structs.ChannelId channel_id_arg, byte[] scriptpubkey_arg) { + long ret = bindings.Shutdown_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(scriptpubkey_arg)); GC.KeepAlive(channel_id_arg); GC.KeepAlive(scriptpubkey_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Shutdown ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Shutdown(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -110,7 +113,7 @@ public class Shutdown : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Shutdown b) { - bool ret = bindings.Shutdown_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Shutdown_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ShutdownScript.cs b/c_sharp/src/org/ldk/structs/ShutdownScript.cs index cb9709f2..485cb08b 100644 --- a/c_sharp/src/org/ldk/structs/ShutdownScript.cs +++ b/c_sharp/src/org/ldk/structs/ShutdownScript.cs @@ -41,7 +41,7 @@ public class ShutdownScript : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.ShutdownScript b) { - bool ret = bindings.ShutdownScript_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.ShutdownScript_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -147,7 +147,7 @@ public class ShutdownScript : CommonBase { * Specifically, checks for compliance with feature `option_shutdown_anysegwit`. */ public bool is_compatible(org.ldk.structs.InitFeatures features) { - bool ret = bindings.ShutdownScript_is_compatible(this.ptr, features == null ? 0 : features.ptr); + bool ret = bindings.ShutdownScript_is_compatible(this.ptr, features.ptr); GC.KeepAlive(this); GC.KeepAlive(features); if (this != null) { this.ptrs_to.AddLast(features); }; diff --git a/c_sharp/src/org/ldk/structs/SignBolt12InvoiceFn.cs b/c_sharp/src/org/ldk/structs/SignBolt12InvoiceFn.cs new file mode 100644 index 00000000..de4f1f4f --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SignBolt12InvoiceFn.cs @@ -0,0 +1,70 @@ + +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + + +/** An implementation of SignBolt12InvoiceFn */ +public interface SignBolt12InvoiceFnInterface { + /**Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream. + */ + Result_SchnorrSignatureNoneZ sign_invoice(UnsignedBolt12Invoice message); +} + +/** + * A function for signing an [`UnsignedBolt12Invoice`]. + */ +public class SignBolt12InvoiceFn : CommonBase { + internal bindings.LDKSignBolt12InvoiceFn bindings_instance; + internal long instance_idx; + + internal SignBolt12InvoiceFn(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + ~SignBolt12InvoiceFn() { + if (ptr != 0) { bindings.SignBolt12InvoiceFn_free(ptr); } + } + + private class LDKSignBolt12InvoiceFnHolder { internal SignBolt12InvoiceFn held; } + private class LDKSignBolt12InvoiceFnImpl : bindings.LDKSignBolt12InvoiceFn { + internal LDKSignBolt12InvoiceFnImpl(SignBolt12InvoiceFnInterface arg, LDKSignBolt12InvoiceFnHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private SignBolt12InvoiceFnInterface arg; + private LDKSignBolt12InvoiceFnHolder impl_holder; + public long sign_invoice(long _message) { + org.ldk.structs.UnsignedBolt12Invoice _message_hu_conv = null; if (_message < 0 || _message > 4096) { _message_hu_conv = new org.ldk.structs.UnsignedBolt12Invoice(null, _message); } + Result_SchnorrSignatureNoneZ ret = arg.sign_invoice(_message_hu_conv); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; + } + } + + /** Creates a new instance of SignBolt12InvoiceFn from a given implementation */ + public static SignBolt12InvoiceFn new_impl(SignBolt12InvoiceFnInterface arg) { + LDKSignBolt12InvoiceFnHolder impl_holder = new LDKSignBolt12InvoiceFnHolder(); + LDKSignBolt12InvoiceFnImpl impl = new LDKSignBolt12InvoiceFnImpl(arg, impl_holder); + long[] ptr_idx = bindings.LDKSignBolt12InvoiceFn_new(impl); + + impl_holder.held = new SignBolt12InvoiceFn(null, ptr_idx[0]); + impl_holder.held.instance_idx = ptr_idx[1]; + impl_holder.held.bindings_instance = impl; + return impl_holder.held; + } + + /** + * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream. + */ + public Result_SchnorrSignatureNoneZ sign_invoice(org.ldk.structs.UnsignedBolt12Invoice message) { + long ret = bindings.SignBolt12InvoiceFn_sign_invoice(this.ptr, message.ptr); + GC.KeepAlive(this); + GC.KeepAlive(message); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SchnorrSignatureNoneZ ret_hu_conv = Result_SchnorrSignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(message); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/SignError.cs b/c_sharp/src/org/ldk/structs/SignError.cs new file mode 100644 index 00000000..53eec263 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SignError.cs @@ -0,0 +1,81 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * Error when signing messages. + */ +public class SignError : CommonBase { + protected SignError(object _dummy, long ptr) : base(ptr) { } + ~SignError() { + if (ptr != 0) { bindings.SignError_free(ptr); } + } + + internal static SignError constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKSignError_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new SignError_Signing(ptr); + case 1: return new SignError_Verification(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A SignError of type Signing */ + public class SignError_Signing : SignError { + internal SignError_Signing(long ptr) : base(null, ptr) { + } + } + /** A SignError of type Verification */ + public class SignError_Verification : SignError { + public Secp256k1Error verification; + internal SignError_Verification(long ptr) : base(null, ptr) { + this.verification = bindings.LDKSignError_Verification_get_verification(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.SignError_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the SignError + */ + public SignError clone() { + long ret = bindings.SignError_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SignError ret_hu_conv = org.ldk.structs.SignError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Signing-variant SignError + */ + public static SignError signing() { + long ret = bindings.SignError_signing(); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SignError ret_hu_conv = org.ldk.structs.SignError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Verification-variant SignError + */ + public static SignError verification(Secp256k1Error a) { + long ret = bindings.SignError_verification(a); + GC.KeepAlive(a); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SignError ret_hu_conv = org.ldk.structs.SignError.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/SignInvoiceRequestFn.cs b/c_sharp/src/org/ldk/structs/SignInvoiceRequestFn.cs new file mode 100644 index 00000000..712c5f08 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SignInvoiceRequestFn.cs @@ -0,0 +1,70 @@ + +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + + +/** An implementation of SignInvoiceRequestFn */ +public interface SignInvoiceRequestFnInterface { + /**Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream. + */ + Result_SchnorrSignatureNoneZ sign_invoice_request(UnsignedInvoiceRequest message); +} + +/** + * A function for signing an [`UnsignedInvoiceRequest`]. + */ +public class SignInvoiceRequestFn : CommonBase { + internal bindings.LDKSignInvoiceRequestFn bindings_instance; + internal long instance_idx; + + internal SignInvoiceRequestFn(object _dummy, long ptr) : base(ptr) { bindings_instance = null; } + ~SignInvoiceRequestFn() { + if (ptr != 0) { bindings.SignInvoiceRequestFn_free(ptr); } + } + + private class LDKSignInvoiceRequestFnHolder { internal SignInvoiceRequestFn held; } + private class LDKSignInvoiceRequestFnImpl : bindings.LDKSignInvoiceRequestFn { + internal LDKSignInvoiceRequestFnImpl(SignInvoiceRequestFnInterface arg, LDKSignInvoiceRequestFnHolder impl_holder) { this.arg = arg; this.impl_holder = impl_holder; } + private SignInvoiceRequestFnInterface arg; + private LDKSignInvoiceRequestFnHolder impl_holder; + public long sign_invoice_request(long _message) { + org.ldk.structs.UnsignedInvoiceRequest _message_hu_conv = null; if (_message < 0 || _message > 4096) { _message_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, _message); } + Result_SchnorrSignatureNoneZ ret = arg.sign_invoice_request(_message_hu_conv); + GC.KeepAlive(arg); + long result = ret.clone_ptr(); + return result; + } + } + + /** Creates a new instance of SignInvoiceRequestFn from a given implementation */ + public static SignInvoiceRequestFn new_impl(SignInvoiceRequestFnInterface arg) { + LDKSignInvoiceRequestFnHolder impl_holder = new LDKSignInvoiceRequestFnHolder(); + LDKSignInvoiceRequestFnImpl impl = new LDKSignInvoiceRequestFnImpl(arg, impl_holder); + long[] ptr_idx = bindings.LDKSignInvoiceRequestFn_new(impl); + + impl_holder.held = new SignInvoiceRequestFn(null, ptr_idx[0]); + impl_holder.held.instance_idx = ptr_idx[1]; + impl_holder.held.bindings_instance = impl; + return impl_holder.held; + } + + /** + * Signs a [`TaggedHash`] computed over the merkle root of `message`'s TLV stream. + */ + public Result_SchnorrSignatureNoneZ sign_invoice_request(org.ldk.structs.UnsignedInvoiceRequest message) { + long ret = bindings.SignInvoiceRequestFn_sign_invoice_request(this.ptr, message.ptr); + GC.KeepAlive(this); + GC.KeepAlive(message); + if (ret >= 0 && ret <= 4096) { return null; } + Result_SchnorrSignatureNoneZ ret_hu_conv = Result_SchnorrSignatureNoneZ.constr_from_ptr(ret); + if (this != null) { this.ptrs_to.AddLast(message); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/SignOrCreationError.cs b/c_sharp/src/org/ldk/structs/SignOrCreationError.cs index f030d2dd..84f64733 100644 --- a/c_sharp/src/org/ldk/structs/SignOrCreationError.cs +++ b/c_sharp/src/org/ldk/structs/SignOrCreationError.cs @@ -83,7 +83,7 @@ public class SignOrCreationError : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.SignOrCreationError b) { - bool ret = bindings.SignOrCreationError_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SignOrCreationError_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs b/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs index ad14e6b2..d0811627 100644 --- a/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs +++ b/c_sharp/src/org/ldk/structs/SignedRawBolt11Invoice.cs @@ -25,7 +25,7 @@ public class SignedRawBolt11Invoice : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.SignedRawBolt11Invoice b) { - bool ret = bindings.SignedRawBolt11Invoice_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SignedRawBolt11Invoice_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/SignerProvider.cs b/c_sharp/src/org/ldk/structs/SignerProvider.cs index 440e60ac..053f60cd 100644 --- a/c_sharp/src/org/ldk/structs/SignerProvider.cs +++ b/c_sharp/src/org/ldk/structs/SignerProvider.cs @@ -98,20 +98,20 @@ public class SignerProvider : CommonBase { byte[] _reader_conv = InternalUtils.decodeUint8Array(_reader); Result_WriteableEcdsaChannelSignerDecodeErrorZ ret = arg.read_chan_signer(_reader_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long get_destination_script(long _channel_keys_id) { byte[] _channel_keys_id_conv = InternalUtils.decodeUint8Array(_channel_keys_id); Result_CVec_u8ZNoneZ ret = arg.get_destination_script(_channel_keys_id_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long get_shutdown_scriptpubkey() { Result_ShutdownScriptNoneZ ret = arg.get_shutdown_scriptpubkey(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } diff --git a/c_sharp/src/org/ldk/structs/Sleeper.cs b/c_sharp/src/org/ldk/structs/Sleeper.cs index ae04a4b0..d086beb1 100644 --- a/c_sharp/src/org/ldk/structs/Sleeper.cs +++ b/c_sharp/src/org/ldk/structs/Sleeper.cs @@ -20,7 +20,7 @@ public class Sleeper : CommonBase { * Constructs a new sleeper from one future, allowing blocking on it. */ public static Sleeper from_single_future(org.ldk.structs.Future future) { - long ret = bindings.Sleeper_from_single_future(future == null ? 0 : future.ptr); + long ret = bindings.Sleeper_from_single_future(future.ptr); GC.KeepAlive(future); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Sleeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sleeper(null, ret); } @@ -33,7 +33,7 @@ public class Sleeper : CommonBase { * Constructs a new sleeper from two futures, allowing blocking on both at once. */ public static Sleeper from_two_futures(org.ldk.structs.Future fut_a, org.ldk.structs.Future fut_b) { - long ret = bindings.Sleeper_from_two_futures(fut_a == null ? 0 : fut_a.ptr, fut_b == null ? 0 : fut_b.ptr); + long ret = bindings.Sleeper_from_two_futures(fut_a.ptr, fut_b.ptr); GC.KeepAlive(fut_a); GC.KeepAlive(fut_b); if (ret >= 0 && ret <= 4096) { return null; } @@ -48,12 +48,20 @@ public class Sleeper : CommonBase { * Constructs a new sleeper on many futures, allowing blocking on all at once. */ public static Sleeper of(Future[] futures) { - long ret = bindings.Sleeper_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(futures, futures_conv_8 => futures_conv_8 == null ? 0 : futures_conv_8.ptr))); + long ret = bindings.Sleeper_new(InternalUtils.encodeUint64Array(InternalUtils.mapArray(futures, futures_conv_8 => futures_conv_8.ptr))); GC.KeepAlive(futures); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Sleeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Sleeper(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - foreach (Future futures_conv_8 in futures) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(futures_conv_8); }; }; + foreach (Future futures_conv_8 in futures) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(futures_conv_8); }; + // Due to rust's strict-ownership memory model, in some cases we need to "move" + // an object to pass exclusive ownership to the function being called. + // In most cases, we avoid ret_hu_conv being visible in GC'd languages by cloning the object + // at the FFI layer, creating a new object which Rust can claim ownership of + // However, in some cases (eg here), there is no way to clone an object, and thus + // we actually have to pass full ownership to Rust. + // Thus, after ret_hu_conv call, futures_conv_8 is reset to null and is now a dummy object. + futures_conv_8.ptr = 0;; }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/SocketAddress.cs b/c_sharp/src/org/ldk/structs/SocketAddress.cs index 096f79f6..88754d7d 100644 --- a/c_sharp/src/org/ldk/structs/SocketAddress.cs +++ b/c_sharp/src/org/ldk/structs/SocketAddress.cs @@ -190,7 +190,7 @@ public class SocketAddress : CommonBase { * Utility method to constructs a new Hostname-variant SocketAddress */ public static SocketAddress hostname(org.ldk.structs.Hostname hostname, short port) { - long ret = bindings.SocketAddress_hostname(hostname == null ? 0 : hostname.ptr, port); + long ret = bindings.SocketAddress_hostname(hostname.ptr, port); GC.KeepAlive(hostname); GC.KeepAlive(port); if (ret >= 0 && ret <= 4096) { return null; } @@ -217,7 +217,7 @@ public class SocketAddress : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.SocketAddress b) { - bool ret = bindings.SocketAddress_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SocketAddress_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs index b6ffa08e..b5c67001 100644 --- a/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/SpendableOutputDescriptor.cs @@ -111,7 +111,7 @@ public class SpendableOutputDescriptor : CommonBase { * Utility method to constructs a new StaticOutput-variant SpendableOutputDescriptor */ public static SpendableOutputDescriptor static_output(org.ldk.structs.OutPoint outpoint, org.ldk.structs.TxOut output, byte[] channel_keys_id) { - long ret = bindings.SpendableOutputDescriptor_static_output(outpoint == null ? 0 : outpoint.ptr, output.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id, 32))); + long ret = bindings.SpendableOutputDescriptor_static_output(outpoint.ptr, output.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id, 32))); GC.KeepAlive(outpoint); GC.KeepAlive(output); GC.KeepAlive(channel_keys_id); @@ -126,7 +126,7 @@ public class SpendableOutputDescriptor : CommonBase { * Utility method to constructs a new DelayedPaymentOutput-variant SpendableOutputDescriptor */ public static SpendableOutputDescriptor delayed_payment_output(org.ldk.structs.DelayedPaymentOutputDescriptor a) { - long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a == null ? 0 : a.ptr); + long ret = bindings.SpendableOutputDescriptor_delayed_payment_output(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret); @@ -139,7 +139,7 @@ public class SpendableOutputDescriptor : CommonBase { * Utility method to constructs a new StaticPaymentOutput-variant SpendableOutputDescriptor */ public static SpendableOutputDescriptor static_payment_output(org.ldk.structs.StaticPaymentOutputDescriptor a) { - long ret = bindings.SpendableOutputDescriptor_static_payment_output(a == null ? 0 : a.ptr); + long ret = bindings.SpendableOutputDescriptor_static_payment_output(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret); @@ -165,7 +165,7 @@ public class SpendableOutputDescriptor : CommonBase { * This ignores pointers and is_owned flags and looks at the values in fields. */ public bool eq(org.ldk.structs.SpendableOutputDescriptor b) { - bool ret = bindings.SpendableOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SpendableOutputDescriptor_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); return ret; diff --git a/c_sharp/src/org/ldk/structs/SpendingDelay.cs b/c_sharp/src/org/ldk/structs/SpendingDelay.cs new file mode 100644 index 00000000..fe3c1054 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/SpendingDelay.cs @@ -0,0 +1,91 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + +/** + * A `enum` signalling to the [`OutputSweeper`] that it should delay spending an output until a + * future block height is reached. + */ +public class SpendingDelay : CommonBase { + protected SpendingDelay(object _dummy, long ptr) : base(ptr) { } + ~SpendingDelay() { + if (ptr != 0) { bindings.SpendingDelay_free(ptr); } + } + + internal static SpendingDelay constr_from_ptr(long ptr) { + long raw_ty = bindings.LDKSpendingDelay_ty_from_ptr(ptr); + switch (raw_ty) { + case 0: return new SpendingDelay_Relative(ptr); + case 1: return new SpendingDelay_Absolute(ptr); + default: + throw new ArgumentException("Impossible enum variant"); + } + } + + /** A SpendingDelay of type Relative */ + public class SpendingDelay_Relative : SpendingDelay { + /** + * The number of blocks until we'll generate and broadcast the spending transaction. + */ + public int num_blocks; + internal SpendingDelay_Relative(long ptr) : base(null, ptr) { + this.num_blocks = bindings.LDKSpendingDelay_Relative_get_num_blocks(ptr); + } + } + /** A SpendingDelay of type Absolute */ + public class SpendingDelay_Absolute : SpendingDelay { + /** + * The height at which we'll generate and broadcast the spending transaction. + */ + public int height; + internal SpendingDelay_Absolute(long ptr) : base(null, ptr) { + this.height = bindings.LDKSpendingDelay_Absolute_get_height(ptr); + } + } + internal long clone_ptr() { + long ret = bindings.SpendingDelay_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the SpendingDelay + */ + public SpendingDelay clone() { + long ret = bindings.SpendingDelay_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpendingDelay ret_hu_conv = org.ldk.structs.SpendingDelay.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Relative-variant SpendingDelay + */ + public static SpendingDelay relative(int num_blocks) { + long ret = bindings.SpendingDelay_relative(num_blocks); + GC.KeepAlive(num_blocks); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpendingDelay ret_hu_conv = org.ldk.structs.SpendingDelay.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + /** + * Utility method to constructs a new Absolute-variant SpendingDelay + */ + public static SpendingDelay absolute(int height) { + long ret = bindings.SpendingDelay_absolute(height); + GC.KeepAlive(height); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpendingDelay ret_hu_conv = org.ldk.structs.SpendingDelay.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/Splice.cs b/c_sharp/src/org/ldk/structs/Splice.cs index b5912ea9..3cc1c468 100644 --- a/c_sharp/src/org/ldk/structs/Splice.cs +++ b/c_sharp/src/org/ldk/structs/Splice.cs @@ -18,21 +18,23 @@ public class Splice : CommonBase { /** * The channel ID where splicing is intended */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.Splice_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID where splicing is intended */ - public void set_channel_id(byte[] val) { - bindings.Splice_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.Splice_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -134,8 +136,8 @@ public class Splice : CommonBase { /** * Constructs a new Splice given each field */ - public static Splice of(byte[] channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg) { - long ret = bindings.Splice_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33))); + public static Splice of(org.ldk.structs.ChannelId channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, int funding_feerate_perkw_arg, int locktime_arg, byte[] funding_pubkey_arg) { + long ret = bindings.Splice_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, funding_feerate_perkw_arg, locktime_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(chain_hash_arg); GC.KeepAlive(relative_satoshis_arg); @@ -145,6 +147,7 @@ public class Splice : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Splice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Splice(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -172,7 +175,7 @@ public class Splice : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Splice b) { - bool ret = bindings.Splice_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Splice_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/SpliceAck.cs b/c_sharp/src/org/ldk/structs/SpliceAck.cs index cfd8f5ab..9c557d26 100644 --- a/c_sharp/src/org/ldk/structs/SpliceAck.cs +++ b/c_sharp/src/org/ldk/structs/SpliceAck.cs @@ -18,21 +18,23 @@ public class SpliceAck : CommonBase { /** * The channel ID where splicing is intended */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.SpliceAck_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID where splicing is intended */ - public void set_channel_id(byte[] val) { - bindings.SpliceAck_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.SpliceAck_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -98,8 +100,8 @@ public class SpliceAck : CommonBase { /** * Constructs a new SpliceAck given each field */ - public static SpliceAck of(byte[] channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, byte[] funding_pubkey_arg) { - long ret = bindings.SpliceAck_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33))); + public static SpliceAck of(org.ldk.structs.ChannelId channel_id_arg, byte[] chain_hash_arg, long relative_satoshis_arg, byte[] funding_pubkey_arg) { + long ret = bindings.SpliceAck_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), relative_satoshis_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(funding_pubkey_arg, 33))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(chain_hash_arg); GC.KeepAlive(relative_satoshis_arg); @@ -107,6 +109,7 @@ public class SpliceAck : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpliceAck ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceAck(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -134,7 +137,7 @@ public class SpliceAck : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.SpliceAck b) { - bool ret = bindings.SpliceAck_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SpliceAck_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/SpliceLocked.cs b/c_sharp/src/org/ldk/structs/SpliceLocked.cs index 17bbcd12..ac5d31fb 100644 --- a/c_sharp/src/org/ldk/structs/SpliceLocked.cs +++ b/c_sharp/src/org/ldk/structs/SpliceLocked.cs @@ -18,32 +18,35 @@ public class SpliceLocked : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.SpliceLocked_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.SpliceLocked_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.SpliceLocked_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** * Constructs a new SpliceLocked given each field */ - public static SpliceLocked of(byte[] channel_id_arg) { - long ret = bindings.SpliceLocked_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32))); + public static SpliceLocked of(org.ldk.structs.ChannelId channel_id_arg) { + long ret = bindings.SpliceLocked_new(channel_id_arg.ptr); GC.KeepAlive(channel_id_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.SpliceLocked ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.SpliceLocked(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -71,7 +74,7 @@ public class SpliceLocked : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.SpliceLocked b) { - bool ret = bindings.SpliceLocked_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.SpliceLocked_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs b/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs index e1bf7359..31145844 100644 --- a/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs +++ b/c_sharp/src/org/ldk/structs/StaticPaymentOutputDescriptor.cs @@ -33,7 +33,7 @@ public class StaticPaymentOutputDescriptor : CommonBase { * The outpoint which is spendable. */ public void set_outpoint(org.ldk.structs.OutPoint val) { - bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + bindings.StaticPaymentOutputDescriptor_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -137,7 +137,7 @@ public class StaticPaymentOutputDescriptor : CommonBase { * Note that channel_transaction_parameters_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static StaticPaymentOutputDescriptor of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut output_arg, byte[] channel_keys_id_arg, long channel_value_satoshis_arg, org.ldk.structs.ChannelTransactionParameters channel_transaction_parameters_arg) { - long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, output_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg, channel_transaction_parameters_arg == null ? 0 : channel_transaction_parameters_arg.ptr); + long ret = bindings.StaticPaymentOutputDescriptor_new(outpoint_arg.ptr, output_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_keys_id_arg, 32)), channel_value_satoshis_arg, channel_transaction_parameters_arg == null ? 0 : channel_transaction_parameters_arg.ptr); GC.KeepAlive(outpoint_arg); GC.KeepAlive(output_arg); GC.KeepAlive(channel_keys_id_arg); @@ -187,7 +187,7 @@ public class StaticPaymentOutputDescriptor : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.StaticPaymentOutputDescriptor b) { - bool ret = bindings.StaticPaymentOutputDescriptor_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.StaticPaymentOutputDescriptor_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Stfu.cs b/c_sharp/src/org/ldk/structs/Stfu.cs index f3746870..5b7cd65e 100644 --- a/c_sharp/src/org/ldk/structs/Stfu.cs +++ b/c_sharp/src/org/ldk/structs/Stfu.cs @@ -18,21 +18,23 @@ public class Stfu : CommonBase { /** * The channel ID where quiescence is intended */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.Stfu_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID where quiescence is intended */ - public void set_channel_id(byte[] val) { - bindings.Stfu_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.Stfu_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -56,13 +58,14 @@ public class Stfu : CommonBase { /** * Constructs a new Stfu given each field */ - public static Stfu of(byte[] channel_id_arg, byte initiator_arg) { - long ret = bindings.Stfu_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), initiator_arg); + public static Stfu of(org.ldk.structs.ChannelId channel_id_arg, byte initiator_arg) { + long ret = bindings.Stfu_new(channel_id_arg.ptr, initiator_arg); GC.KeepAlive(channel_id_arg); GC.KeepAlive(initiator_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.Stfu ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Stfu(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -90,7 +93,7 @@ public class Stfu : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Stfu b) { - bool ret = bindings.Stfu_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Stfu_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs index c7be6380..d0524d17 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ.cs @@ -74,7 +74,7 @@ public class ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ : CommonB * Creates a new C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ from the contained elements. */ public static ThreeTuple_ChannelAnnouncementChannelUpdateChannelUpdateZ of(org.ldk.structs.ChannelAnnouncement a, org.ldk.structs.ChannelUpdate b, org.ldk.structs.ChannelUpdate c) { - long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a == null ? 0 : a.ptr, b == null ? 0 : b.ptr, c == null ? 0 : c.ptr); + long ret = bindings.C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a.ptr, b.ptr, c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs index 8882a93f..b17f5a7c 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_OffersMessageDestinationBlindedPathZ.cs @@ -74,7 +74,7 @@ public class ThreeTuple_OffersMessageDestinationBlindedPathZ : CommonBase { * Creates a new C3Tuple_OffersMessageDestinationBlindedPathZ from the contained elements. */ public static ThreeTuple_OffersMessageDestinationBlindedPathZ of(org.ldk.structs.OffersMessage a, org.ldk.structs.Destination b, org.ldk.structs.BlindedPath c) { - long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_new(a.ptr, b.ptr, c == null ? 0 : c.ptr); + long ret = bindings.C3Tuple_OffersMessageDestinationBlindedPathZ_new(a.ptr, b.ptr, c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs index 5365c866..d9fc379e 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_OnionMessageContentsDestinationBlindedPathZ.cs @@ -74,7 +74,7 @@ public class ThreeTuple_OnionMessageContentsDestinationBlindedPathZ : CommonBase * Creates a new C3Tuple_OnionMessageContentsDestinationBlindedPathZ from the contained elements. */ public static ThreeTuple_OnionMessageContentsDestinationBlindedPathZ of(org.ldk.structs.OnionMessageContents a, org.ldk.structs.Destination b, org.ldk.structs.BlindedPath c) { - long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a.ptr, b.ptr, c == null ? 0 : c.ptr); + long ret = bindings.C3Tuple_OnionMessageContentsDestinationBlindedPathZ_new(a.ptr, b.ptr, c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs deleted file mode 100644 index c747b159..00000000 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ.cs +++ /dev/null @@ -1,96 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A Tuple - */ -public class ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ : CommonBase { - internal ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(object _dummy, long ptr) : base(ptr) { } - ~ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ() { - if (ptr != 0) { bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(ptr); } - } - - /** - * - */ - public OutPoint get_a() { - long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * - */ - public MonitorEvent[] get_b() { - long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_14_len = InternalUtils.getArrayLength(ret); - MonitorEvent[] ret_conv_14_arr = new MonitorEvent[ret_conv_14_len]; - for (int o = 0; o < ret_conv_14_len; o++) { - long ret_conv_14 = InternalUtils.getU64ArrayElem(ret, o); - org.ldk.structs.MonitorEvent ret_conv_14_hu_conv = org.ldk.structs.MonitorEvent.constr_from_ptr(ret_conv_14); - if (ret_conv_14_hu_conv != null) { ret_conv_14_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_14_arr[o] = ret_conv_14_hu_conv; - } - bindings.free_buffer(ret); - return ret_conv_14_arr; - } - - /** - * - */ - public byte[] get_c() { - long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - internal long clone_ptr() { - long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ clone() { - long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ ret_hu_conv = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ from the contained elements. - */ - public static ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ of(org.ldk.structs.OutPoint a, MonitorEvent[] b, byte[] c) { - long ret = bindings.C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a == null ? 0 : a.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_14 => b_conv_14.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(c, 33))); - GC.KeepAlive(a); - GC.KeepAlive(b); - GC.KeepAlive(c); - if (ret >= 0 && ret <= 4096) { return null; } - ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ ret_hu_conv = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; - foreach (MonitorEvent b_conv_14 in b) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_conv_14); }; }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.cs index 9b770b00..bc304560 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ.cs @@ -73,7 +73,7 @@ public class ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ : Com * Creates a new C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ from the contained elements. */ public static ThreeTuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ of(byte[] a, org.ldk.structs.OnionMessage b, org.ldk.structs.Option_CVec_SocketAddressZZ c) { - long ret = bindings.C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33)), b == null ? 0 : b.ptr, c.ptr); + long ret = bindings.C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33)), b.ptr, c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs index d0569209..cfc2eab8 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ.cs @@ -73,7 +73,7 @@ public class ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ : CommonBas * Creates a new C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ from the contained elements. */ public static ThreeTuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ of(org.ldk.structs.RawBolt11Invoice a, byte[] b, org.ldk.structs.Bolt11InvoiceSignature c) { - long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a == null ? 0 : a.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(b, 32)), c == null ? 0 : c.ptr); + long ret = bindings.C3Tuple_RawBolt11Invoice_u832Bolt11InvoiceSignatureZ_new(a.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(b, 32)), c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs b/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs index 7ca3d489..ea5e4a99 100644 --- a/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs +++ b/c_sharp/src/org/ldk/structs/ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ.cs @@ -73,7 +73,7 @@ public class ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ : Com * Creates a new C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ from the contained elements. */ public static ThreeTuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ of(byte[] a, org.ldk.structs.RecipientOnionFields b, org.ldk.structs.RouteParameters c) { - long ret = bindings.C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), b == null ? 0 : b.ptr, c == null ? 0 : c.ptr); + long ret = bindings.C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), b.ptr, c.ptr); GC.KeepAlive(a); GC.KeepAlive(b); GC.KeepAlive(c); diff --git a/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs b/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs new file mode 100644 index 00000000..0ad49eec --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TrackedSpendableOutput.cs @@ -0,0 +1,179 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * The state of a spendable output currently tracked by an [`OutputSweeper`]. + */ +public class TrackedSpendableOutput : CommonBase { + internal TrackedSpendableOutput(object _dummy, long ptr) : base(ptr) { } + ~TrackedSpendableOutput() { + if (ptr != 0) { bindings.TrackedSpendableOutput_free(ptr); } + } + + /** + * The tracked output descriptor. + */ + public SpendableOutputDescriptor get_descriptor() { + long ret = bindings.TrackedSpendableOutput_get_descriptor(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.SpendableOutputDescriptor ret_hu_conv = org.ldk.structs.SpendableOutputDescriptor.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The tracked output descriptor. + */ + public void set_descriptor(org.ldk.structs.SpendableOutputDescriptor val) { + bindings.TrackedSpendableOutput_set_descriptor(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The channel this output belongs to. + * + * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`] + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public ChannelId get_channel_id() { + long ret = bindings.TrackedSpendableOutput_get_channel_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The channel this output belongs to. + * + * Will be `None` if no `channel_id` was given to [`OutputSweeper::track_spendable_outputs`] + * + * Note that val (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TrackedSpendableOutput_set_channel_id(this.ptr, val == null ? 0 : val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * The current status of the output spend. + */ + public OutputSpendStatus get_status() { + long ret = bindings.TrackedSpendableOutput_get_status(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSpendStatus ret_hu_conv = org.ldk.structs.OutputSpendStatus.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The current status of the output spend. + */ + public void set_status(org.ldk.structs.OutputSpendStatus val) { + bindings.TrackedSpendableOutput_set_status(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + + /** + * Constructs a new TrackedSpendableOutput given each field + * + * Note that channel_id_arg (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static TrackedSpendableOutput of(org.ldk.structs.SpendableOutputDescriptor descriptor_arg, org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.OutputSpendStatus status_arg) { + long ret = bindings.TrackedSpendableOutput_new(descriptor_arg.ptr, channel_id_arg == null ? 0 : channel_id_arg.ptr, status_arg.ptr); + GC.KeepAlive(descriptor_arg); + GC.KeepAlive(channel_id_arg); + GC.KeepAlive(status_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TrackedSpendableOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrackedSpendableOutput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(descriptor_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(status_arg); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TrackedSpendableOutput_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TrackedSpendableOutput + */ + public TrackedSpendableOutput clone() { + long ret = bindings.TrackedSpendableOutput_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TrackedSpendableOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrackedSpendableOutput(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two TrackedSpendableOutputs contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TrackedSpendableOutput b) { + bool ret = bindings.TrackedSpendableOutput_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TrackedSpendableOutput)) return false; + return this.eq((TrackedSpendableOutput)o); + } + /** + * Returns whether the output is spent in the given transaction. + */ + public bool is_spent_in(byte[] tx) { + bool ret = bindings.TrackedSpendableOutput_is_spent_in(this.ptr, InternalUtils.encodeUint8Array(tx)); + GC.KeepAlive(this); + GC.KeepAlive(tx); + return ret; + } + + /** + * Serialize the TrackedSpendableOutput object into a byte array which can be read by TrackedSpendableOutput_read + */ + public byte[] write() { + long ret = bindings.TrackedSpendableOutput_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a TrackedSpendableOutput from a byte array, created by TrackedSpendableOutput_write + */ + public static Result_TrackedSpendableOutputDecodeErrorZ read(byte[] ser) { + long ret = bindings.TrackedSpendableOutput_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_TrackedSpendableOutputDecodeErrorZ ret_hu_conv = Result_TrackedSpendableOutputDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TrampolineOnionPacket.cs b/c_sharp/src/org/ldk/structs/TrampolineOnionPacket.cs new file mode 100644 index 00000000..c4e05753 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TrampolineOnionPacket.cs @@ -0,0 +1,172 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * BOLT 4 onion packet including hop data for the next peer. + */ +public class TrampolineOnionPacket : CommonBase { + internal TrampolineOnionPacket(object _dummy, long ptr) : base(ptr) { } + ~TrampolineOnionPacket() { + if (ptr != 0) { bindings.TrampolineOnionPacket_free(ptr); } + } + + /** + * Bolt 04 version number + */ + public byte get_version() { + byte ret = bindings.TrampolineOnionPacket_get_version(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Bolt 04 version number + */ + public void set_version(byte val) { + bindings.TrampolineOnionPacket_set_version(this.ptr, val); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data + */ + public byte[] get_public_key() { + long ret = bindings.TrampolineOnionPacket_get_public_key(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * A random sepc256k1 point, used to build the ECDH shared secret to decrypt hop_data + */ + public void set_public_key(byte[] val) { + bindings.TrampolineOnionPacket_set_public_key(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 33))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Encrypted payload for the next hop + * + * Returns a copy of the field. + */ + public byte[] get_hop_data() { + long ret = bindings.TrampolineOnionPacket_get_hop_data(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Encrypted payload for the next hop + */ + public void set_hop_data(byte[] val) { + bindings.TrampolineOnionPacket_set_hop_data(this.ptr, InternalUtils.encodeUint8Array(val)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * HMAC to verify the integrity of hop_data + */ + public byte[] get_hmac() { + long ret = bindings.TrampolineOnionPacket_get_hmac(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * HMAC to verify the integrity of hop_data + */ + public void set_hmac(byte[] val) { + bindings.TrampolineOnionPacket_set_hmac(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new TrampolineOnionPacket given each field + */ + public static TrampolineOnionPacket of(byte version_arg, byte[] public_key_arg, byte[] hop_data_arg, byte[] hmac_arg) { + long ret = bindings.TrampolineOnionPacket_new(version_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(public_key_arg, 33)), InternalUtils.encodeUint8Array(hop_data_arg), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(hmac_arg, 32))); + GC.KeepAlive(version_arg); + GC.KeepAlive(public_key_arg); + GC.KeepAlive(hop_data_arg); + GC.KeepAlive(hmac_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TrampolineOnionPacket ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrampolineOnionPacket(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.TrampolineOnionPacket_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the TrampolineOnionPacket + */ + public TrampolineOnionPacket clone() { + long ret = bindings.TrampolineOnionPacket_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.TrampolineOnionPacket ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TrampolineOnionPacket(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Generates a non-cryptographic 64-bit hash of the TrampolineOnionPacket. + */ + public long hash() { + long ret = bindings.TrampolineOnionPacket_hash(this.ptr); + GC.KeepAlive(this); + return ret; + } + + public override int GetHashCode() { + return (int)this.hash(); + } + /** + * Checks if two TrampolineOnionPackets contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.TrampolineOnionPacket b) { + bool ret = bindings.TrampolineOnionPacket_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is TrampolineOnionPacket)) return false; + return this.eq((TrampolineOnionPacket)o); + } + /** + * Serialize the TrampolineOnionPacket object into a byte array which can be read by TrampolineOnionPacket_read + */ + public byte[] write() { + long ret = bindings.TrampolineOnionPacket_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs index bf3c9ecc..9e0974ca 100644 --- a/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs +++ b/c_sharp/src/org/ldk/structs/TransactionU16LenLimited.cs @@ -54,7 +54,7 @@ public class TransactionU16LenLimited : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TransactionU16LenLimited b) { - bool ret = bindings.TransactionU16LenLimited_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TransactionU16LenLimited_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -89,6 +89,17 @@ public class TransactionU16LenLimited : CommonBase { return ret_conv; } + /** + * Returns a reference to the contained `Transaction` + */ + public byte[] as_transaction() { + long ret = bindings.TransactionU16LenLimited_as_transaction(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Serialize the TransactionU16LenLimited object into a byte array which can be read by TransactionU16LenLimited_read */ diff --git a/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs b/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs index 0f81c2fe..49e8f999 100644 --- a/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs +++ b/c_sharp/src/org/ldk/structs/TrustedCommitmentTransaction.cs @@ -76,7 +76,7 @@ public class TrustedCommitmentTransaction : CommonBase { * This function is only valid in the holder commitment context, it always uses EcdsaSighashType::All. */ public Result_CVec_ECDSASignatureZNoneZ get_htlc_sigs(byte[] htlc_base_key, org.ldk.structs.DirectedChannelTransactionParameters channel_parameters, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_base_key, 32)), channel_parameters == null ? 0 : channel_parameters.ptr, entropy_source.ptr); + long ret = bindings.TrustedCommitmentTransaction_get_htlc_sigs(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(htlc_base_key, 32)), channel_parameters.ptr, entropy_source.ptr); GC.KeepAlive(this); GC.KeepAlive(htlc_base_key); GC.KeepAlive(channel_parameters); diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.cs new file mode 100644 index 00000000..4ddd8b99 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_BestBlockOutputSweeperZ.cs @@ -0,0 +1,72 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_BestBlockOutputSweeperZ : CommonBase { + internal TwoTuple_BestBlockOutputSweeperZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_BestBlockOutputSweeperZ() { + if (ptr != 0) { bindings.C2Tuple_BestBlockOutputSweeperZ_free(ptr); } + } + + /** + * + */ + public BestBlock get_a() { + long ret = bindings.C2Tuple_BestBlockOutputSweeperZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.BestBlock ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.BestBlock(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public OutputSweeper get_b() { + long ret = bindings.C2Tuple_BestBlockOutputSweeperZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutputSweeper ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutputSweeper(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_BestBlockOutputSweeperZ from the contained elements. + */ + public static TwoTuple_BestBlockOutputSweeperZ of(org.ldk.structs.BestBlock a, BestBlock b_best_block, BroadcasterInterface b_broadcaster, FeeEstimator b_fee_estimator, Option_FilterZ b_chain_data_source, OutputSpender b_output_spender, ChangeDestinationSource b_change_destination_source, KVStore b_kv_store, Logger b_logger) { + long ret = bindings.C2Tuple_BestBlockOutputSweeperZ_new(a.ptr, bindings.OutputSweeper_new(b_best_block.ptr, b_broadcaster.ptr, b_fee_estimator.ptr, b_chain_data_source.ptr, b_output_spender.ptr, b_change_destination_source.ptr, b_kv_store.ptr, b_logger.ptr)); + GC.KeepAlive(a); + GC.KeepAlive(b_best_block); + GC.KeepAlive(b_broadcaster); + GC.KeepAlive(b_fee_estimator); + GC.KeepAlive(b_chain_data_source); + GC.KeepAlive(b_output_spender); + GC.KeepAlive(b_change_destination_source); + GC.KeepAlive(b_kv_store); + GC.KeepAlive(b_logger); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_BestBlockOutputSweeperZ ret_hu_conv = new TwoTuple_BestBlockOutputSweeperZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_best_block); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_broadcaster); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_fee_estimator); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_chain_data_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_output_spender); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_change_destination_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_kv_store); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b_logger); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs index 45bce528..a6a31bcc 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_BlindedPayInfoBlindedPathZ.cs @@ -62,7 +62,7 @@ public class TwoTuple_BlindedPayInfoBlindedPathZ : CommonBase { * Creates a new C2Tuple_BlindedPayInfoBlindedPathZ from the contained elements. */ public static TwoTuple_BlindedPayInfoBlindedPathZ of(org.ldk.structs.BlindedPayInfo a, org.ldk.structs.BlindedPath b) { - long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_new(a == null ? 0 : a.ptr, b == null ? 0 : b.ptr); + long ret = bindings.C2Tuple_BlindedPayInfoBlindedPathZ_new(a.ptr, b.ptr); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.cs new file mode 100644 index 00000000..8bccf7a6 --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ChannelIdPublicKeyZ.cs @@ -0,0 +1,75 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_ChannelIdPublicKeyZ : CommonBase { + internal TwoTuple_ChannelIdPublicKeyZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_ChannelIdPublicKeyZ() { + if (ptr != 0) { bindings.C2Tuple_ChannelIdPublicKeyZ_free(ptr); } + } + + /** + * + */ + public ChannelId get_a() { + long ret = bindings.C2Tuple_ChannelIdPublicKeyZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public byte[] get_b() { + long ret = bindings.C2Tuple_ChannelIdPublicKeyZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_ChannelIdPublicKeyZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_ChannelIdPublicKeyZ clone() { + long ret = bindings.C2Tuple_ChannelIdPublicKeyZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_ChannelIdPublicKeyZ ret_hu_conv = new TwoTuple_ChannelIdPublicKeyZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_ChannelIdPublicKeyZ from the contained elements. + */ + public static TwoTuple_ChannelIdPublicKeyZ of(org.ldk.structs.ChannelId a, byte[] b) { + long ret = bindings.C2Tuple_ChannelIdPublicKeyZ_new(a.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(b, 33))); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_ChannelIdPublicKeyZ ret_hu_conv = new TwoTuple_ChannelIdPublicKeyZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.cs index 55915cda..6d6594f2 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_MonitorUpdateIdZZ.cs @@ -69,7 +69,7 @@ public class TwoTuple_OutPointCVec_MonitorUpdateIdZZ : CommonBase { * Creates a new C2Tuple_OutPointCVec_MonitorUpdateIdZZ from the contained elements. */ public static TwoTuple_OutPointCVec_MonitorUpdateIdZZ of(org.ldk.structs.OutPoint a, MonitorUpdateId[] b) { - long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a == null ? 0 : a.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_17 => b_conv_17 == null ? 0 : b_conv_17.ptr))); + long ret = bindings.C2Tuple_OutPointCVec_MonitorUpdateIdZZ_new(a.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_17 => b_conv_17.ptr))); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs index 38f599a0..4a9d7c14 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointCVec_u8ZZ.cs @@ -61,7 +61,7 @@ public class TwoTuple_OutPointCVec_u8ZZ : CommonBase { * Creates a new C2Tuple_OutPointCVec_u8ZZ from the contained elements. */ public static TwoTuple_OutPointCVec_u8ZZ of(org.ldk.structs.OutPoint a, byte[] b) { - long ret = bindings.C2Tuple_OutPointCVec_u8ZZ_new(a == null ? 0 : a.ptr, InternalUtils.encodeUint8Array(b)); + long ret = bindings.C2Tuple_OutPointCVec_u8ZZ_new(a.ptr, InternalUtils.encodeUint8Array(b)); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_OutPointChannelIdZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointChannelIdZ.cs new file mode 100644 index 00000000..a13da11c --- /dev/null +++ b/c_sharp/src/org/ldk/structs/TwoTuple_OutPointChannelIdZ.cs @@ -0,0 +1,77 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * A Tuple + */ +public class TwoTuple_OutPointChannelIdZ : CommonBase { + internal TwoTuple_OutPointChannelIdZ(object _dummy, long ptr) : base(ptr) { } + ~TwoTuple_OutPointChannelIdZ() { + if (ptr != 0) { bindings.C2Tuple_OutPointChannelIdZ_free(ptr); } + } + + /** + * + */ + public OutPoint get_a() { + long ret = bindings.C2Tuple_OutPointChannelIdZ_get_a(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OutPoint ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OutPoint(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * + */ + public ChannelId get_b() { + long ret = bindings.C2Tuple_OutPointChannelIdZ_get_b(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + internal long clone_ptr() { + long ret = bindings.C2Tuple_OutPointChannelIdZ_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a new tuple which has the same data as `orig` + * but with all dynamically-allocated buffers duplicated in new buffers. + */ + public TwoTuple_OutPointChannelIdZ clone() { + long ret = bindings.C2Tuple_OutPointChannelIdZ_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointChannelIdZ ret_hu_conv = new TwoTuple_OutPointChannelIdZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Creates a new C2Tuple_OutPointChannelIdZ from the contained elements. + */ + public static TwoTuple_OutPointChannelIdZ of(org.ldk.structs.OutPoint a, org.ldk.structs.ChannelId b) { + long ret = bindings.C2Tuple_OutPointChannelIdZ_new(a.ptr, b.ptr); + GC.KeepAlive(a); + GC.KeepAlive(b); + if (ret >= 0 && ret <= 4096) { return null; } + TwoTuple_OutPointChannelIdZ ret_hu_conv = new TwoTuple_OutPointChannelIdZ(null, ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCOption_SocketAddressZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCOption_SocketAddressZZ.cs deleted file mode 100644 index 213544aa..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_PublicKeyCOption_SocketAddressZZ.cs +++ /dev/null @@ -1,75 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A Tuple - */ -public class TwoTuple_PublicKeyCOption_SocketAddressZZ : CommonBase { - internal TwoTuple_PublicKeyCOption_SocketAddressZZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_PublicKeyCOption_SocketAddressZZ() { - if (ptr != 0) { bindings.C2Tuple_PublicKeyCOption_SocketAddressZZ_free(ptr); } - } - - /** - * - */ - public byte[] get_a() { - long ret = bindings.C2Tuple_PublicKeyCOption_SocketAddressZZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * - */ - public Option_SocketAddressZ get_b() { - long ret = bindings.C2Tuple_PublicKeyCOption_SocketAddressZZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Option_SocketAddressZ ret_hu_conv = org.ldk.structs.Option_SocketAddressZ.constr_from_ptr(ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_PublicKeyCOption_SocketAddressZZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_PublicKeyCOption_SocketAddressZZ clone() { - long ret = bindings.C2Tuple_PublicKeyCOption_SocketAddressZZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_PublicKeyCOption_SocketAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCOption_SocketAddressZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_PublicKeyCOption_SocketAddressZZ from the contained elements. - */ - public static TwoTuple_PublicKeyCOption_SocketAddressZZ of(byte[] a, org.ldk.structs.Option_SocketAddressZ b) { - long ret = bindings.C2Tuple_PublicKeyCOption_SocketAddressZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 33)), b.ptr); - GC.KeepAlive(a); - GC.KeepAlive(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_PublicKeyCOption_SocketAddressZZ ret_hu_conv = new TwoTuple_PublicKeyCOption_SocketAddressZZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(b); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.cs index 7eddc362..8f5cb8fe 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ.cs @@ -68,7 +68,7 @@ public class TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ : CommonBase { * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ from the contained elements. */ public static TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ of(byte[] a, TwoTuple_u32CVec_u8ZZ[] b) { - long ret = bindings.C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_23 => b_conv_23 != null ? b_conv_23.ptr : 0))); + long ret = bindings.C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32CVec_u8ZZZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_23 => b_conv_23.ptr))); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.cs index 60bdb6bc..0955df5a 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ.cs @@ -68,7 +68,7 @@ public class TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ : CommonBase { * Creates a new C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ from the contained elements. */ public static TwoTuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ of(byte[] a, TwoTuple_u32TxOutZ[] b) { - long ret = bindings.C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_20 => b_conv_20 != null ? b_conv_20.ptr : 0))); + long ret = bindings.C2Tuple_ThirtyTwoBytesCVec_C2Tuple_u32TxOutZZZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(b, b_conv_20 => b_conv_20.ptr))); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs index 9a04bb1c..9429f8ae 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelManagerZ.cs @@ -42,7 +42,7 @@ public class TwoTuple_ThirtyTwoBytesChannelManagerZ : CommonBase { * Creates a new C2Tuple_ThirtyTwoBytesChannelManagerZ from the contained elements. */ public static TwoTuple_ThirtyTwoBytesChannelManagerZ of(byte[] a, FeeEstimator b_fee_est, Watch b_chain_monitor, BroadcasterInterface b_tx_broadcaster, Router b_router, Logger b_logger, EntropySource b_entropy_source, NodeSigner b_node_signer, SignerProvider b_signer_provider, UserConfig b_config, ChainParameters b_params, int b_current_timestamp) { - long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config == null ? 0 : b_config.ptr, b_params == null ? 0 : b_params.ptr, b_current_timestamp)); + long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), bindings.ChannelManager_new(b_fee_est.ptr, b_chain_monitor.ptr, b_tx_broadcaster.ptr, b_router.ptr, b_logger.ptr, b_entropy_source.ptr, b_node_signer.ptr, b_signer_provider.ptr, b_config.ptr, b_params.ptr, b_current_timestamp)); GC.KeepAlive(a); GC.KeepAlive(b_fee_est); GC.KeepAlive(b_chain_monitor); diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs index 822a90b9..33876e00 100644 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs +++ b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesChannelMonitorZ.cs @@ -61,7 +61,7 @@ public class TwoTuple_ThirtyTwoBytesChannelMonitorZ : CommonBase { * Creates a new C2Tuple_ThirtyTwoBytesChannelMonitorZ from the contained elements. */ public static TwoTuple_ThirtyTwoBytesChannelMonitorZ of(byte[] a, org.ldk.structs.ChannelMonitor b) { - long ret = bindings.C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), b == null ? 0 : b.ptr); + long ret = bindings.C2Tuple_ThirtyTwoBytesChannelMonitorZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), b.ptr); GC.KeepAlive(a); GC.KeepAlive(b); if (ret >= 0 && ret <= 4096) { return null; } diff --git a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesPublicKeyZ.cs b/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesPublicKeyZ.cs deleted file mode 100644 index b7874e4a..00000000 --- a/c_sharp/src/org/ldk/structs/TwoTuple_ThirtyTwoBytesPublicKeyZ.cs +++ /dev/null @@ -1,73 +0,0 @@ -using org.ldk.impl; -using org.ldk.enums; -using org.ldk.util; -using System; - -namespace org { namespace ldk { namespace structs { - - -/** - * A Tuple - */ -public class TwoTuple_ThirtyTwoBytesPublicKeyZ : CommonBase { - internal TwoTuple_ThirtyTwoBytesPublicKeyZ(object _dummy, long ptr) : base(ptr) { } - ~TwoTuple_ThirtyTwoBytesPublicKeyZ() { - if (ptr != 0) { bindings.C2Tuple_ThirtyTwoBytesPublicKeyZ_free(ptr); } - } - - /** - * - */ - public byte[] get_a() { - long ret = bindings.C2Tuple_ThirtyTwoBytesPublicKeyZ_get_a(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - /** - * - */ - public byte[] get_b() { - long ret = bindings.C2Tuple_ThirtyTwoBytesPublicKeyZ_get_b(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; - } - - internal long clone_ptr() { - long ret = bindings.C2Tuple_ThirtyTwoBytesPublicKeyZ_clone_ptr(this.ptr); - GC.KeepAlive(this); - return ret; - } - - /** - * Creates a new tuple which has the same data as `orig` - * but with all dynamically-allocated buffers duplicated in new buffers. - */ - public TwoTuple_ThirtyTwoBytesPublicKeyZ clone() { - long ret = bindings.C2Tuple_ThirtyTwoBytesPublicKeyZ_clone(this.ptr); - GC.KeepAlive(this); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_ThirtyTwoBytesPublicKeyZ ret_hu_conv = new TwoTuple_ThirtyTwoBytesPublicKeyZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; - return ret_hu_conv; - } - - /** - * Creates a new C2Tuple_ThirtyTwoBytesPublicKeyZ from the contained elements. - */ - public static TwoTuple_ThirtyTwoBytesPublicKeyZ of(byte[] a, byte[] b) { - long ret = bindings.C2Tuple_ThirtyTwoBytesPublicKeyZ_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(a, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(b, 33))); - GC.KeepAlive(a); - GC.KeepAlive(b); - if (ret >= 0 && ret <= 4096) { return null; } - TwoTuple_ThirtyTwoBytesPublicKeyZ ret_hu_conv = new TwoTuple_ThirtyTwoBytesPublicKeyZ(null, ret); - if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; - return ret_hu_conv; - } - -} -} } } diff --git a/c_sharp/src/org/ldk/structs/TxAbort.cs b/c_sharp/src/org/ldk/structs/TxAbort.cs index 47f24a72..d40f628e 100644 --- a/c_sharp/src/org/ldk/structs/TxAbort.cs +++ b/c_sharp/src/org/ldk/structs/TxAbort.cs @@ -18,21 +18,23 @@ public class TxAbort : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxAbort_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxAbort_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxAbort_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -60,13 +62,14 @@ public class TxAbort : CommonBase { /** * Constructs a new TxAbort given each field */ - public static TxAbort of(byte[] channel_id_arg, byte[] data_arg) { - long ret = bindings.TxAbort_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(data_arg)); + public static TxAbort of(org.ldk.structs.ChannelId channel_id_arg, byte[] data_arg) { + long ret = bindings.TxAbort_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(data_arg)); GC.KeepAlive(channel_id_arg); GC.KeepAlive(data_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAbort ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAbort(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -106,7 +109,7 @@ public class TxAbort : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxAbort b) { - bool ret = bindings.TxAbort_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxAbort_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxAckRbf.cs b/c_sharp/src/org/ldk/structs/TxAckRbf.cs index 43dec5a5..52362a53 100644 --- a/c_sharp/src/org/ldk/structs/TxAckRbf.cs +++ b/c_sharp/src/org/ldk/structs/TxAckRbf.cs @@ -19,21 +19,23 @@ public class TxAckRbf : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxAckRbf_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxAckRbf_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxAckRbf_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -63,13 +65,14 @@ public class TxAckRbf : CommonBase { /** * Constructs a new TxAckRbf given each field */ - public static TxAckRbf of(byte[] channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { - long ret = bindings.TxAckRbf_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), funding_output_contribution_arg.ptr); + public static TxAckRbf of(org.ldk.structs.ChannelId channel_id_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { + long ret = bindings.TxAckRbf_new(channel_id_arg.ptr, funding_output_contribution_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(funding_output_contribution_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAckRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAckRbf(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); }; return ret_hu_conv; } @@ -110,7 +113,7 @@ public class TxAckRbf : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxAckRbf b) { - bool ret = bindings.TxAckRbf_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxAckRbf_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxAddInput.cs b/c_sharp/src/org/ldk/structs/TxAddInput.cs index 338a04a7..2893c182 100644 --- a/c_sharp/src/org/ldk/structs/TxAddInput.cs +++ b/c_sharp/src/org/ldk/structs/TxAddInput.cs @@ -18,21 +18,23 @@ public class TxAddInput : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxAddInput_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxAddInput_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxAddInput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -73,7 +75,7 @@ public class TxAddInput : CommonBase { * malleable. */ public void set_prevtx(org.ldk.structs.TransactionU16LenLimited val) { - bindings.TxAddInput_set_prevtx(this.ptr, val == null ? 0 : val.ptr); + bindings.TxAddInput_set_prevtx(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -118,8 +120,8 @@ public class TxAddInput : CommonBase { /** * Constructs a new TxAddInput given each field */ - public static TxAddInput of(byte[] channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg) { - long ret = bindings.TxAddInput_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), serial_id_arg, prevtx_arg == null ? 0 : prevtx_arg.ptr, prevtx_out_arg, sequence_arg); + public static TxAddInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg, org.ldk.structs.TransactionU16LenLimited prevtx_arg, int prevtx_out_arg, int sequence_arg) { + long ret = bindings.TxAddInput_new(channel_id_arg.ptr, serial_id_arg, prevtx_arg.ptr, prevtx_out_arg, sequence_arg); GC.KeepAlive(channel_id_arg); GC.KeepAlive(serial_id_arg); GC.KeepAlive(prevtx_arg); @@ -128,6 +130,7 @@ public class TxAddInput : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAddInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddInput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(prevtx_arg); }; return ret_hu_conv; } @@ -168,7 +171,7 @@ public class TxAddInput : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxAddInput b) { - bool ret = bindings.TxAddInput_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxAddInput_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxAddOutput.cs b/c_sharp/src/org/ldk/structs/TxAddOutput.cs index 01d0d947..1b1fffe2 100644 --- a/c_sharp/src/org/ldk/structs/TxAddOutput.cs +++ b/c_sharp/src/org/ldk/structs/TxAddOutput.cs @@ -18,21 +18,23 @@ public class TxAddOutput : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxAddOutput_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxAddOutput_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxAddOutput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -96,8 +98,8 @@ public class TxAddOutput : CommonBase { /** * Constructs a new TxAddOutput given each field */ - public static TxAddOutput of(byte[] channel_id_arg, long serial_id_arg, long sats_arg, byte[] script_arg) { - long ret = bindings.TxAddOutput_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), serial_id_arg, sats_arg, InternalUtils.encodeUint8Array(script_arg)); + public static TxAddOutput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg, long sats_arg, byte[] script_arg) { + long ret = bindings.TxAddOutput_new(channel_id_arg.ptr, serial_id_arg, sats_arg, InternalUtils.encodeUint8Array(script_arg)); GC.KeepAlive(channel_id_arg); GC.KeepAlive(serial_id_arg); GC.KeepAlive(sats_arg); @@ -105,6 +107,7 @@ public class TxAddOutput : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxAddOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxAddOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -144,7 +147,7 @@ public class TxAddOutput : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxAddOutput b) { - bool ret = bindings.TxAddOutput_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxAddOutput_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxComplete.cs b/c_sharp/src/org/ldk/structs/TxComplete.cs index 783ef555..906528fa 100644 --- a/c_sharp/src/org/ldk/structs/TxComplete.cs +++ b/c_sharp/src/org/ldk/structs/TxComplete.cs @@ -19,32 +19,35 @@ public class TxComplete : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxComplete_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxComplete_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxComplete_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** * Constructs a new TxComplete given each field */ - public static TxComplete of(byte[] channel_id_arg) { - long ret = bindings.TxComplete_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32))); + public static TxComplete of(org.ldk.structs.ChannelId channel_id_arg) { + long ret = bindings.TxComplete_new(channel_id_arg.ptr); GC.KeepAlive(channel_id_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxComplete ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxComplete(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -84,7 +87,7 @@ public class TxComplete : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxComplete b) { - bool ret = bindings.TxComplete_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxComplete_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxCreationKeys.cs b/c_sharp/src/org/ldk/structs/TxCreationKeys.cs index 58b6f6ab..4be4a177 100644 --- a/c_sharp/src/org/ldk/structs/TxCreationKeys.cs +++ b/c_sharp/src/org/ldk/structs/TxCreationKeys.cs @@ -65,7 +65,7 @@ public class TxCreationKeys : CommonBase { * an old state. */ public void set_revocation_key(org.ldk.structs.RevocationKey val) { - bindings.TxCreationKeys_set_revocation_key(this.ptr, val == null ? 0 : val.ptr); + bindings.TxCreationKeys_set_revocation_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -87,7 +87,7 @@ public class TxCreationKeys : CommonBase { * Broadcaster's HTLC Key */ public void set_broadcaster_htlc_key(org.ldk.structs.HtlcKey val) { - bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val == null ? 0 : val.ptr); + bindings.TxCreationKeys_set_broadcaster_htlc_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -109,7 +109,7 @@ public class TxCreationKeys : CommonBase { * Countersignatory's HTLC Key */ public void set_countersignatory_htlc_key(org.ldk.structs.HtlcKey val) { - bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val == null ? 0 : val.ptr); + bindings.TxCreationKeys_set_countersignatory_htlc_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -131,7 +131,7 @@ public class TxCreationKeys : CommonBase { * Broadcaster's Payment Key (which isn't allowed to be spent from for some delay) */ public void set_broadcaster_delayed_payment_key(org.ldk.structs.DelayedPaymentKey val) { - bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val == null ? 0 : val.ptr); + bindings.TxCreationKeys_set_broadcaster_delayed_payment_key(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -141,7 +141,7 @@ public class TxCreationKeys : CommonBase { * Constructs a new TxCreationKeys given each field */ public static TxCreationKeys of(byte[] per_commitment_point_arg, org.ldk.structs.RevocationKey revocation_key_arg, org.ldk.structs.HtlcKey broadcaster_htlc_key_arg, org.ldk.structs.HtlcKey countersignatory_htlc_key_arg, org.ldk.structs.DelayedPaymentKey broadcaster_delayed_payment_key_arg) { - long ret = bindings.TxCreationKeys_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point_arg, 33)), revocation_key_arg == null ? 0 : revocation_key_arg.ptr, broadcaster_htlc_key_arg == null ? 0 : broadcaster_htlc_key_arg.ptr, countersignatory_htlc_key_arg == null ? 0 : countersignatory_htlc_key_arg.ptr, broadcaster_delayed_payment_key_arg == null ? 0 : broadcaster_delayed_payment_key_arg.ptr); + long ret = bindings.TxCreationKeys_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point_arg, 33)), revocation_key_arg.ptr, broadcaster_htlc_key_arg.ptr, countersignatory_htlc_key_arg.ptr, broadcaster_delayed_payment_key_arg.ptr); GC.KeepAlive(per_commitment_point_arg); GC.KeepAlive(revocation_key_arg); GC.KeepAlive(broadcaster_htlc_key_arg); @@ -163,7 +163,7 @@ public class TxCreationKeys : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxCreationKeys b) { - bool ret = bindings.TxCreationKeys_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxCreationKeys_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -219,7 +219,7 @@ public class TxCreationKeys : CommonBase { * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ public static TxCreationKeys derive_new(byte[] per_commitment_point, org.ldk.structs.DelayedPaymentBasepoint broadcaster_delayed_payment_base, org.ldk.structs.HtlcBasepoint broadcaster_htlc_base, org.ldk.structs.RevocationBasepoint countersignatory_revocation_base, org.ldk.structs.HtlcBasepoint countersignatory_htlc_base) { - long ret = bindings.TxCreationKeys_derive_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), broadcaster_delayed_payment_base == null ? 0 : broadcaster_delayed_payment_base.ptr, broadcaster_htlc_base == null ? 0 : broadcaster_htlc_base.ptr, countersignatory_revocation_base == null ? 0 : countersignatory_revocation_base.ptr, countersignatory_htlc_base == null ? 0 : countersignatory_htlc_base.ptr); + long ret = bindings.TxCreationKeys_derive_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), broadcaster_delayed_payment_base.ptr, broadcaster_htlc_base.ptr, countersignatory_revocation_base.ptr, countersignatory_htlc_base.ptr); GC.KeepAlive(per_commitment_point); GC.KeepAlive(broadcaster_delayed_payment_base); GC.KeepAlive(broadcaster_htlc_base); @@ -240,7 +240,7 @@ public class TxCreationKeys : CommonBase { * Key set is asymmetric and can't be used as part of counter-signatory set of transactions. */ public static TxCreationKeys from_channel_static_keys(byte[] per_commitment_point, org.ldk.structs.ChannelPublicKeys broadcaster_keys, org.ldk.structs.ChannelPublicKeys countersignatory_keys) { - long ret = bindings.TxCreationKeys_from_channel_static_keys(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), broadcaster_keys == null ? 0 : broadcaster_keys.ptr, countersignatory_keys == null ? 0 : countersignatory_keys.ptr); + long ret = bindings.TxCreationKeys_from_channel_static_keys(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(per_commitment_point, 33)), broadcaster_keys.ptr, countersignatory_keys.ptr); GC.KeepAlive(per_commitment_point); GC.KeepAlive(broadcaster_keys); GC.KeepAlive(countersignatory_keys); diff --git a/c_sharp/src/org/ldk/structs/TxInitRbf.cs b/c_sharp/src/org/ldk/structs/TxInitRbf.cs index 7e930f3e..f071512f 100644 --- a/c_sharp/src/org/ldk/structs/TxInitRbf.cs +++ b/c_sharp/src/org/ldk/structs/TxInitRbf.cs @@ -19,21 +19,23 @@ public class TxInitRbf : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxInitRbf_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxInitRbf_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxInitRbf_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -99,8 +101,8 @@ public class TxInitRbf : CommonBase { /** * Constructs a new TxInitRbf given each field */ - public static TxInitRbf of(byte[] channel_id_arg, int locktime_arg, int feerate_sat_per_1000_weight_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { - long ret = bindings.TxInitRbf_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr); + public static TxInitRbf of(org.ldk.structs.ChannelId channel_id_arg, int locktime_arg, int feerate_sat_per_1000_weight_arg, org.ldk.structs.Option_i64Z funding_output_contribution_arg) { + long ret = bindings.TxInitRbf_new(channel_id_arg.ptr, locktime_arg, feerate_sat_per_1000_weight_arg, funding_output_contribution_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(locktime_arg); GC.KeepAlive(feerate_sat_per_1000_weight_arg); @@ -108,6 +110,7 @@ public class TxInitRbf : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxInitRbf ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxInitRbf(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_output_contribution_arg); }; return ret_hu_conv; } @@ -148,7 +151,7 @@ public class TxInitRbf : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxInitRbf b) { - bool ret = bindings.TxInitRbf_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxInitRbf_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxRemoveInput.cs b/c_sharp/src/org/ldk/structs/TxRemoveInput.cs index 18d4b550..3a83aa73 100644 --- a/c_sharp/src/org/ldk/structs/TxRemoveInput.cs +++ b/c_sharp/src/org/ldk/structs/TxRemoveInput.cs @@ -18,21 +18,23 @@ public class TxRemoveInput : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxRemoveInput_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxRemoveInput_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxRemoveInput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -56,13 +58,14 @@ public class TxRemoveInput : CommonBase { /** * Constructs a new TxRemoveInput given each field */ - public static TxRemoveInput of(byte[] channel_id_arg, long serial_id_arg) { - long ret = bindings.TxRemoveInput_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), serial_id_arg); + public static TxRemoveInput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg) { + long ret = bindings.TxRemoveInput_new(channel_id_arg.ptr, serial_id_arg); GC.KeepAlive(channel_id_arg); GC.KeepAlive(serial_id_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxRemoveInput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveInput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -102,7 +105,7 @@ public class TxRemoveInput : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxRemoveInput b) { - bool ret = bindings.TxRemoveInput_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxRemoveInput_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs b/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs index b5d15bf6..3779df9a 100644 --- a/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs +++ b/c_sharp/src/org/ldk/structs/TxRemoveOutput.cs @@ -18,21 +18,23 @@ public class TxRemoveOutput : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxRemoveOutput_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxRemoveOutput_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxRemoveOutput_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -56,13 +58,14 @@ public class TxRemoveOutput : CommonBase { /** * Constructs a new TxRemoveOutput given each field */ - public static TxRemoveOutput of(byte[] channel_id_arg, long serial_id_arg) { - long ret = bindings.TxRemoveOutput_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), serial_id_arg); + public static TxRemoveOutput of(org.ldk.structs.ChannelId channel_id_arg, long serial_id_arg) { + long ret = bindings.TxRemoveOutput_new(channel_id_arg.ptr, serial_id_arg); GC.KeepAlive(channel_id_arg); GC.KeepAlive(serial_id_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxRemoveOutput ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxRemoveOutput(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -102,7 +105,7 @@ public class TxRemoveOutput : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxRemoveOutput b) { - bool ret = bindings.TxRemoveOutput_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxRemoveOutput_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/TxSignatures.cs b/c_sharp/src/org/ldk/structs/TxSignatures.cs index 43a52410..6de18a09 100644 --- a/c_sharp/src/org/ldk/structs/TxSignatures.cs +++ b/c_sharp/src/org/ldk/structs/TxSignatures.cs @@ -19,21 +19,23 @@ public class TxSignatures : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.TxSignatures_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.TxSignatures_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.TxSignatures_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -85,17 +87,42 @@ public class TxSignatures : CommonBase { GC.KeepAlive(val); } + /** + * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers + */ + public Option_ECDSASignatureZ get_funding_outpoint_sig() { + long ret = bindings.TxSignatures_get_funding_outpoint_sig(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.Option_ECDSASignatureZ ret_hu_conv = org.ldk.structs.Option_ECDSASignatureZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Optional signature for the shared input -- the previous funding outpoint -- signed by both peers + */ + public void set_funding_outpoint_sig(org.ldk.structs.Option_ECDSASignatureZ val) { + bindings.TxSignatures_set_funding_outpoint_sig(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + /** * Constructs a new TxSignatures given each field */ - public static TxSignatures of(byte[] channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg) { - long ret = bindings.TxSignatures_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(tx_hash_arg, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(witnesses_arg, witnesses_arg_conv_8 => InternalUtils.encodeUint8Array(witnesses_arg_conv_8)))); + public static TxSignatures of(org.ldk.structs.ChannelId channel_id_arg, byte[] tx_hash_arg, byte[][] witnesses_arg, org.ldk.structs.Option_ECDSASignatureZ funding_outpoint_sig_arg) { + long ret = bindings.TxSignatures_new(channel_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(tx_hash_arg, 32)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(witnesses_arg, witnesses_arg_conv_8 => InternalUtils.encodeUint8Array(witnesses_arg_conv_8))), funding_outpoint_sig_arg.ptr); GC.KeepAlive(channel_id_arg); GC.KeepAlive(tx_hash_arg); GC.KeepAlive(witnesses_arg); + GC.KeepAlive(funding_outpoint_sig_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.TxSignatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.TxSignatures(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(funding_outpoint_sig_arg); }; return ret_hu_conv; } @@ -135,7 +162,7 @@ public class TxSignatures : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.TxSignatures b) { - bool ret = bindings.TxSignatures_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.TxSignatures_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UnknownPaymentContext.cs b/c_sharp/src/org/ldk/structs/UnknownPaymentContext.cs new file mode 100644 index 00000000..34ee30fc --- /dev/null +++ b/c_sharp/src/org/ldk/structs/UnknownPaymentContext.cs @@ -0,0 +1,76 @@ +using org.ldk.impl; +using org.ldk.enums; +using org.ldk.util; +using System; + +namespace org { namespace ldk { namespace structs { + + +/** + * An unknown payment context. + */ +public class UnknownPaymentContext : CommonBase { + internal UnknownPaymentContext(object _dummy, long ptr) : base(ptr) { } + ~UnknownPaymentContext() { + if (ptr != 0) { bindings.UnknownPaymentContext_free(ptr); } + } + + internal long clone_ptr() { + long ret = bindings.UnknownPaymentContext_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UnknownPaymentContext + */ + public UnknownPaymentContext clone() { + long ret = bindings.UnknownPaymentContext_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnknownPaymentContext ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnknownPaymentContext(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * Checks if two UnknownPaymentContexts contain equal inner contents. + * This ignores pointers and is_owned flags and looks at the values in fields. + * Two objects with NULL inner values will be considered "equal" here. + */ + public bool eq(org.ldk.structs.UnknownPaymentContext b) { + bool ret = bindings.UnknownPaymentContext_eq(this.ptr, b.ptr); + GC.KeepAlive(this); + GC.KeepAlive(b); + if (this != null) { this.ptrs_to.AddLast(b); }; + return ret; + } + + public override bool Equals(object o) { + if (!(o is UnknownPaymentContext)) return false; + return this.eq((UnknownPaymentContext)o); + } + /** + * Serialize the UnknownPaymentContext object into a byte array which can be read by UnknownPaymentContext_read + */ + public byte[] write() { + long ret = bindings.UnknownPaymentContext_write(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Read a UnknownPaymentContext from a byte array, created by UnknownPaymentContext_write + */ + public static Result_UnknownPaymentContextDecodeErrorZ read(byte[] ser) { + long ret = bindings.UnknownPaymentContext_read(InternalUtils.encodeUint8Array(ser)); + GC.KeepAlive(ser); + if (ret >= 0 && ret <= 4096) { return null; } + Result_UnknownPaymentContextDecodeErrorZ ret_hu_conv = Result_UnknownPaymentContextDecodeErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + +} +} } } diff --git a/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs b/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs index 7e653a62..0b81898f 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedBolt12Invoice.cs @@ -20,6 +20,24 @@ public class UnsignedBolt12Invoice : CommonBase { if (ptr != 0) { bindings.UnsignedBolt12Invoice_free(ptr); } } + internal long clone_ptr() { + long ret = bindings.UnsignedBolt12Invoice_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UnsignedBolt12Invoice + */ + public UnsignedBolt12Invoice clone() { + long ret = bindings.UnsignedBolt12Invoice_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedBolt12Invoice ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedBolt12Invoice(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Returns the [`TaggedHash`] of the invoice to sign. */ @@ -91,14 +109,12 @@ public class UnsignedBolt12Invoice : CommonBase { * * [`Offer`]: crate::offers::offer::Offer * [`Offer::amount`]: crate::offers::offer::Offer::amount - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Amount amount() { + public Option_AmountZ amount() { long ret = bindings.UnsignedBolt12Invoice_amount(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -129,6 +145,8 @@ public class UnsignedBolt12Invoice : CommonBase { * From [`Offer::description`] or [`Refund::description`]. * * [`Offer::description`]: crate::offers::offer::Offer::description + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public PrintableString description() { long ret = bindings.UnsignedBolt12Invoice_description(this.ptr); @@ -203,14 +221,12 @@ public class UnsignedBolt12Invoice : CommonBase { * [`Refund`]. * * [`Offer::supported_quantity`]: crate::offers::offer::Offer::supported_quantity - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Quantity supported_quantity() { + public Option_QuantityZ supported_quantity() { long ret = bindings.UnsignedBolt12Invoice_supported_quantity(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Option_QuantityZ ret_hu_conv = org.ldk.structs.Option_QuantityZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } diff --git a/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs b/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs index 98303e3b..d1d55119 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedChannelAnnouncement.cs @@ -33,7 +33,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * The advertised channel features */ public void set_features(org.ldk.structs.ChannelFeatures val) { - bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedChannelAnnouncement_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -93,7 +93,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * One of the two `node_id`s which are endpoints of this channel */ public void set_node_id_1(org.ldk.structs.NodeId val) { - bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedChannelAnnouncement_set_node_id_1(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -115,7 +115,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * The other of the two `node_id`s which are endpoints of this channel */ public void set_node_id_2(org.ldk.structs.NodeId val) { - bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedChannelAnnouncement_set_node_id_2(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -137,7 +137,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * The funding key for the first node */ public void set_bitcoin_key_1(org.ldk.structs.NodeId val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_1(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -159,7 +159,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * The funding key for the second node */ public void set_bitcoin_key_2(org.ldk.structs.NodeId val) { - bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedChannelAnnouncement_set_bitcoin_key_2(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -197,7 +197,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * Constructs a new UnsignedChannelAnnouncement given each field */ public static UnsignedChannelAnnouncement of(org.ldk.structs.ChannelFeatures features_arg, byte[] chain_hash_arg, long short_channel_id_arg, org.ldk.structs.NodeId node_id_1_arg, org.ldk.structs.NodeId node_id_2_arg, org.ldk.structs.NodeId bitcoin_key_1_arg, org.ldk.structs.NodeId bitcoin_key_2_arg, byte[] excess_data_arg) { - long ret = bindings.UnsignedChannelAnnouncement_new(features_arg == null ? 0 : features_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), short_channel_id_arg, node_id_1_arg == null ? 0 : node_id_1_arg.ptr, node_id_2_arg == null ? 0 : node_id_2_arg.ptr, bitcoin_key_1_arg == null ? 0 : bitcoin_key_1_arg.ptr, bitcoin_key_2_arg == null ? 0 : bitcoin_key_2_arg.ptr, InternalUtils.encodeUint8Array(excess_data_arg)); + long ret = bindings.UnsignedChannelAnnouncement_new(features_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(chain_hash_arg, 32)), short_channel_id_arg, node_id_1_arg.ptr, node_id_2_arg.ptr, bitcoin_key_1_arg.ptr, bitcoin_key_2_arg.ptr, InternalUtils.encodeUint8Array(excess_data_arg)); GC.KeepAlive(features_arg); GC.KeepAlive(chain_hash_arg); GC.KeepAlive(short_channel_id_arg); @@ -253,7 +253,7 @@ public class UnsignedChannelAnnouncement : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UnsignedChannelAnnouncement b) { - bool ret = bindings.UnsignedChannelAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UnsignedChannelAnnouncement_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs b/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs index 48dd7bd2..5601f3c9 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedChannelUpdate.cs @@ -284,7 +284,7 @@ public class UnsignedChannelUpdate : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UnsignedChannelUpdate b) { - bool ret = bindings.UnsignedChannelUpdate_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UnsignedChannelUpdate_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs index ff59a12d..fee4ac0f 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedGossipMessage.cs @@ -77,7 +77,7 @@ public class UnsignedGossipMessage : CommonBase { * Utility method to constructs a new ChannelAnnouncement-variant UnsignedGossipMessage */ public static UnsignedGossipMessage channel_announcement(org.ldk.structs.UnsignedChannelAnnouncement a) { - long ret = bindings.UnsignedGossipMessage_channel_announcement(a == null ? 0 : a.ptr); + long ret = bindings.UnsignedGossipMessage_channel_announcement(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); @@ -90,7 +90,7 @@ public class UnsignedGossipMessage : CommonBase { * Utility method to constructs a new ChannelUpdate-variant UnsignedGossipMessage */ public static UnsignedGossipMessage channel_update(org.ldk.structs.UnsignedChannelUpdate a) { - long ret = bindings.UnsignedGossipMessage_channel_update(a == null ? 0 : a.ptr); + long ret = bindings.UnsignedGossipMessage_channel_update(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); @@ -103,7 +103,7 @@ public class UnsignedGossipMessage : CommonBase { * Utility method to constructs a new NodeAnnouncement-variant UnsignedGossipMessage */ public static UnsignedGossipMessage node_announcement(org.ldk.structs.UnsignedNodeAnnouncement a) { - long ret = bindings.UnsignedGossipMessage_node_announcement(a == null ? 0 : a.ptr); + long ret = bindings.UnsignedGossipMessage_node_announcement(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UnsignedGossipMessage ret_hu_conv = org.ldk.structs.UnsignedGossipMessage.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs b/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs index 1c33d54d..8a3dd22a 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedInvoiceRequest.cs @@ -20,6 +20,24 @@ public class UnsignedInvoiceRequest : CommonBase { if (ptr != 0) { bindings.UnsignedInvoiceRequest_free(ptr); } } + internal long clone_ptr() { + long ret = bindings.UnsignedInvoiceRequest_clone_ptr(this.ptr); + GC.KeepAlive(this); + return ret; + } + + /** + * Creates a copy of the UnsignedInvoiceRequest + */ + public UnsignedInvoiceRequest clone() { + long ret = bindings.UnsignedInvoiceRequest_clone(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedInvoiceRequest ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedInvoiceRequest(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + /** * Returns the [`TaggedHash`] of the invoice to sign. */ @@ -67,14 +85,12 @@ public class UnsignedInvoiceRequest : CommonBase { /** * The minimum amount required for a successful payment of a single item. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Amount amount() { + public Option_AmountZ amount() { long ret = bindings.UnsignedInvoiceRequest_amount(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -82,6 +98,8 @@ public class UnsignedInvoiceRequest : CommonBase { /** * A complete description of the purpose of the payment. Intended to be displayed to the user * but with the caveat that it has not been verified in any way. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public PrintableString description() { long ret = bindings.UnsignedInvoiceRequest_description(this.ptr); @@ -160,13 +178,15 @@ public class UnsignedInvoiceRequest : CommonBase { long ret = bindings.UnsignedInvoiceRequest_supported_quantity(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** * The public key used by the recipient to sign invoices. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public byte[] signing_pubkey() { long ret = bindings.UnsignedInvoiceRequest_signing_pubkey(this.ptr); diff --git a/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs b/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs index c2ed14b3..402811f5 100644 --- a/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs +++ b/c_sharp/src/org/ldk/structs/UnsignedNodeAnnouncement.cs @@ -33,7 +33,7 @@ public class UnsignedNodeAnnouncement : CommonBase { * The advertised features */ public void set_features(org.ldk.structs.NodeFeatures val) { - bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedNodeAnnouncement_set_features(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -75,7 +75,7 @@ public class UnsignedNodeAnnouncement : CommonBase { * to this node). */ public void set_node_id(org.ldk.structs.NodeId val) { - bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedNodeAnnouncement_set_node_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -121,7 +121,7 @@ public class UnsignedNodeAnnouncement : CommonBase { * This should be sanitized before use. There is no guarantee of uniqueness. */ public void set_alias(org.ldk.structs.NodeAlias val) { - bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val == null ? 0 : val.ptr); + bindings.UnsignedNodeAnnouncement_set_alias(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -158,6 +158,85 @@ public class UnsignedNodeAnnouncement : CommonBase { foreach (SocketAddress val_conv_15 in val) { if (this != null) { this.ptrs_to.AddLast(val_conv_15); }; }; } + /** + * Excess address data which was signed as a part of the message which we do not (yet) understand how + * to decode. + * + * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol. + * + * Returns a copy of the field. + */ + public byte[] get_excess_address_data() { + long ret = bindings.UnsignedNodeAnnouncement_get_excess_address_data(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Excess address data which was signed as a part of the message which we do not (yet) understand how + * to decode. + * + * This is stored to ensure forward-compatibility as new address types are added to the lightning gossip protocol. + */ + public void set_excess_address_data(byte[] val) { + bindings.UnsignedNodeAnnouncement_set_excess_address_data(this.ptr, InternalUtils.encodeUint8Array(val)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Excess data which was signed as a part of the message which we do not (yet) understand how + * to decode. + * + * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. + * + * Returns a copy of the field. + */ + public byte[] get_excess_data() { + long ret = bindings.UnsignedNodeAnnouncement_get_excess_data(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + + /** + * Excess data which was signed as a part of the message which we do not (yet) understand how + * to decode. + * + * This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol. + */ + public void set_excess_data(byte[] val) { + bindings.UnsignedNodeAnnouncement_set_excess_data(this.ptr, InternalUtils.encodeUint8Array(val)); + GC.KeepAlive(this); + GC.KeepAlive(val); + } + + /** + * Constructs a new UnsignedNodeAnnouncement given each field + */ + public static UnsignedNodeAnnouncement of(org.ldk.structs.NodeFeatures features_arg, int timestamp_arg, org.ldk.structs.NodeId node_id_arg, byte[] rgb_arg, org.ldk.structs.NodeAlias alias_arg, SocketAddress[] addresses_arg, byte[] excess_address_data_arg, byte[] excess_data_arg) { + long ret = bindings.UnsignedNodeAnnouncement_new(features_arg.ptr, timestamp_arg, node_id_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(rgb_arg, 3)), alias_arg.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(addresses_arg, addresses_arg_conv_15 => addresses_arg_conv_15.ptr)), InternalUtils.encodeUint8Array(excess_address_data_arg), InternalUtils.encodeUint8Array(excess_data_arg)); + GC.KeepAlive(features_arg); + GC.KeepAlive(timestamp_arg); + GC.KeepAlive(node_id_arg); + GC.KeepAlive(rgb_arg); + GC.KeepAlive(alias_arg); + GC.KeepAlive(addresses_arg); + GC.KeepAlive(excess_address_data_arg); + GC.KeepAlive(excess_data_arg); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.UnsignedNodeAnnouncement ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UnsignedNodeAnnouncement(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(features_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_id_arg); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(alias_arg); }; + foreach (SocketAddress addresses_arg_conv_15 in addresses_arg) { if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(addresses_arg_conv_15); }; }; + return ret_hu_conv; + } + internal long clone_ptr() { long ret = bindings.UnsignedNodeAnnouncement_clone_ptr(this.ptr); GC.KeepAlive(this); @@ -194,7 +273,7 @@ public class UnsignedNodeAnnouncement : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UnsignedNodeAnnouncement b) { - bool ret = bindings.UnsignedNodeAnnouncement_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UnsignedNodeAnnouncement_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UntrustedString.cs b/c_sharp/src/org/ldk/structs/UntrustedString.cs index e2d65378..5625f1d9 100644 --- a/c_sharp/src/org/ldk/structs/UntrustedString.cs +++ b/c_sharp/src/org/ldk/structs/UntrustedString.cs @@ -65,7 +65,7 @@ public class UntrustedString : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UntrustedString b) { - bool ret = bindings.UntrustedString_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UntrustedString_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs index 343346eb..52acd06f 100644 --- a/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateAddHTLC.cs @@ -20,21 +20,23 @@ public class UpdateAddHTLC : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.UpdateAddHTLC_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.UpdateAddHTLC_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.UpdateAddHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -155,7 +157,7 @@ public class UpdateAddHTLC : CommonBase { * The onion routing packet with encrypted data for the next hop. */ public void set_onion_routing_packet(org.ldk.structs.OnionPacket val) { - bindings.UpdateAddHTLC_set_onion_routing_packet(this.ptr, val == null ? 0 : val.ptr); + bindings.UpdateAddHTLC_set_onion_routing_packet(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -192,8 +194,8 @@ public class UpdateAddHTLC : CommonBase { * * Note that blinding_point_arg (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static UpdateAddHTLC of(byte[] channel_id_arg, long htlc_id_arg, long amount_msat_arg, byte[] payment_hash_arg, int cltv_expiry_arg, org.ldk.structs.Option_u64Z skimmed_fee_msat_arg, org.ldk.structs.OnionPacket onion_routing_packet_arg, byte[] blinding_point_arg) { - long ret = bindings.UpdateAddHTLC_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), htlc_id_arg, amount_msat_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash_arg, 32)), cltv_expiry_arg, skimmed_fee_msat_arg.ptr, onion_routing_packet_arg == null ? 0 : onion_routing_packet_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33))); + public static UpdateAddHTLC of(org.ldk.structs.ChannelId channel_id_arg, long htlc_id_arg, long amount_msat_arg, byte[] payment_hash_arg, int cltv_expiry_arg, org.ldk.structs.Option_u64Z skimmed_fee_msat_arg, org.ldk.structs.OnionPacket onion_routing_packet_arg, byte[] blinding_point_arg) { + long ret = bindings.UpdateAddHTLC_new(channel_id_arg.ptr, htlc_id_arg, amount_msat_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash_arg, 32)), cltv_expiry_arg, skimmed_fee_msat_arg.ptr, onion_routing_packet_arg.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(blinding_point_arg, 33))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(htlc_id_arg); GC.KeepAlive(amount_msat_arg); @@ -205,6 +207,7 @@ public class UpdateAddHTLC : CommonBase { if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UpdateAddHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateAddHTLC(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(skimmed_fee_msat_arg); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(onion_routing_packet_arg); }; return ret_hu_conv; @@ -246,7 +249,7 @@ public class UpdateAddHTLC : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UpdateAddHTLC b) { - bool ret = bindings.UpdateAddHTLC_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UpdateAddHTLC_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs index e4ba1496..767f3390 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFailHTLC.cs @@ -20,21 +20,23 @@ public class UpdateFailHTLC : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.UpdateFailHTLC_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.UpdateFailHTLC_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.UpdateFailHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -91,7 +93,7 @@ public class UpdateFailHTLC : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UpdateFailHTLC b) { - bool ret = bindings.UpdateFailHTLC_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UpdateFailHTLC_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs index 8d26d464..67f93a4c 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFailMalformedHTLC.cs @@ -20,21 +20,23 @@ public class UpdateFailMalformedHTLC : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.UpdateFailMalformedHTLC_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.UpdateFailMalformedHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -109,7 +111,7 @@ public class UpdateFailMalformedHTLC : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UpdateFailMalformedHTLC b) { - bool ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UpdateFailMalformedHTLC_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UpdateFee.cs b/c_sharp/src/org/ldk/structs/UpdateFee.cs index 90b0817a..1d752e1f 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFee.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFee.cs @@ -20,21 +20,23 @@ public class UpdateFee : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.UpdateFee_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.UpdateFee_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.UpdateFee_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -58,13 +60,14 @@ public class UpdateFee : CommonBase { /** * Constructs a new UpdateFee given each field */ - public static UpdateFee of(byte[] channel_id_arg, int feerate_per_kw_arg) { - long ret = bindings.UpdateFee_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), feerate_per_kw_arg); + public static UpdateFee of(org.ldk.structs.ChannelId channel_id_arg, int feerate_per_kw_arg) { + long ret = bindings.UpdateFee_new(channel_id_arg.ptr, feerate_per_kw_arg); GC.KeepAlive(channel_id_arg); GC.KeepAlive(feerate_per_kw_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UpdateFee ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFee(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -104,7 +107,7 @@ public class UpdateFee : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UpdateFee b) { - bool ret = bindings.UpdateFee_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UpdateFee_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs b/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs index d7c10a6b..9ca1f566 100644 --- a/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs +++ b/c_sharp/src/org/ldk/structs/UpdateFulfillHTLC.cs @@ -20,21 +20,23 @@ public class UpdateFulfillHTLC : CommonBase { /** * The channel ID */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.UpdateFulfillHTLC_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** * The channel ID */ - public void set_channel_id(byte[] val) { - bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.UpdateFulfillHTLC_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -78,14 +80,15 @@ public class UpdateFulfillHTLC : CommonBase { /** * Constructs a new UpdateFulfillHTLC given each field */ - public static UpdateFulfillHTLC of(byte[] channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { - long ret = bindings.UpdateFulfillHTLC_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), htlc_id_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_preimage_arg, 32))); + public static UpdateFulfillHTLC of(org.ldk.structs.ChannelId channel_id_arg, long htlc_id_arg, byte[] payment_preimage_arg) { + long ret = bindings.UpdateFulfillHTLC_new(channel_id_arg.ptr, htlc_id_arg, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_preimage_arg, 32))); GC.KeepAlive(channel_id_arg); GC.KeepAlive(htlc_id_arg); GC.KeepAlive(payment_preimage_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UpdateFulfillHTLC ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.UpdateFulfillHTLC(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -125,7 +128,7 @@ public class UpdateFulfillHTLC : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.UpdateFulfillHTLC b) { - bool ret = bindings.UpdateFulfillHTLC_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.UpdateFulfillHTLC_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/UserConfig.cs b/c_sharp/src/org/ldk/structs/UserConfig.cs index 345d5d35..b64a22e4 100644 --- a/c_sharp/src/org/ldk/structs/UserConfig.cs +++ b/c_sharp/src/org/ldk/structs/UserConfig.cs @@ -34,7 +34,7 @@ public class UserConfig : CommonBase { * Channel handshake config that we propose to our counterparty. */ public void set_channel_handshake_config(org.ldk.structs.ChannelHandshakeConfig val) { - bindings.UserConfig_set_channel_handshake_config(this.ptr, val == null ? 0 : val.ptr); + bindings.UserConfig_set_channel_handshake_config(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -56,7 +56,7 @@ public class UserConfig : CommonBase { * Limits applied to our counterparty's proposed channel handshake config settings. */ public void set_channel_handshake_limits(org.ldk.structs.ChannelHandshakeLimits val) { - bindings.UserConfig_set_channel_handshake_limits(this.ptr, val == null ? 0 : val.ptr); + bindings.UserConfig_set_channel_handshake_limits(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -78,7 +78,7 @@ public class UserConfig : CommonBase { * Channel config which affects behavior during channel lifetime. */ public void set_channel_config(org.ldk.structs.ChannelConfig val) { - bindings.UserConfig_set_channel_config(this.ptr, val == null ? 0 : val.ptr); + bindings.UserConfig_set_channel_config(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -270,7 +270,7 @@ public class UserConfig : CommonBase { * Constructs a new UserConfig given each field */ public static UserConfig of(org.ldk.structs.ChannelHandshakeConfig channel_handshake_config_arg, org.ldk.structs.ChannelHandshakeLimits channel_handshake_limits_arg, org.ldk.structs.ChannelConfig channel_config_arg, bool accept_forwards_to_priv_channels_arg, bool accept_inbound_channels_arg, bool manually_accept_inbound_channels_arg, bool accept_intercept_htlcs_arg, bool accept_mpp_keysend_arg) { - long ret = bindings.UserConfig_new(channel_handshake_config_arg == null ? 0 : channel_handshake_config_arg.ptr, channel_handshake_limits_arg == null ? 0 : channel_handshake_limits_arg.ptr, channel_config_arg == null ? 0 : channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); + long ret = bindings.UserConfig_new(channel_handshake_config_arg.ptr, channel_handshake_limits_arg.ptr, channel_config_arg.ptr, accept_forwards_to_priv_channels_arg, accept_inbound_channels_arg, manually_accept_inbound_channels_arg, accept_intercept_htlcs_arg, accept_mpp_keysend_arg); GC.KeepAlive(channel_handshake_config_arg); GC.KeepAlive(channel_handshake_limits_arg); GC.KeepAlive(channel_config_arg); diff --git a/c_sharp/src/org/ldk/structs/UtilMethods.cs b/c_sharp/src/org/ldk/structs/UtilMethods.cs index 0ef6dd44..cd6af6e2 100644 --- a/c_sharp/src/org/ldk/structs/UtilMethods.cs +++ b/c_sharp/src/org/ldk/structs/UtilMethods.cs @@ -121,6 +121,72 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Extracts the block height (most significant 3-bytes) from the `short_channel_id` + */ + public static int block_from_scid(long short_channel_id) { + int ret = bindings.block_from_scid(short_channel_id); + GC.KeepAlive(short_channel_id); + return ret; + } + + /** + * Extracts the tx index (bytes [2..4]) from the `short_channel_id` + */ + public static int tx_index_from_scid(long short_channel_id) { + int ret = bindings.tx_index_from_scid(short_channel_id); + GC.KeepAlive(short_channel_id); + return ret; + } + + /** + * Extracts the vout (bytes [0..2]) from the `short_channel_id` + */ + public static short vout_from_scid(long short_channel_id) { + short ret = bindings.vout_from_scid(short_channel_id); + GC.KeepAlive(short_channel_id); + return ret; + } + + /** + * Constructs a `short_channel_id` using the components pieces. Results in an error + * if the block height, tx index, or vout index overflow the maximum sizes. + */ + public static Result_u64ShortChannelIdErrorZ scid_from_parts(long block, long tx_index, long vout_index) { + long ret = bindings.scid_from_parts(block, tx_index, vout_index); + GC.KeepAlive(block); + GC.KeepAlive(tx_index); + GC.KeepAlive(vout_index); + if (ret >= 0 && ret <= 4096) { return null; } + Result_u64ShortChannelIdErrorZ ret_hu_conv = Result_u64ShortChannelIdErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Read a C2Tuple_BestBlockOutputSweeperZ from a byte array, created by C2Tuple_BestBlockOutputSweeperZ_write + */ + public static Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ C2Tuple_BestBlockOutputSweeperZ_read(byte[] ser, org.ldk.structs.BroadcasterInterface arg_a, org.ldk.structs.FeeEstimator arg_b, org.ldk.structs.Option_FilterZ arg_c, org.ldk.structs.OutputSpender arg_d, org.ldk.structs.ChangeDestinationSource arg_e, org.ldk.structs.KVStore arg_f, org.ldk.structs.Logger arg_g) { + long ret = bindings.C2Tuple_BestBlockOutputSweeperZ_read(InternalUtils.encodeUint8Array(ser), arg_a.ptr, arg_b.ptr, arg_c.ptr, arg_d.ptr, arg_e.ptr, arg_f.ptr, arg_g.ptr); + GC.KeepAlive(ser); + GC.KeepAlive(arg_a); + GC.KeepAlive(arg_b); + GC.KeepAlive(arg_c); + GC.KeepAlive(arg_d); + GC.KeepAlive(arg_e); + GC.KeepAlive(arg_f); + GC.KeepAlive(arg_g); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ ret_hu_conv = Result_C2Tuple_BestBlockOutputSweeperZDecodeErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_a); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_b); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_c); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_d); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_e); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_f); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(arg_g); }; + return ret_hu_conv; + } + /** * Read a MonitorEvent from a byte array, created by MonitorEvent_write */ @@ -159,7 +225,7 @@ public class UtilMethods { * [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable */ public static Result_PendingHTLCInfoInboundHTLCErrZ peel_payment_onion(org.ldk.structs.UpdateAddHTLC msg, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, int cur_height, bool accept_mpp_keysend, bool allow_skimmed_fees) { - long ret = bindings.peel_payment_onion(msg == null ? 0 : msg.ptr, node_signer.ptr, logger.ptr, cur_height, accept_mpp_keysend, allow_skimmed_fees); + long ret = bindings.peel_payment_onion(msg.ptr, node_signer.ptr, logger.ptr, cur_height, accept_mpp_keysend, allow_skimmed_fees); GC.KeepAlive(msg); GC.KeepAlive(node_signer); GC.KeepAlive(logger); @@ -179,7 +245,7 @@ public class UtilMethods { * [`ChannelManager`]. */ public static InitFeatures provided_init_features(org.ldk.structs.UserConfig config) { - long ret = bindings.provided_init_features(config == null ? 0 : config.ptr); + long ret = bindings.provided_init_features(config.ptr); GC.KeepAlive(config); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.InitFeatures ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.InitFeatures(null, ret); } @@ -192,7 +258,7 @@ public class UtilMethods { * Read a C2Tuple_ThirtyTwoBytesChannelManagerZ from a byte array, created by C2Tuple_ThirtyTwoBytesChannelManagerZ_write */ public static Result_C2Tuple_ThirtyTwoBytesChannelManagerZDecodeErrorZ C2Tuple_ThirtyTwoBytesChannelManagerZ_read(byte[] ser, EntropySource arg_entropy_source, NodeSigner arg_node_signer, SignerProvider arg_signer_provider, FeeEstimator arg_fee_estimator, Watch arg_chain_monitor, BroadcasterInterface arg_tx_broadcaster, Router arg_router, Logger arg_logger, UserConfig arg_default_config, ChannelMonitor[] arg_channel_monitors) { - long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_read(InternalUtils.encodeUint8Array(ser), bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_logger.ptr, arg_default_config == null ? 0 : arg_default_config.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(arg_channel_monitors, arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16 == null ? 0 : arg_channel_monitors_conv_16.ptr)))); + long ret = bindings.C2Tuple_ThirtyTwoBytesChannelManagerZ_read(InternalUtils.encodeUint8Array(ser), bindings.ChannelManagerReadArgs_new(arg_entropy_source.ptr, arg_node_signer.ptr, arg_signer_provider.ptr, arg_fee_estimator.ptr, arg_chain_monitor.ptr, arg_tx_broadcaster.ptr, arg_router.ptr, arg_logger.ptr, arg_default_config.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(arg_channel_monitors, arg_channel_monitors_conv_16 => arg_channel_monitors_conv_16.ptr)))); GC.KeepAlive(ser); GC.KeepAlive(arg_entropy_source); GC.KeepAlive(arg_node_signer); @@ -219,6 +285,20 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Adds a tweak to a public key to derive a new public key. + * + * May panic if `tweak` is not the output of a SHA-256 hash. + */ + public static byte[] add_public_key_tweak(byte[] base_point, byte[] tweak) { + long ret = bindings.add_public_key_tweak(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(base_point, 33)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(tweak, 32))); + GC.KeepAlive(base_point); + GC.KeepAlive(tweak); + if (ret >= 0 && ret <= 4096) { return null; } + byte[] ret_conv = InternalUtils.decodeUint8Array(ret); + return ret_conv; + } + /** * Equivalent to [`crate::ln::channelmanager::ChannelManager::create_inbound_payment`], but no * `ChannelManager` is required. Useful for generating invoices for [phantom node payments] without @@ -237,7 +317,7 @@ public class UtilMethods { * [`NodeSigner::get_inbound_payment_key_material`]: crate::sign::NodeSigner::get_inbound_payment_key_material */ public static Result_C2Tuple_ThirtyTwoBytesThirtyTwoBytesZNoneZ create(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, int invoice_expiry_delta_secs, org.ldk.structs.EntropySource entropy_source, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create(keys == null ? 0 : keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr); + long ret = bindings.create(keys.ptr, min_value_msat.ptr, invoice_expiry_delta_secs, entropy_source.ptr, current_time, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(keys); GC.KeepAlive(min_value_msat); GC.KeepAlive(invoice_expiry_delta_secs); @@ -266,7 +346,7 @@ public class UtilMethods { * [phantom node payments]: crate::sign::PhantomKeysManager */ public static Result_ThirtyTwoBytesNoneZ create_from_hash(org.ldk.structs.ExpandedKey keys, org.ldk.structs.Option_u64Z min_value_msat, byte[] payment_hash, int invoice_expiry_delta_secs, long current_time, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_from_hash(keys == null ? 0 : keys.ptr, min_value_msat.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta.ptr); + long ret = bindings.create_from_hash(keys.ptr, min_value_msat.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), invoice_expiry_delta_secs, current_time, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(keys); GC.KeepAlive(min_value_msat); GC.KeepAlive(payment_hash); @@ -299,7 +379,7 @@ public class UtilMethods { * Gets the weight for an HTLC-Success transaction. */ public static long htlc_success_tx_weight(org.ldk.structs.ChannelTypeFeatures channel_type_features) { - long ret = bindings.htlc_success_tx_weight(channel_type_features == null ? 0 : channel_type_features.ptr); + long ret = bindings.htlc_success_tx_weight(channel_type_features.ptr); GC.KeepAlive(channel_type_features); return ret; } @@ -308,7 +388,7 @@ public class UtilMethods { * Gets the weight for an HTLC-Timeout transaction. */ public static long htlc_timeout_tx_weight(org.ldk.structs.ChannelTypeFeatures channel_type_features) { - long ret = bindings.htlc_timeout_tx_weight(channel_type_features == null ? 0 : channel_type_features.ptr); + long ret = bindings.htlc_timeout_tx_weight(channel_type_features.ptr); GC.KeepAlive(channel_type_features); return ret; } @@ -341,7 +421,7 @@ public class UtilMethods { * Build a closing transaction */ public static byte[] build_closing_transaction(long to_holder_value_sat, long to_counterparty_value_sat, byte[] to_holder_script, byte[] to_counterparty_script, org.ldk.structs.OutPoint funding_outpoint) { - long ret = bindings.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, InternalUtils.encodeUint8Array(to_holder_script), InternalUtils.encodeUint8Array(to_counterparty_script), funding_outpoint == null ? 0 : funding_outpoint.ptr); + long ret = bindings.build_closing_transaction(to_holder_value_sat, to_counterparty_value_sat, InternalUtils.encodeUint8Array(to_holder_script), InternalUtils.encodeUint8Array(to_counterparty_script), funding_outpoint.ptr); GC.KeepAlive(to_holder_value_sat); GC.KeepAlive(to_counterparty_value_sat); GC.KeepAlive(to_holder_script); @@ -388,7 +468,7 @@ public class UtilMethods { * Encumbering a `to_holder` output on a commitment transaction or 2nd-stage HTLC transactions. */ public static byte[] get_revokeable_redeemscript(org.ldk.structs.RevocationKey revocation_key, short contest_delay, org.ldk.structs.DelayedPaymentKey broadcaster_delayed_payment_key) { - long ret = bindings.get_revokeable_redeemscript(revocation_key == null ? 0 : revocation_key.ptr, contest_delay, broadcaster_delayed_payment_key == null ? 0 : broadcaster_delayed_payment_key.ptr); + long ret = bindings.get_revokeable_redeemscript(revocation_key.ptr, contest_delay, broadcaster_delayed_payment_key.ptr); GC.KeepAlive(revocation_key); GC.KeepAlive(contest_delay); GC.KeepAlive(broadcaster_delayed_payment_key); @@ -402,7 +482,7 @@ public class UtilMethods { * the channel type. */ public static byte[] get_counterparty_payment_script(org.ldk.structs.ChannelTypeFeatures channel_type_features, byte[] payment_key) { - long ret = bindings.get_counterparty_payment_script(channel_type_features == null ? 0 : channel_type_features.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_key, 33))); + long ret = bindings.get_counterparty_payment_script(channel_type_features.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_key, 33))); GC.KeepAlive(channel_type_features); GC.KeepAlive(payment_key); if (ret >= 0 && ret <= 4096) { return null; } @@ -415,7 +495,7 @@ public class UtilMethods { * does not need to have its previous_output_index filled. */ public static byte[] get_htlc_redeemscript(org.ldk.structs.HTLCOutputInCommitment htlc, org.ldk.structs.ChannelTypeFeatures channel_type_features, org.ldk.structs.TxCreationKeys keys) { - long ret = bindings.get_htlc_redeemscript(htlc == null ? 0 : htlc.ptr, channel_type_features == null ? 0 : channel_type_features.ptr, keys == null ? 0 : keys.ptr); + long ret = bindings.get_htlc_redeemscript(htlc.ptr, channel_type_features.ptr, keys.ptr); GC.KeepAlive(htlc); GC.KeepAlive(channel_type_features); GC.KeepAlive(keys); @@ -447,7 +527,7 @@ public class UtilMethods { * commitment transaction). */ public static byte[] build_htlc_transaction(byte[] commitment_txid, int feerate_per_kw, short contest_delay, org.ldk.structs.HTLCOutputInCommitment htlc, org.ldk.structs.ChannelTypeFeatures channel_type_features, org.ldk.structs.DelayedPaymentKey broadcaster_delayed_payment_key, org.ldk.structs.RevocationKey revocation_key) { - long ret = bindings.build_htlc_transaction(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(commitment_txid, 32)), feerate_per_kw, contest_delay, htlc == null ? 0 : htlc.ptr, channel_type_features == null ? 0 : channel_type_features.ptr, broadcaster_delayed_payment_key == null ? 0 : broadcaster_delayed_payment_key.ptr, revocation_key == null ? 0 : revocation_key.ptr); + long ret = bindings.build_htlc_transaction(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(commitment_txid, 32)), feerate_per_kw, contest_delay, htlc.ptr, channel_type_features.ptr, broadcaster_delayed_payment_key.ptr, revocation_key.ptr); GC.KeepAlive(commitment_txid); GC.KeepAlive(feerate_per_kw); GC.KeepAlive(contest_delay); @@ -464,7 +544,7 @@ public class UtilMethods { * Returns the witness required to satisfy and spend a HTLC input. */ public static byte[] build_htlc_input_witness(byte[] local_sig, byte[] remote_sig, org.ldk.structs.Option_ThirtyTwoBytesZ preimage, byte[] redeem_script, org.ldk.structs.ChannelTypeFeatures channel_type_features) { - long ret = bindings.build_htlc_input_witness(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(local_sig, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(remote_sig, 64)), preimage.ptr, InternalUtils.encodeUint8Array(redeem_script), channel_type_features == null ? 0 : channel_type_features.ptr); + long ret = bindings.build_htlc_input_witness(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(local_sig, 64)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(remote_sig, 64)), preimage.ptr, InternalUtils.encodeUint8Array(redeem_script), channel_type_features.ptr); GC.KeepAlive(local_sig); GC.KeepAlive(remote_sig); GC.KeepAlive(preimage); @@ -547,7 +627,7 @@ public class UtilMethods { * Returns an error if it is invalid. */ public static Result_NoneLightningErrorZ verify_node_announcement(org.ldk.structs.NodeAnnouncement msg) { - long ret = bindings.verify_node_announcement(msg == null ? 0 : msg.ptr); + long ret = bindings.verify_node_announcement(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -561,7 +641,7 @@ public class UtilMethods { * Returns an error if one of the signatures is invalid. */ public static Result_NoneLightningErrorZ verify_channel_announcement(org.ldk.structs.ChannelAnnouncement msg) { - long ret = bindings.verify_channel_announcement(msg == null ? 0 : msg.ptr); + long ret = bindings.verify_channel_announcement(msg.ptr); GC.KeepAlive(msg); if (ret >= 0 && ret <= 4096) { return null; } Result_NoneLightningErrorZ ret_hu_conv = Result_NoneLightningErrorZ.constr_from_ptr(ret); @@ -599,7 +679,7 @@ public class UtilMethods { * Note that first_hops (or a relevant inner pointer) may be NULL or all-0s to represent None */ public static Result_RouteLightningErrorZ find_route(byte[] our_node_pubkey, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, ChannelDetails[] first_hops, org.ldk.structs.Logger logger, org.ldk.structs.ScoreLookUp scorer, org.ldk.structs.ProbabilisticScoringFeeParameters score_params, byte[] random_seed_bytes) { - long ret = bindings.find_route(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(our_node_pubkey, 33)), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16 == null ? 0 : first_hops_conv_16.ptr)), logger.ptr, scorer.ptr, score_params == null ? 0 : score_params.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(random_seed_bytes, 32))); + long ret = bindings.find_route(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(our_node_pubkey, 33)), route_params.ptr, network_graph.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(first_hops, first_hops_conv_16 => first_hops_conv_16.ptr)), logger.ptr, scorer.ptr, score_params.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(random_seed_bytes, 32))); GC.KeepAlive(our_node_pubkey); GC.KeepAlive(route_params); GC.KeepAlive(network_graph); @@ -626,7 +706,7 @@ public class UtilMethods { * Re-uses logic from `find_route`, so the restrictions described there also apply here. */ public static Result_RouteLightningErrorZ build_route_from_hops(byte[] our_node_pubkey, byte[][] hops, org.ldk.structs.RouteParameters route_params, org.ldk.structs.NetworkGraph network_graph, org.ldk.structs.Logger logger, byte[] random_seed_bytes) { - long ret = bindings.build_route_from_hops(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(our_node_pubkey, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(hops, hops_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(hops_conv_8, 33)))), route_params == null ? 0 : route_params.ptr, network_graph == null ? 0 : network_graph.ptr, logger.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(random_seed_bytes, 32))); + long ret = bindings.build_route_from_hops(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(our_node_pubkey, 33)), InternalUtils.encodeUint64Array(InternalUtils.mapArray(hops, hops_conv_8 => InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(hops_conv_8, 33)))), route_params.ptr, network_graph.ptr, logger.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(random_seed_bytes, 32))); GC.KeepAlive(our_node_pubkey); GC.KeepAlive(hops); GC.KeepAlive(route_params); @@ -673,19 +753,57 @@ public class UtilMethods { return ret_hu_conv; } + /** + * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of + * `path`, first calling [`Destination::resolve`] on `path.destination` with the given + * [`ReadOnlyNetworkGraph`]. + * + * Returns the node id of the peer to send the message to, the message itself, and any addresses + * needed to connect to the first node. + * + * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None + */ + public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message_resolving_destination(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.ReadOnlyNetworkGraph network_graph, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, org.ldk.structs.BlindedPath reply_path) { + long ret = bindings.create_onion_message_resolving_destination(entropy_source.ptr, node_signer.ptr, node_id_lookup.ptr, network_graph.ptr, path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); + GC.KeepAlive(entropy_source); + GC.KeepAlive(node_signer); + GC.KeepAlive(node_id_lookup); + GC.KeepAlive(network_graph); + GC.KeepAlive(path); + GC.KeepAlive(contents); + GC.KeepAlive(reply_path); + if (ret >= 0 && ret <= 4096) { return null; } + Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_id_lookup); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(network_graph); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(contents); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reply_path); }; + return ret_hu_conv; + } + /** * Creates an [`OnionMessage`] with the given `contents` for sending to the destination of * `path`. * * Returns the node id of the peer to send the message to, the message itself, and any addresses - * need to connect to the first node. + * needed to connect to the first node. + * + * Returns [`SendError::UnresolvedIntroductionNode`] if: + * - `destination` contains a blinded path with an [`IntroductionNode::DirectedShortChannelId`], + * - unless it can be resolved by [`NodeIdLookUp::next_node_id`]. + * Use [`create_onion_message_resolving_destination`] instead to resolve the introduction node + * first with a [`ReadOnlyNetworkGraph`]. * * Note that reply_path (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, org.ldk.structs.BlindedPath reply_path) { - long ret = bindings.create_onion_message(entropy_source.ptr, node_signer.ptr, path == null ? 0 : path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); + public static Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ create_onion_message(org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.NodeIdLookUp node_id_lookup, org.ldk.structs.OnionMessagePath path, org.ldk.structs.OnionMessageContents contents, org.ldk.structs.BlindedPath reply_path) { + long ret = bindings.create_onion_message(entropy_source.ptr, node_signer.ptr, node_id_lookup.ptr, path.ptr, contents.ptr, reply_path == null ? 0 : reply_path.ptr); GC.KeepAlive(entropy_source); GC.KeepAlive(node_signer); + GC.KeepAlive(node_id_lookup); GC.KeepAlive(path); GC.KeepAlive(contents); GC.KeepAlive(reply_path); @@ -693,6 +811,7 @@ public class UtilMethods { Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ ret_hu_conv = Result_C3Tuple_PublicKeyOnionMessageCOption_CVec_SocketAddressZZZSendErrorZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(entropy_source); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_signer); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(node_id_lookup); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(path); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(contents); }; if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(reply_path); }; @@ -706,7 +825,7 @@ public class UtilMethods { * receiver. */ public static Result_PeeledOnionNoneZ peel_onion_message(org.ldk.structs.OnionMessage msg, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, org.ldk.structs.CustomOnionMessageHandler custom_handler) { - long ret = bindings.peel_onion_message(msg == null ? 0 : msg.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr); + long ret = bindings.peel_onion_message(msg.ptr, node_signer.ptr, logger.ptr, custom_handler.ptr); GC.KeepAlive(msg); GC.KeepAlive(node_signer); GC.KeepAlive(logger); @@ -732,10 +851,11 @@ public class UtilMethods { /** * Create a one-hop blinded path for a payment. */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_one_hop_for_payment(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payee_node_id, 33)), payee_tlvs == null ? 0 : payee_tlvs.ptr, entropy_source.ptr); + public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_one_hop_for_payment(byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, short min_final_cltv_expiry_delta, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedPath_one_hop_for_payment(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payee_node_id, 33)), payee_tlvs.ptr, min_final_cltv_expiry_delta, entropy_source.ptr); GC.KeepAlive(payee_node_id); GC.KeepAlive(payee_tlvs); + GC.KeepAlive(min_final_cltv_expiry_delta); GC.KeepAlive(entropy_source); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); @@ -754,12 +874,13 @@ public class UtilMethods { * * [`ForwardTlvs`]: crate::blinded_path::payment::ForwardTlvs */ - public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(ForwardNode[] intermediate_nodes, byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, long htlc_maximum_msat, org.ldk.structs.EntropySource entropy_source) { - long ret = bindings.BlindedPath_new_for_payment(InternalUtils.encodeUint64Array(InternalUtils.mapArray(intermediate_nodes, intermediate_nodes_conv_13 => intermediate_nodes_conv_13 == null ? 0 : intermediate_nodes_conv_13.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payee_node_id, 33)), payee_tlvs == null ? 0 : payee_tlvs.ptr, htlc_maximum_msat, entropy_source.ptr); + public static Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ BlindedPath_new_for_payment(ForwardNode[] intermediate_nodes, byte[] payee_node_id, org.ldk.structs.ReceiveTlvs payee_tlvs, long htlc_maximum_msat, short min_final_cltv_expiry_delta, org.ldk.structs.EntropySource entropy_source) { + long ret = bindings.BlindedPath_new_for_payment(InternalUtils.encodeUint64Array(InternalUtils.mapArray(intermediate_nodes, intermediate_nodes_conv_13 => intermediate_nodes_conv_13.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payee_node_id, 33)), payee_tlvs.ptr, htlc_maximum_msat, min_final_cltv_expiry_delta, entropy_source.ptr); GC.KeepAlive(intermediate_nodes); GC.KeepAlive(payee_node_id); GC.KeepAlive(payee_tlvs); GC.KeepAlive(htlc_maximum_msat); + GC.KeepAlive(min_final_cltv_expiry_delta); GC.KeepAlive(entropy_source); if (ret >= 0 && ret <= 4096) { return null; } Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ ret_hu_conv = Result_C2Tuple_BlindedPayInfoBlindedPathZNoneZ.constr_from_ptr(ret); @@ -828,7 +949,7 @@ public class UtilMethods { * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes */ public static Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_zero_amount_invoice(org.ldk.structs.Bolt11Invoice invoice, long amount_msat) { - long ret = bindings.payment_parameters_from_zero_amount_invoice(invoice == null ? 0 : invoice.ptr, amount_msat); + long ret = bindings.payment_parameters_from_zero_amount_invoice(invoice.ptr, amount_msat); GC.KeepAlive(invoice); GC.KeepAlive(amount_msat); if (ret >= 0 && ret <= 4096) { return null; } @@ -851,7 +972,7 @@ public class UtilMethods { * [`ChannelManager::send_preflight_probes`]: lightning::ln::channelmanager::ChannelManager::send_preflight_probes */ public static Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ payment_parameters_from_invoice(org.ldk.structs.Bolt11Invoice invoice) { - long ret = bindings.payment_parameters_from_invoice(invoice == null ? 0 : invoice.ptr); + long ret = bindings.payment_parameters_from_invoice(invoice.ptr); GC.KeepAlive(invoice); if (ret >= 0 && ret <= 4096) { return null; } Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ ret_hu_conv = Result_C3Tuple_ThirtyTwoBytesRecipientOnionFieldsRouteParametersZNoneZ.constr_from_ptr(ret); @@ -902,7 +1023,7 @@ public class UtilMethods { * available and the current time is supplied by the caller. */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, string description, int invoice_expiry_delta_secs, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { - long ret = bindings.create_phantom_invoice(amt_msat.ptr, payment_hash.ptr, InternalUtils.encodeString(description), invoice_expiry_delta_secs, InternalUtils.encodeUint64Array(InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr)), entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); + long ret = bindings.create_phantom_invoice(amt_msat.ptr, payment_hash.ptr, InternalUtils.encodeString(description), invoice_expiry_delta_secs, InternalUtils.encodeUint64Array(InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19.ptr)), entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); GC.KeepAlive(amt_msat); GC.KeepAlive(payment_hash); GC.KeepAlive(description); @@ -967,7 +1088,7 @@ public class UtilMethods { * available and the current time is supplied by the caller. */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_phantom_invoice_with_description_hash(org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Option_ThirtyTwoBytesZ payment_hash, int invoice_expiry_delta_secs, org.ldk.structs.Sha256 description_hash, PhantomRouteHints[] phantom_route_hints, org.ldk.structs.EntropySource entropy_source, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta, long duration_since_epoch) { - long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, payment_hash.ptr, invoice_expiry_delta_secs, description_hash == null ? 0 : description_hash.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19 == null ? 0 : phantom_route_hints_conv_19.ptr)), entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); + long ret = bindings.create_phantom_invoice_with_description_hash(amt_msat.ptr, payment_hash.ptr, invoice_expiry_delta_secs, description_hash.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(phantom_route_hints, phantom_route_hints_conv_19 => phantom_route_hints_conv_19.ptr)), entropy_source.ptr, node_signer.ptr, logger.ptr, network, min_final_cltv_expiry_delta.ptr, duration_since_epoch); GC.KeepAlive(amt_msat); GC.KeepAlive(payment_hash); GC.KeepAlive(invoice_expiry_delta_secs); @@ -1010,7 +1131,7 @@ public class UtilMethods { * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, InternalUtils.encodeString(description), invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + long ret = bindings.create_invoice_from_channelmanager(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, InternalUtils.encodeString(description), invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); GC.KeepAlive(node_signer); GC.KeepAlive(logger); @@ -1048,7 +1169,7 @@ public class UtilMethods { * [`MIN_FINAL_CLTV_EXPIRY_DETLA`]: lightning::ln::channelmanager::MIN_FINAL_CLTV_EXPIRY_DELTA */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + long ret = bindings.create_invoice_from_channelmanager_with_description_hash(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash.ptr, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); GC.KeepAlive(node_signer); GC.KeepAlive(logger); @@ -1074,7 +1195,7 @@ public class UtilMethods { * available and the current time is supplied by the caller. */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, org.ldk.structs.Sha256 description_hash, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash == null ? 0 : description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + long ret = bindings.create_invoice_from_channelmanager_with_description_hash_and_duration_since_epoch(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, description_hash.ptr, duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); GC.KeepAlive(node_signer); GC.KeepAlive(logger); @@ -1101,7 +1222,7 @@ public class UtilMethods { * available and the current time is supplied by the caller. */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, long duration_since_epoch, int invoice_expiry_delta_secs, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, InternalUtils.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, InternalUtils.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); GC.KeepAlive(node_signer); GC.KeepAlive(logger); @@ -1128,7 +1249,7 @@ public class UtilMethods { * the payment hash is also involved outside the scope of lightning. */ public static Result_Bolt11InvoiceSignOrCreationErrorZ create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(org.ldk.structs.ChannelManager channelmanager, org.ldk.structs.NodeSigner node_signer, org.ldk.structs.Logger logger, Currency network, org.ldk.structs.Option_u64Z amt_msat, string description, long duration_since_epoch, int invoice_expiry_delta_secs, byte[] payment_hash, org.ldk.structs.Option_u16Z min_final_cltv_expiry_delta) { - long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager == null ? 0 : channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, InternalUtils.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), min_final_cltv_expiry_delta.ptr); + long ret = bindings.create_invoice_from_channelmanager_and_duration_since_epoch_with_payment_hash(channelmanager.ptr, node_signer.ptr, logger.ptr, network, amt_msat.ptr, InternalUtils.encodeString(description), duration_since_epoch, invoice_expiry_delta_secs, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), min_final_cltv_expiry_delta.ptr); GC.KeepAlive(channelmanager); GC.KeepAlive(node_signer); GC.KeepAlive(logger); diff --git a/c_sharp/src/org/ldk/structs/Utxo.cs b/c_sharp/src/org/ldk/structs/Utxo.cs index 8c885663..9749cfa6 100644 --- a/c_sharp/src/org/ldk/structs/Utxo.cs +++ b/c_sharp/src/org/ldk/structs/Utxo.cs @@ -32,7 +32,7 @@ public class Utxo : CommonBase { * The unique identifier of the output. */ public void set_outpoint(org.ldk.structs.OutPoint val) { - bindings.Utxo_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + bindings.Utxo_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -84,7 +84,7 @@ public class Utxo : CommonBase { * Constructs a new Utxo given each field */ public static Utxo of(org.ldk.structs.OutPoint outpoint_arg, org.ldk.structs.TxOut output_arg, long satisfaction_weight_arg) { - long ret = bindings.Utxo_new(outpoint_arg == null ? 0 : outpoint_arg.ptr, output_arg.ptr, satisfaction_weight_arg); + long ret = bindings.Utxo_new(outpoint_arg.ptr, output_arg.ptr, satisfaction_weight_arg); GC.KeepAlive(outpoint_arg); GC.KeepAlive(output_arg); GC.KeepAlive(satisfaction_weight_arg); @@ -131,7 +131,7 @@ public class Utxo : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.Utxo b) { - bool ret = bindings.Utxo_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.Utxo_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; @@ -146,7 +146,7 @@ public class Utxo : CommonBase { * Returns a `Utxo` with the `satisfaction_weight` estimate for a legacy P2PKH output. */ public static Utxo new_p2pkh(org.ldk.structs.OutPoint outpoint, long value, byte[] pubkey_hash) { - long ret = bindings.Utxo_new_p2pkh(outpoint == null ? 0 : outpoint.ptr, value, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey_hash, 20))); + long ret = bindings.Utxo_new_p2pkh(outpoint.ptr, value, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(pubkey_hash, 20))); GC.KeepAlive(outpoint); GC.KeepAlive(value); GC.KeepAlive(pubkey_hash); diff --git a/c_sharp/src/org/ldk/structs/UtxoFuture.cs b/c_sharp/src/org/ldk/structs/UtxoFuture.cs index bf797e5d..45097791 100644 --- a/c_sharp/src/org/ldk/structs/UtxoFuture.cs +++ b/c_sharp/src/org/ldk/structs/UtxoFuture.cs @@ -60,7 +60,7 @@ public class UtxoFuture : CommonBase { * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events */ public void resolve_without_forwarding(org.ldk.structs.NetworkGraph graph, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) { - bindings.UtxoFuture_resolve_without_forwarding(this.ptr, graph == null ? 0 : graph.ptr, result != null ? result.ptr : 0); + bindings.UtxoFuture_resolve_without_forwarding(this.ptr, graph.ptr, result.ptr); GC.KeepAlive(this); GC.KeepAlive(graph); GC.KeepAlive(result); @@ -81,7 +81,7 @@ public class UtxoFuture : CommonBase { * [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events */ public void resolve(org.ldk.structs.NetworkGraph graph, org.ldk.structs.P2PGossipSync gossip, org.ldk.structs.Result_TxOutUtxoLookupErrorZ result) { - bindings.UtxoFuture_resolve(this.ptr, graph == null ? 0 : graph.ptr, gossip == null ? 0 : gossip.ptr, result != null ? result.ptr : 0); + bindings.UtxoFuture_resolve(this.ptr, graph.ptr, gossip.ptr, result.ptr); GC.KeepAlive(this); GC.KeepAlive(graph); GC.KeepAlive(gossip); diff --git a/c_sharp/src/org/ldk/structs/UtxoLookup.cs b/c_sharp/src/org/ldk/structs/UtxoLookup.cs index baa1ac39..bd6705ae 100644 --- a/c_sharp/src/org/ldk/structs/UtxoLookup.cs +++ b/c_sharp/src/org/ldk/structs/UtxoLookup.cs @@ -40,7 +40,7 @@ public class UtxoLookup : CommonBase { byte[] _chain_hash_conv = InternalUtils.decodeUint8Array(_chain_hash); UtxoResult ret = arg.get_utxo(_chain_hash_conv, _short_channel_id); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); if (impl_holder.held != null) { impl_holder.held.ptrs_to.AddLast(ret); }; return result; } diff --git a/c_sharp/src/org/ldk/structs/UtxoResult.cs b/c_sharp/src/org/ldk/structs/UtxoResult.cs index 18c93278..8dbbc699 100644 --- a/c_sharp/src/org/ldk/structs/UtxoResult.cs +++ b/c_sharp/src/org/ldk/structs/UtxoResult.cs @@ -67,7 +67,7 @@ public class UtxoResult : CommonBase { * Utility method to constructs a new Sync-variant UtxoResult */ public static UtxoResult sync(org.ldk.structs.Result_TxOutUtxoLookupErrorZ a) { - long ret = bindings.UtxoResult_sync(a != null ? a.ptr : 0); + long ret = bindings.UtxoResult_sync(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); @@ -79,7 +79,7 @@ public class UtxoResult : CommonBase { * Utility method to constructs a new Async-variant UtxoResult */ public static UtxoResult async(org.ldk.structs.UtxoFuture a) { - long ret = bindings.UtxoResult_async(a == null ? 0 : a.ptr); + long ret = bindings.UtxoResult_async(a.ptr); GC.KeepAlive(a); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.UtxoResult ret_hu_conv = org.ldk.structs.UtxoResult.constr_from_ptr(ret); diff --git a/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs b/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs index 42692317..b3bff35f 100644 --- a/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs +++ b/c_sharp/src/org/ldk/structs/VerifiedInvoiceRequest.cs @@ -16,6 +16,28 @@ public class VerifiedInvoiceRequest : CommonBase { if (ptr != 0) { bindings.VerifiedInvoiceRequest_free(ptr); } } + /** + * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made. + */ + public OfferId get_offer_id() { + long ret = bindings.VerifiedInvoiceRequest_get_offer_id(this.ptr); + GC.KeepAlive(this); + if (ret >= 0 && ret <= 4096) { return null; } + org.ldk.structs.OfferId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.OfferId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; + } + + /** + * The identifier of the [`Offer`] for which the [`InvoiceRequest`] was made. + */ + public void set_offer_id(org.ldk.structs.OfferId val) { + bindings.VerifiedInvoiceRequest_set_offer_id(this.ptr, val.ptr); + GC.KeepAlive(this); + GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; + } + /** * Keys used for signing a [`Bolt12Invoice`] if they can be derived. * @@ -105,14 +127,12 @@ public class VerifiedInvoiceRequest : CommonBase { /** * The minimum amount required for a successful payment of a single item. - * - * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ - public Amount amount() { + public Option_AmountZ amount() { long ret = bindings.VerifiedInvoiceRequest_amount(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Amount ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Amount(null, ret); } + org.ldk.structs.Option_AmountZ ret_hu_conv = org.ldk.structs.Option_AmountZ.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } @@ -120,6 +140,8 @@ public class VerifiedInvoiceRequest : CommonBase { /** * A complete description of the purpose of the payment. Intended to be displayed to the user * but with the caveat that it has not been verified in any way. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public PrintableString description() { long ret = bindings.VerifiedInvoiceRequest_description(this.ptr); @@ -198,13 +220,15 @@ public class VerifiedInvoiceRequest : CommonBase { long ret = bindings.VerifiedInvoiceRequest_supported_quantity(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - org.ldk.structs.Quantity ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.Quantity(null, ret); } + org.ldk.structs.Quantity ret_hu_conv = org.ldk.structs.Quantity.constr_from_ptr(ret); if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; return ret_hu_conv; } /** * The public key used by the recipient to sign invoices. + * + * Note that the return value (or a relevant inner pointer) may be NULL or all-0s to represent None */ public byte[] signing_pubkey() { long ret = bindings.VerifiedInvoiceRequest_signing_pubkey(this.ptr); @@ -304,5 +328,99 @@ public class VerifiedInvoiceRequest : CommonBase { return ret_hu_conv; } + /** + * Creates an [`InvoiceBuilder`] for the request with the given required fields and using the + * [`Duration`] since [`std::time::SystemTime::UNIX_EPOCH`] as the creation time. + * + * See [`InvoiceRequest::respond_with_no_std`] for further details where the aforementioned + * creation time is used for the `created_at` parameter. + * + * [`Duration`]: core::time::Duration + */ + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash) { + long ret = bindings.VerifiedInvoiceRequest_respond_with(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_37 => payment_paths_conv_37.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); + GC.KeepAlive(this); + GC.KeepAlive(payment_paths); + GC.KeepAlive(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates an [`InvoiceBuilder`] for the request with the given required fields. + * + * Unless [`InvoiceBuilder::relative_expiry`] is set, the invoice will expire two hours after + * `created_at`, which is used to set [`Bolt12Invoice::created_at`]. Useful for `no-std` builds + * where [`std::time::SystemTime`] is not available. + * + * The caller is expected to remember the preimage of `payment_hash` in order to claim a payment + * for the invoice. + * + * The `payment_paths` parameter is useful for maintaining the payment recipient's privacy. It + * must contain one or more elements ordered from most-preferred to least-preferred, if there's + * a preference. Note, however, that any privacy is lost if a public node id was used for + * [`Offer::signing_pubkey`]. + * + * Errors if the request contains unknown required features. + * + * # Note + * + * If the originating [`Offer`] was created using [`OfferBuilder::deriving_signing_pubkey`], + * then use [`InvoiceRequest::verify`] and [`VerifiedInvoiceRequest`] methods instead. + * + * [`Bolt12Invoice::created_at`]: crate::offers::invoice::Bolt12Invoice::created_at + * [`OfferBuilder::deriving_signing_pubkey`]: crate::offers::offer::OfferBuilder::deriving_signing_pubkey + */ + public Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ respond_with_no_std(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash, long created_at) { + long ret = bindings.VerifiedInvoiceRequest_respond_with_no_std(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_37 => payment_paths_conv_37.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), created_at); + GC.KeepAlive(this); + GC.KeepAlive(payment_paths); + GC.KeepAlive(payment_hash); + GC.KeepAlive(created_at); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithExplicitSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses + * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use + * the same [`ExpandedKey`] as the one used to create the offer. + * + * See [`InvoiceRequest::respond_with`] for further details. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash) { + long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_37 => payment_paths_conv_37.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32))); + GC.KeepAlive(this); + GC.KeepAlive(payment_paths); + GC.KeepAlive(payment_hash); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + + /** + * Creates an [`InvoiceBuilder`] for the request using the given required fields and that uses + * derived signing keys from the originating [`Offer`] to sign the [`Bolt12Invoice`]. Must use + * the same [`ExpandedKey`] as the one used to create the offer. + * + * See [`InvoiceRequest::respond_with_no_std`] for further details. + * + * [`Bolt12Invoice`]: crate::offers::invoice::Bolt12Invoice + */ + public Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ respond_using_derived_keys_no_std(TwoTuple_BlindedPayInfoBlindedPathZ[] payment_paths, byte[] payment_hash, long created_at) { + long ret = bindings.VerifiedInvoiceRequest_respond_using_derived_keys_no_std(this.ptr, InternalUtils.encodeUint64Array(InternalUtils.mapArray(payment_paths, payment_paths_conv_37 => payment_paths_conv_37.ptr)), InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(payment_hash, 32)), created_at); + GC.KeepAlive(this); + GC.KeepAlive(payment_paths); + GC.KeepAlive(payment_hash); + GC.KeepAlive(created_at); + if (ret >= 0 && ret <= 4096) { return null; } + Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ ret_hu_conv = Result_InvoiceWithDerivedSigningPubkeyBuilderBolt12SemanticErrorZ.constr_from_ptr(ret); + return ret_hu_conv; + } + } } } } diff --git a/c_sharp/src/org/ldk/structs/WalletSource.cs b/c_sharp/src/org/ldk/structs/WalletSource.cs index b8900e77..1c0d68b8 100644 --- a/c_sharp/src/org/ldk/structs/WalletSource.cs +++ b/c_sharp/src/org/ldk/structs/WalletSource.cs @@ -48,20 +48,20 @@ public class WalletSource : CommonBase { public long list_confirmed_utxos() { Result_CVec_UtxoZNoneZ ret = arg.list_confirmed_utxos(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long get_change_script() { Result_CVec_u8ZNoneZ ret = arg.get_change_script(); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public long sign_psbt(long _psbt) { byte[] _psbt_conv = InternalUtils.decodeUint8Array(_psbt); Result_TransactionNoneZ ret = arg.sign_psbt(_psbt_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } } diff --git a/c_sharp/src/org/ldk/structs/WarningMessage.cs b/c_sharp/src/org/ldk/structs/WarningMessage.cs index 95407570..37699b4d 100644 --- a/c_sharp/src/org/ldk/structs/WarningMessage.cs +++ b/c_sharp/src/org/ldk/structs/WarningMessage.cs @@ -22,12 +22,13 @@ public class WarningMessage : CommonBase { * * All-0s indicates a warning unrelated to a specific channel. */ - public byte[] get_channel_id() { + public ChannelId get_channel_id() { long ret = bindings.WarningMessage_get_channel_id(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - byte[] ret_conv = InternalUtils.decodeUint8Array(ret); - return ret_conv; + org.ldk.structs.ChannelId ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ChannelId(null, ret); } + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); }; + return ret_hu_conv; } /** @@ -35,10 +36,11 @@ public class WarningMessage : CommonBase { * * All-0s indicates a warning unrelated to a specific channel. */ - public void set_channel_id(byte[] val) { - bindings.WarningMessage_set_channel_id(this.ptr, InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(val, 32))); + public void set_channel_id(org.ldk.structs.ChannelId val) { + bindings.WarningMessage_set_channel_id(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); + if (this != null) { this.ptrs_to.AddLast(val); }; } /** @@ -72,13 +74,14 @@ public class WarningMessage : CommonBase { /** * Constructs a new WarningMessage given each field */ - public static WarningMessage of(byte[] channel_id_arg, string data_arg) { - long ret = bindings.WarningMessage_new(InternalUtils.encodeUint8Array(InternalUtils.check_arr_len(channel_id_arg, 32)), InternalUtils.encodeString(data_arg)); + public static WarningMessage of(org.ldk.structs.ChannelId channel_id_arg, string data_arg) { + long ret = bindings.WarningMessage_new(channel_id_arg.ptr, InternalUtils.encodeString(data_arg)); GC.KeepAlive(channel_id_arg); GC.KeepAlive(data_arg); if (ret >= 0 && ret <= 4096) { return null; } org.ldk.structs.WarningMessage ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.WarningMessage(null, ret); } if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); }; + if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(channel_id_arg); }; return ret_hu_conv; } @@ -118,7 +121,7 @@ public class WarningMessage : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.WarningMessage b) { - bool ret = bindings.WarningMessage_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.WarningMessage_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/Watch.cs b/c_sharp/src/org/ldk/structs/Watch.cs index 95bf7129..cc60fa6f 100644 --- a/c_sharp/src/org/ldk/structs/Watch.cs +++ b/c_sharp/src/org/ldk/structs/Watch.cs @@ -54,7 +54,7 @@ public interface WatchInterface { * For details on asynchronous [`ChannelMonitor`] updating and returning * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`]. */ - ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] release_pending_monitor_events(); + FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ[] release_pending_monitor_events(); } /** @@ -90,7 +90,7 @@ public class Watch : CommonBase { if (_monitor_hu_conv != null) { _monitor_hu_conv.ptrs_to.AddLast(this); }; Result_ChannelMonitorUpdateStatusNoneZ ret = arg.watch_channel(_funding_txo_hu_conv, _monitor_hu_conv); GC.KeepAlive(arg); - long result = ret == null ? 0 : ret.clone_ptr(); + long result = ret.clone_ptr(); return result; } public ChannelMonitorUpdateStatus update_channel(long _funding_txo, long _update) { @@ -102,9 +102,9 @@ public class Watch : CommonBase { return ret; } public long release_pending_monitor_events() { - ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] ret = arg.release_pending_monitor_events(); + FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ[] ret = arg.release_pending_monitor_events(); GC.KeepAlive(arg); - long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_49 => ret_conv_49 == null ? 0 : ret_conv_49.clone_ptr())); + long result = InternalUtils.encodeUint64Array(InternalUtils.mapArray(ret, ret_conv_57 => ret_conv_57.clone_ptr())); return result; } } @@ -139,7 +139,7 @@ public class Watch : CommonBase { * [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected */ public Result_ChannelMonitorUpdateStatusNoneZ watch_channel(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelMonitor monitor) { - long ret = bindings.Watch_watch_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, monitor == null ? 0 : monitor.ptr); + long ret = bindings.Watch_watch_channel(this.ptr, funding_txo.ptr, monitor.ptr); GC.KeepAlive(this); GC.KeepAlive(funding_txo); GC.KeepAlive(monitor); @@ -168,7 +168,7 @@ public class Watch : CommonBase { * [`ChannelManager`]: crate::ln::channelmanager::ChannelManager */ public ChannelMonitorUpdateStatus update_channel(org.ldk.structs.OutPoint funding_txo, org.ldk.structs.ChannelMonitorUpdate update) { - ChannelMonitorUpdateStatus ret = bindings.Watch_update_channel(this.ptr, funding_txo == null ? 0 : funding_txo.ptr, update == null ? 0 : update.ptr); + ChannelMonitorUpdateStatus ret = bindings.Watch_update_channel(this.ptr, funding_txo.ptr, update.ptr); GC.KeepAlive(this); GC.KeepAlive(funding_txo); GC.KeepAlive(update); @@ -188,20 +188,20 @@ public class Watch : CommonBase { * For details on asynchronous [`ChannelMonitor`] updating and returning * [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`]. */ - public ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] release_pending_monitor_events() { + public FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ[] release_pending_monitor_events() { long ret = bindings.Watch_release_pending_monitor_events(this.ptr); GC.KeepAlive(this); if (ret >= 0 && ret <= 4096) { return null; } - int ret_conv_49_len = InternalUtils.getArrayLength(ret); - ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[] ret_conv_49_arr = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ[ret_conv_49_len]; - for (int x = 0; x < ret_conv_49_len; x++) { - long ret_conv_49 = InternalUtils.getU64ArrayElem(ret, x); - ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_hu_conv = new ThreeTuple_OutPointCVec_MonitorEventZPublicKeyZ(null, ret_conv_49); - if (ret_conv_49_hu_conv != null) { ret_conv_49_hu_conv.ptrs_to.AddLast(this); }; - ret_conv_49_arr[x] = ret_conv_49_hu_conv; + int ret_conv_57_len = InternalUtils.getArrayLength(ret); + FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ[] ret_conv_57_arr = new FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ[ret_conv_57_len]; + for (int f = 0; f < ret_conv_57_len; f++) { + long ret_conv_57 = InternalUtils.getU64ArrayElem(ret, f); + FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ ret_conv_57_hu_conv = new FourTuple_OutPointChannelIdCVec_MonitorEventZPublicKeyZ(null, ret_conv_57); + if (ret_conv_57_hu_conv != null) { ret_conv_57_hu_conv.ptrs_to.AddLast(this); }; + ret_conv_57_arr[f] = ret_conv_57_hu_conv; } bindings.free_buffer(ret); - return ret_conv_49_arr; + return ret_conv_57_arr; } } diff --git a/c_sharp/src/org/ldk/structs/WatchedOutput.cs b/c_sharp/src/org/ldk/structs/WatchedOutput.cs index 01192182..70f17e08 100644 --- a/c_sharp/src/org/ldk/structs/WatchedOutput.cs +++ b/c_sharp/src/org/ldk/structs/WatchedOutput.cs @@ -63,7 +63,7 @@ public class WatchedOutput : CommonBase { * Outpoint identifying the transaction output. */ public void set_outpoint(org.ldk.structs.OutPoint val) { - bindings.WatchedOutput_set_outpoint(this.ptr, val == null ? 0 : val.ptr); + bindings.WatchedOutput_set_outpoint(this.ptr, val.ptr); GC.KeepAlive(this); GC.KeepAlive(val); if (this != null) { this.ptrs_to.AddLast(val); }; @@ -93,7 +93,7 @@ public class WatchedOutput : CommonBase { * Constructs a new WatchedOutput given each field */ public static WatchedOutput of(org.ldk.structs.Option_ThirtyTwoBytesZ block_hash_arg, org.ldk.structs.OutPoint outpoint_arg, byte[] script_pubkey_arg) { - long ret = bindings.WatchedOutput_new(block_hash_arg.ptr, outpoint_arg == null ? 0 : outpoint_arg.ptr, InternalUtils.encodeUint8Array(script_pubkey_arg)); + long ret = bindings.WatchedOutput_new(block_hash_arg.ptr, outpoint_arg.ptr, InternalUtils.encodeUint8Array(script_pubkey_arg)); GC.KeepAlive(block_hash_arg); GC.KeepAlive(outpoint_arg); GC.KeepAlive(script_pubkey_arg); @@ -129,7 +129,7 @@ public class WatchedOutput : CommonBase { * Two objects with NULL inner values will be considered "equal" here. */ public bool eq(org.ldk.structs.WatchedOutput b) { - bool ret = bindings.WatchedOutput_eq(this.ptr, b == null ? 0 : b.ptr); + bool ret = bindings.WatchedOutput_eq(this.ptr, b.ptr); GC.KeepAlive(this); GC.KeepAlive(b); if (this != null) { this.ptrs_to.AddLast(b); }; diff --git a/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs b/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs index d7b0988e..045861df 100644 --- a/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs +++ b/c_sharp/src/org/ldk/structs/WriteableEcdsaChannelSigner.cs @@ -52,7 +52,7 @@ public class WriteableEcdsaChannelSigner : CommonBase { LDKWriteableEcdsaChannelSignerImpl impl = new LDKWriteableEcdsaChannelSignerImpl(arg, impl_holder); EcdsaChannelSigner ecdsaChannelSigner = EcdsaChannelSigner.new_impl(ecdsaChannelSigner_impl, channelSigner_impl, pubkeys); ChannelSigner channelSigner = ChannelSigner.new_impl(channelSigner_impl, pubkeys); - long[] ptr_idx = bindings.LDKWriteableEcdsaChannelSigner_new(impl, ecdsaChannelSigner.instance_idx, channelSigner.instance_idx, pubkeys == null ? 0 : pubkeys.clone_ptr()); + long[] ptr_idx = bindings.LDKWriteableEcdsaChannelSigner_new(impl, ecdsaChannelSigner.instance_idx, channelSigner.instance_idx, pubkeys.clone_ptr()); impl_holder.held = new WriteableEcdsaChannelSigner(null, ptr_idx[0]); impl_holder.held.instance_idx = ptr_idx[1];